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

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

[复制链接]
发表于 2012-9-30 10:24:18 | 显示全部楼层 |阅读模式
simpleEuler(smfsb)
simpleEuler()所属R语言包:smfsb

                                        Simulate a sample path from an ODE model
                                         从ODE模型模拟的样本路径

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

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

This function integrates an Ordinary Differential Equation (ODE) model using a simple first order Euler method. The function is pedagogic and not intended for serious use. See the deSolve package for better, more robust ODE solvers.
该功能集成了常微分方程(ODE)模型,使用简单的一阶Euler方法。的功能是教学,而不是用于严重的使用。见deSolve包更好,更强大的ODE求解器的。


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


simpleEuler(t=50, dt=0.001, fun, ic, ...)



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

参数:t
The length of the time interval over which the ODE model is to be integrated. Defaults to 50 time units.
ODE模型以集成的时间间隔的长度。默认为50个时间单位。


参数:dt
The step size to be used both for the time step of the Euler integration method and the recording interval for the output. It would probably be better to have separate parameters for these two things (see StepEuler and simTs). Defaults to 0.01 time units.
的步长大小,以既用于欧拉集成的方法和用于输出的记录间隔的时间步长。它可能是更好的为这两件事情有不同的参数(见StepEuler和simTs“)。默认为0.01个时间单位。


参数:fun
A vector-valued function representing the right hand side of the ODE model. The first argument is a vector representing the current state of the model, x.  The second argument of fun is the current simulation time, t. In the case of a homogeneous ODE model, this argument will be unused within the function. The function may have additional arguments, representing model parameters. The output of fun should be a vector of the same dimension as x.
一个向量函数的ODE模型代表的右侧。第一个参数是一个向量,表示当前状态的模型,x。 fun的第二个参数是当前的仿真时间,t。在一个齐次微分方程模型的情况下,这个参数将未使用的函数内。该函数可能有额外的参数,模型参数。的输出fun应该是相同的尺寸,x的向量。


参数:ic
The initial conditions for the ODE model. This should be a vector of the same dimensions as the output from fun, and the second argument of fun.
ODE模型的初始条件。这应该是一个矢量fun的输出相同的尺寸,第二个参数fun。


参数:...
Additional arguments will be passed into fun.
额外的参数将被传递到fun。


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

An R ts object containing the sampled path of the model.
Rts对象的模型包含样本路径。


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

rdiff, ts, StepEuler,
rdiff,ts,StepEuler,


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


# simple Lotka-Volterra example[简单的Lotka-Volterra的例子]
lv <- function(x,t,k=c(k1=1,k2=0.1,k3=0.1))
{
        with(as.list(c(x,k)),{
                c( k1*x1 - k2*x1*x2 ,
                      k2*x1*x2 - k3*x2 )
        })
}
plot(simpleEuler(t=100,fun=lv,ic=c(x1=4,x2=10)),plot.type="single",lty=1:2)

# now an example which instead uses deSolve...[现在是一个例子,而不是使用deSolve ...]
require(deSolve)
times = seq(0,50,by=0.01)
k = c(k1=1,k2=0.1,k3=0.1)
lvlist = function(t,x,k)
        list(lv(x,t,k))
plot(ode(y=c(x1=4,x2=10),times=times,func=lvlist,parms=k))


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-29 04:12 , Processed in 0.026212 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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