Learn R Programming

simecol (version 0.5-5)

odeModel: Generating-functions (constructors) to create objects of classes `odeModel', `rwalkModel' and `gridModel'.

Description

These functions can be used to create simObj instances without using new explicitly.

Usage

odeModel(obj = NULL, main = NULL,
        equations = NULL, times = c(from = 0, to = 10, by = 1),
        init = numeric(0), parms = numeric(0),
        inputs = NULL, solver = "rk4", initfunc = NULL)

gridModel(obj=NULL, main=NULL,
        equations=NULL, times=c(from=0, to=10, by=1),
        init=matrix(0), parms=list(),
        inputs=NULL, solver="iteration", initfunc=NULL)

rwalkModel(obj=NULL, main=NULL, 
        equations=NULL, times=c(from=0, to=10, by=1),
        init=NULL, parms=list(),
        inputs=NULL, solver="iteration", initfunc=NULL)

Arguments

obj
Unnamed arguments are regarded as objects of the corresponding class. If obj is omitted, the new object is created from scratch.
main
The main equations of the model.
equations
The sub-models (sub-equations and of the model).
times
A vector of time steps or a vector with three named values from, to, by specifying the simulation time steps. The `from-to-by' form can be edited with fixParms.
init
Initial values (start values) of the state variable given as named vector.
parms
A vector or list (depending on the respective class) of constant parameters.
inputs
Optional time-dependend input variables (matrix or data frame).
solver
The solver used to integrate the model.
initfunc
The function is called by the initialize mechanism and allows direct access and manipulation of all slots of the object in creation

Value

  • The function returns an S4 object of type odeModel, rwalkModel, gridModel

Details

These functions provide an alternative way to create simObj instances in addition to the standard S4 new mechanism. The functions are provided mainly for compatibility with older versions of simecol. See simecol-package and the examples for details about the slots.

See Also

new, new, simecol-package