2.0.0b10
catchment modelling framework
Loading...
Searching...
No Matches
Jacobian Class Reference

Inherits object.

Detailed Description

Approximates the jacobian for a cmf solver
J[i,j] = (dxdt(S_i,t)[j]-dxdt(S,t)[j])/delta
S is the state vector
S_i equals S, except for S_i[i]=S[i]+delta
delta is the finite difference to approximate the Jacobian.
    delta should be a small number, but big enough to avoid floating point errors. 
    1e-6 to 1e-9 should be nice values

Usage to show the jacobian:
    # Allocate memory for the jacobian
    jac = Jacobian(solver,delta)
    # Calculate the Jacobian
    J = jac()
    # Show the Jacobian
    imshow(jac(),interpolation='nearest')

Public Member Functions

 __init__ (self, solver, delta=1e-6)
 
 dxdt (self)
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
solver,
delta = 1e-6 )
solver is a cmf integrator, delta is the amount the state should be changed

Member Function Documentation

◆ dxdt()

dxdt ( self)
Returns the current right hand side of the ODE for the current states and the current time