OnepModel | R Documentation |
This function creates a model for one pool. It is a wrapper for the more
general function GeneralModel
.
OnepModel(t, k, C0, In, xi = 1, solver = deSolve.lsoda.wrapper, pass = FALSE)
t |
A vector containing the points in time where the solution is sought. |
k |
A scalar with the decomposition rate of the pool. |
C0 |
A scalar containing the initial amount of carbon in the pool. |
In |
A scalar or a data.frame object specifying the amount of litter inputs by time. |
xi |
A scalar or a data.frame specifying the external (environmental and/or edaphic) effects on decomposition rates. |
solver |
A function that solves the system of ODEs. This can be
|
pass |
if TRUE forces the constructor to create the model even if it is invalid |
Sierra, C.A., M. Mueller, S.E. Trumbore. 2012. Models of soil organic matter decomposition: the SoilR package version 1.0. Geoscientific Model Development 5, 1045-1060.
There are other predefinedModels
and also more
general functions like Model
.
t_start=0
t_end=10
tn=50
timestep=(t_end-t_start)/tn
t=seq(t_start,t_end,timestep)
k=0.8
C0=100
In = 30
Ex=OnepModel(t,k,C0,In)
Ct=getC(Ex)
Rt=getReleaseFlux(Ex)
Rc=getAccumulatedRelease(Ex)
plot(
t,
Ct,
type="l",
ylab="Carbon stocks (arbitrary units)",
xlab="Time (arbitrary units)",
lwd=2
)
plot(
t,
Rt,
type="l",
ylab="Carbon released (arbitrary units)",
xlab="Time (arbitrary units)",
lwd=2
)
plot(
t,
Rc,
type="l",
ylab="Cummulative carbon released (arbitrary units)",
xlab="Time (arbitrary units)",
lwd=2
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.