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

Description

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:

  1. For models with many pools the matrix representation makes the source code noisy and difficult to check.

  2. 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.

  3. 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:

  1. Instead of the whole matrix (nxn) only the existing fluxes have to be provided.

  2. The fluxfunctions are scalar.

  3. Nonlinear fluxfunctions can be written as functions of the state variable. The correct arguments are mapped automatically.

  4. 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.

Usage

## S4 method for signature 
## 'missing,
##   numeric,
##   UnBoundNonLinDecompOp_by_PoolNames,
##   numeric,
##   InFluxList_by_PoolName,
##   missing,
##   missing,
##   missing,
##   missing'
Model_by_PoolNames(times, mat, initialValues, inputFluxes)

Arguments

times

object of class:numeric, no manual documentation

mat

object of class:UnBoundNonLinDecompOp_by_PoolNames, UnBoundNonLinDecompOp_by_PoolNames

initialValues

object of class:numeric, no manual documentation

inputFluxes

object of class:InFluxList_by_PoolName, codeInFluxList_by_PoolName

Value

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.


[Package SoilR version 1.2.105 Index]