180: get the release rate for all pools

Description Arguments Details Value Author(s) Examples

Description

The method computes the release of carbon per time for all points in time specified in the Model objects time slot.

Arguments

object

an object of class Model created by a call to a constructor e.g. Model, GeneralModelor other model creating functions.

Details

This function takes a Model object, which represents a system of ODEs

dC(t)/dt = I(t) + A(t)C(t)

solves the system for C(t), calculates the release coefficients R(t), and computes the release flux as R(t) C(t). The numerical solver used can be specified in the model creating functions like e.g. Model.

Value

A n x m matrix of release fluxes with m columns representing the number of pools, and n rows representing the time step as specified by the argument t in Model, GeneralModel or another model creating function.

Author(s)

Carlos A. Sierra <csierra@bgc-jena.mpg.de>, Markus Mueller <mamueller@bgc-jena.mpg.de>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# create the model
t_start=0 
t_end=10 
tn=50
timestep=(t_end-t_start)/tn 
t=seq(t_start,t_end,timestep) 

Ex=TwopParallelModel(t,ks=c(k1=0.5,k2=0.2),C0=c(c10=100, c20=150),In=10,gam=0.7,xi=0.5)
# get the carbon stocks 
Ct=getC(Ex)
# get the release rates
Rt=getReleaseFlux(Ex)

par(mfrow=c(2,1))
plot(t,rowSums(Ct),type="l",lwd=2,
     ylab="Carbon stocks (arbitrary units)",xlab="Time",ylim=c(0,sum(Ct[1,]))) 
lines(t,Ct[,1],col=2)
lines(t,Ct[,2],col=4)
legend("topright",c("Total C","C in pool 1", "C in pool 2"),
       lty=c(1,1,1),col=c(1,2,4),lwd=c(2,1,1),bty="n")

plot(t,rowSums(Rt),type="l",ylab="Carbon released (arbitrary units)",
     xlab="Time",lwd=2,ylim=c(0,sum(Rt[1,]))) 
lines(t,Rt[,1],col=2)
lines(t,Rt[,2],col=4) 
legend("topright",c("Total C release","C release from pool 1", "C release from pool 2"),
       lty=c(1,1,1),col=c(1,2,4),lwd=c(2,1,1),bty="n")

par(mfrow=c(1,1))

SoilR documentation built on May 1, 2019, 8:06 p.m.