OnepModel: Implementation of a one pool model

OnepModelR Documentation

Implementation of a one pool model

Description

This function creates a model for one pool. It is a wrapper for the more general function GeneralModel.

Usage

OnepModel(t, k, C0, In, xi = 1, solver = deSolve.lsoda.wrapper, pass = FALSE)

Arguments

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 euler or deSolve.lsoda.wrapper or any other user provided function with the same interface.

pass

if TRUE forces the constructor to create the model even if it is invalid

References

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.

See Also

There are other predefinedModels and also more general functions like Model.

Examples

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
) 

SoilR documentation built on Oct. 13, 2023, 5:06 p.m.