ParallelModel(SoilR)
ParallelModel()所属R语言包:SoilR
ParallelModel
ParallelModel
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function creates a numerical model for n independent (parallel) pools that can be queried afterwards. It is used by the convinient wrapper functions TwopParallelModel and ThreepParallelModel
这个函数创建了一个数学模型为n个独立的(水货)池后可以查询。它是用来方便易包装功能TwopParallelModel和ThreepParallelModel
用法----------Usage----------
ParallelModel(times, coeffs_tm, startvalues, inputrates, solverfunc = deSolve.lsoda.wrapper)
参数----------Arguments----------
参数:times
A vector containing the points in time where the solution is sought.
一种向量,包含的点的时间寻求溶液。
参数:coeffs_tm
A TimeMap object consisting of a vector valued function containing the decay rates for the n pools as function of time and the time range where this function is valid. The length of the vector is equal to the number of pools.
一个TimeMap对象组成的一个向量函数的n个为时间的函数,此功能有效的时间范围内的衰减率。该矢量的长度等于池的数量。
参数:startvalues
A vector containing the initial amount of carbon for the n pools. The length of this vector is equal to the number of pools and thus equal to the length of k. This is checked by the function.
一个向量,包含初始的碳量为N池。该矢量的长度等于池的数量,从而等于k的长度。这是检查由该函数。
参数:inputrates
A TimeMap object consisting of a vector valued function describing the inputs to the pools as funtions of time TimeMap.new
一个TimeMap对象组成的一个向量函数的输入池funtions的时间TimeMap.new
参数:solverfunc
The function used to actually solve the ODE system. This can be SoilR.euler or deSolve.lsoda.wrapper or any other user provided function with the same interface.
该函数用来真正解决ODE系统。这可能是SoilR.euler或deSolve.lsoda.wrapper或任何其他用户提供的函数具有相同的接口。
值----------Value----------
a model object
一个模型对象
(作者)----------Author(s)----------
Carlos A. Sierra <csierra@bgc-jena.mpg.de>, Markus Mueller <mamueller@bgc-jena.mpg.de>
实例----------Examples----------
t_start=0
t_end=10
tn=50
timestep=(t_end-t_start)/tn
t=seq(t_start,t_end,timestep)
k=TimeMap.new(t_start,t_end,function(times){c(-0.5,-0.2,-0.3)})
c0=c(1, 2, 3)
#constant inputrates[不变inputrates]
inputrates=TimeMap.new(
t_start,
t_end,
function(t){matrix(nrow=3,ncol=1,c(1,1,1))}
)
mod=ParallelModel(t,k,c0,inputrates)
Y=getC(mod)
lt1=1 ;lt2=2 ;lt3=3
col1=1; col2=2; col3=3
plot(t,Y[,1],type="l",lty=lt1,col=col1,
ylab="C stocks",xlab="Time")
lines(t,Y[,2],type="l",lty=lt2,col=col2)
lines(t,Y[,3],type="l",lty=lt3,col=col3)
legend(
"topleft",
c("C in pool 1",
"C in 2",
"C in pool 3"
),
lty=c(lt1,lt2,lt3),
col=c(col1,col2,col3)
)
Y=getAccumulatedRelease(mod)
plot(t,Y[,1],type="l",lty=lt1,col=col1,ylab="C release",xlab="Time")
lines(t,Y[,2],lt2,type="l",lty=lt2,col=col2)
lines(t,Y[,3],type="l",lty=lt3,col=col3)
legend("topright",c("R1","R2","R3"),lty=c(lt1,lt2,lt3),col=c(col1,col2,col3))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|