Learn R Programming

SoilR (version 1.0-0)

OnepModel: 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)

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 ode or any other user provided function with the same interface.

Value

  • A Model Object that can be further queried

See Also

TwopParallelModel,TwopFeedbackModel

Examples

Run this code
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=getRelease(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)

Run the code above in your browser using DataLab