找回密码
 注册
查看: 321|回复: 0

R语言 SoilR包 GeneralModel_14()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 11:32:32 | 显示全部楼层 |阅读模式
GeneralModel_14(SoilR)
GeneralModel_14()所属R语言包:SoilR

                                        The most general costructor for class Model14
                                         最普遍的costructor类Model14

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

The function creates a numerical model  for n arbitrarily connected pools. It is one of the constructors of class Model14 which is a subclass of Model It will be used by some more specialized wrapper functions like for instance but can also be used directly. It is in fact the most
该函数创建了一个数学模型为n任意连接池。它是一个构造函数的类Model14的一个子类的模型将使用一些更专业的包装功能,例如像,但也可以直接使用。事实上,它是最


用法----------Usage----------





参数----------Arguments----------

参数:t
A vector containing the points in time where the solution is sought.
一种向量,包含的点的时间寻求溶液。


参数:A
A DecompositionOperator object consisting of  a matrix valued function describing the whole model decay rates for the n pools, connection and feedback coefficients as functions of time and a time range for which this function is valid. The size of the quadtratic matric must be equal to the number of pools. The time range must cover the times given in the first argument.
一个DecompositionOperator对象组成的矩阵值函数描述的N池,连接和反馈系数为时间的函数,此功能有效的时间范围为整个模型的衰减率。的大小必须的quadtratic基质池的数量相等。必须涵盖的时间范围内的第一个参数的时间。


参数:ivList
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 correctnessOfModel.
一个向量,包含初始的碳量为N池。该矢量的长度等于池的数量,从而等于k的长度。这是检查的功能correctnessOfModel。


参数:inputFluxes
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。


参数:Fc
A TimeMap object consisting of  a function describing the fraction of C_14 in per mille.
一个TimeMap对象组成的一个函数的分数C_14每千。


参数:di

参数:solverfunc
The function used by 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或任何其他用户提供的函数具有相同的接口。


参数:pass
if TRUE Forces the constructor to create the model even if it is invalid
如果TRUE部队的构造函数来创建模型,即使它是无效的


值----------Value----------

A model object that can be further queried.
模型对象,可以进一步查询。


(作者)----------Author(s)----------


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



参见----------See Also----------

Model
Model


实例----------Examples----------


t_start=1960
t_end=2010
tn=220
timestep=(t_end-t_start)/tn
t=seq(t_start,t_end,timestep)
n=3
At=new(Class="DecompositionOperator",
  t_start,
  t_end,
  function(t0){
        matrix(nrow=n,ncol=n,byrow=TRUE,
          c(-1,    0.1,    0,
             0.5  , -0.4,    0,   
             0,    0.2,   -0.1)
        )
  }
)

c0=c(100, 100, 100)
#constant inputrate[不变inputrate]
inputFluxes=new(
  "TimeMap",
  t_start,
  t_end,
  function(t0){matrix(nrow=n,ncol=1,c(10,10,10))}
)
# we have a dataframe representing the C_14 fraction [我们有一个数据框代表C_14部分]
# note that the time unit is in years.[请注意,时间单位为年。]
# This means that all the other data provided are assumed to have the same value[这意味着,所有的提供的其它数据被假定为具有相同的值]
# This is especially true for the decay constants to be specified later[这是特别真实的衰变常数指定]
data(C14Atm_NH)
Fc=TimeMap.from.Dataframe(C14Atm_NH)
#Fc=TimeMap.from.Dataframe(C14Atm_NH)[FC = TimeMap.from.Dataframe,(C14Atm_NH)]
# add the C14 decay to the matrix which is done by a diagonal matrix which does not vary over time[添加的C14衰减到这是通过一个对角矩阵的矩阵不随时间而变化的]
# we assume a half life th=5730 years[我们假设一个半衰期日=5730年]
th=5730
k=log(0.5)/th #note that k is negative and has the unit y^-1[注意,k为负的,并且具有单元y ^ -1]

mod=GeneralModel_14(t,At,c0,inputFluxes,Fc,k)
#start plots[开始图]
par(mfrow=c(3,2))
   lt1=1;  lt2=2; lt3=3
   col1=1;  col2=2; col3=3
   # plot the C and C14 curves[绘制的C和C14曲线]
   Ct=getC(mod)
   plot(t,Ct[,1],type="l",lty=lt1,col=col1, ylim=c(0,200),
        ylab="C stocks (arbitrary units)",xlab="Time")
   lines(t,Ct[,2],type="l",lty=lt2,col=col2)
   lines(t,Ct[,3],type="l",lty=lt3,col=col3,lwd=2)
   legend(
      "topright",
      c("C in pool 1",
        "C in pool 2",
        "C in pool 3"
      ),
      lty=c(lt1,lt2,lt3),
      col=c(col1,col2,col3)
   )
   C14t=getC14(mod)
   plot(t,C14t[,1]/1000,type="l",lty=lt1,col=col1, ylim=c(0,100),
        ylab="14C stocks (arbitrary units)",xlab="Time")
   lines(t,C14t[,2]/1000,type="l",lty=lt2,col=col2)
   lines(t,C14t[,3]/1000,type="l",lty=lt3,col=col3)
   legend(
      "topright",
      c("14C in pool 1",
        "14C in pool 2",
        "14C in pool 3"
      ),
      lty=c(lt1,lt2,lt3),
      col=c(col1,col2,col3)
   )
   #now plot the C14 Fraction in the atmosphere and compute the C14/C fraction of in the Soil [现在绘制的C14馏分在大气和土壤中的计算的C 14 / C馏分]

   FC14=getSoilC14Fraction(mod)
   plot(C14Atm_NH, type="l",xlim=c(1960,2010))
   lines(t,FC14[,1],lty=lt1,col=col1)
   lines(t,FC14[,2],lt2,type="l",lty=lt2,col=col2)
   lines(t,FC14[,3],type="l",lty=lt3,col=col3)
   legend("topleft",c(
                      expression(F[1]),
                      expression(F[2]),
                      expression(F[3])
                    )
   ,lty=c(lt1,lt2,lt3),col=c(col1,col2,col3))

   
#now compute the release flux[现在计算的释放通量]
   Rt=getReleaseFlux(mod)
   plot(t,Rt[,1],type="l",lty=lt1,col=col1,ylab="C Release Flux (arbitrary units)",xlab="Time",ylim=c(0,50))
   lines(t,Rt[,2],lt2,type="l",lty=lt2,col=col2)
   lines(t,Rt[,3],type="l",lty=lt3,col=col3)
   legend("topleft",c("RF1","RF2","RF3"),lty=c(lt1,lt2,lt3),col=c(col1,col2,col3))
   #now compute the c14 release flux[现在计算C14的释放通量]
   R14t=getReleaseFlux14(mod)/1000
   plot(t,R14t[,1],type="l",lty=lt1,col=col1,ylab="C14 Release Flux (arbitrary units)",xlab="Time")
   lines(t,R14t[,2],lt2,type="l",lty=lt2,col=col2)
   lines(t,R14t[,3],type="l",lty=lt3,col=col3)
   legend("topleft",c(
                      expression(RF[14]^1),
                      expression(RF[14]^2),
                      expression(RF[14]^3)
                    )
   ,lty=c(lt1,lt2,lt3),col=c(col1,col2,col3))

R14m=getTotalReleaseFluxC14CRatio(mod)
C14m=getTotalC14CRatio(mod)
plot(C14Atm_NH, type="l",xlim=c(1960,2010),col=4)
lines(t,C14m)
lines(t,R14m,col=2)
legend("topright",c("Atmosphere","Mean SOM-14C","Mean Release 14C"),lty=rep(1,3),col=c(4,1,2),bty="n")

par(mfrow=c(1,1))


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-9 10:01 , Processed in 0.031396 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表