Calculates the C content of the pools

Share:

Description

This function computes the carbon content of the pools as function of time. Have a look at the methods for details.

Usage

1
getC(object, as.closures = F)

Arguments

object

some model object, the actual class depends on the method used.

as.closures

if set to TRUE instead of a matrix a list of functions will be returned.

Details

This function takes a Model object, which represents a system of ODEs and solves the system for C(t). The numerical solver used can be specified in the constructors of the Model classes e.g. Model,Model_14,GeneralModel.

Value

A matrix with m columns representing the number of pools, and n rows representing the times as specified by the argument t in GeneralModel or another model creating function.

Author(s)

Carlos A. Sierra, Markus Mueller

See Also

See examples in GeneralModel, GeneralModel_14, TwopParallelModel, TwopSeriesModel, TwopFeedbackModel, etc.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# This test function produces the example for testing the function getC
  t=seq(0,10,by=0.1) 
  k=0.8
  C0=100
  In = 30
  
  #Create two models with same arguments but calling two different model creation functions
  Cmodel=OnepModel(t,k,C0,In)
  C14model=OnepModel14(t,k,C0,In,F0=0,inputFc=IntCal09)
  
  #getC can extract the amount of C from these two type of models
  Ctmodel=getC(Cmodel)
  Ctmodel14=getC(C14model)
  
  #The output is identical because parameter values are the same
  plot(t,Ctmodel,type="l")
  lines(t,Ctmodel14,col=2,lty=2,lwd=2)
  legend("topright",c("OnepModel output","OnepModel14 output"),col=1:2,lty=1:2,bty="n")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.