Model_by_PoolNames,missing,numeric,UnBoundNonLinDecompOp_by_PoolNames,numeric,InFluxList_by_PoolName,missing,missing,missing,missing-method {SoilR} | R Documentation |
Create a model(run) described by fluxes
A flux and pool name based description is interesting for models where the traditional matrix based approach becomes difficult to manage:
For models with many pools the matrix representation makes the source code noisy and difficult to check.
Especially for nonlinear models, where the matrix is not only a function of time but also of the state vector the latter has to be decomposed in the user code.
Although mathematically equivalent the traditional matrix based representation is more opaque to automatic inspection by R. As a result it is not possible to automatically resolve the connectivity between the pools, or determine which pools have in/out-fluxes since for vector and matrix valued functions R can not determine which components are allways zero.
The newer flux and pool name based approach has several advantages:
Instead of the whole matrix (nxn) only the existing fluxes have to be provided.
The fluxfunctions are scalar.
Nonlinear fluxfunctions can be written as functions of the state variable. The correct arguments are mapped automatically.
Since only the existing fluxes are provided the model structure can be found by inspection. E.g. connectivity graph can be drawn, which is very helpful top find mistakes in models with many pools.
## S4 method for signature ## 'missing, ## numeric, ## UnBoundNonLinDecompOp_by_PoolNames, ## numeric, ## InFluxList_by_PoolName, ## missing, ## missing, ## missing, ## missing' Model_by_PoolNames(times, mat, initialValues, inputFluxes)
times |
object of class: |
mat |
object of class: |
initialValues |
object of class: |
inputFluxes |
object of class: |
A possibly nonlinear Model(run) that contains information about the pool names and connectivity of the pools and is therefore the preferred representation for new code.