Usage
lsodar(y, times, func, parms, rtol=1e-6, atol=1e-6,
jacfunc=NULL, jactype="fullint", rootfunc=NULL, verbose=FALSE,
nroot=0, tcrit=NULL, hmin=0, hmax=NULL, hini=0, ynames=TRUE,
maxordn=12, maxords = 5, bandup=NULL, banddown=NULL, maxsteps=5000,
dllname=NULL, initfunc=dllname, initpar=parms, rpar=NULL,
ipar=NULL, nout=0, outnames=NULL, ...)
Arguments
y
the initial (state) values for the ODE system. If y
has a name attribute, the names will be used to label the output matrix.
times
times at which explicit estimates for y
are desired. The first value in times
must be the initial time.
func
either an R-function that computes the values of the
derivatives in the ODE system (the model definition) at time
t, or a character string
giving the name of a compiled function in a dynamically loaded
shared library.
parms
vector or list of parameters used in func
or jacfunc
.
rtol
relative error tolerance, either a scalar or an array as
long as y
. See details.
atol
absolute error tolerance, either a scalar or an array as
long as y
. See details.
jacfunc
if not NULL
, an Rfunction, that computes
the jacobian of the system of differential equations
dydot(i)/dy(j), or a string giving the name of a function or
subroutine in dllname that computes the jacobian (see De
jactype
the structure of the jacobian, one of "fullint", "fullusr", "bandusr" or "bandint" - either full or banded and estimated internally or by user
rootfunc
if not NULL
, an Rfunction that computes
the function whose root has to be estimated or a string giving the name of a function or
subroutine in dllname that computes the root function. The Rcalling sequence for
verbose
a logical value that, when TRUE, triggers more
verbose output from the ODE solver. Will output the settings of vectors *istate* and *rstate* - see details
nroot
only used if dllname is specified: the number of constraint functions whose roots are desired during the integration; if rootfunc
is an R-function, the solver estimates the number of roots
tcrit
if not NULL
, then lsodar
cannot integrate past tcrit
. The Fortran routine lsodar
overshoots its targets
(times points in the vector times
), and interpolates values
for the desire
hmin
an optional minimum value of the integration
stepsize. In special situations this parameter may speed up computations with
the cost of precision. Don't use hmin
if you don't know why!
hmax
an optional maximum value of the integration stepsize. If not specified, hmax
is set to the largest difference in times
, to avoid that the simulation possibly ignores short-term events. If 0, no maximal size is specified
hini
initial step size to be attempted; if 0, the initial step size is determined by the solver
ynames
if FALSE: names of state variables are not passed to function func
; this may speed up the simulation especially for multi-D models
maxordn
the maximum order to be allowed in case the method is non-stiff. Should be
maxords
the maximum order to be allowed in case the method is stiff. Should be
bandup
number of non-zero bands above the diagonal, in case the Jacobian is banded
banddown
number of non-zero bands below the diagonal, in case the Jacobian is banded
maxsteps
maximal number of steps during one call to the solver
dllname
a string giving the name of the shared library (without
extension) that contains all the compiled function or subroutine
definitions refered to in func
and jacfunc
. See package vignette
initfunc
if not NULL, the name of the initialisation function (which initialises values of parameters), as provided in dllname. See package vignette.
initpar
only when dllname is specified and an initialisation function initfunc
is in the dll: the parameters passed to the initialiser, to initialise the common blocks (fortran) or global variables (C, C++)
rpar
only when dllname is specified: a vector with double precision values passed to the dll-functions whose names are specified by func
and jacfunc
ipar
only when dllname is specified: a vector with integer values passed to the dll-functions whose names are specified by func
and jacfunc
nout
only used if dllname
is specified and the model is defined in compiled code: the number of output variables calculated in the compiled function func
, present in the shared library. Note:
it is not automatically checked whet
outnames
only used if dllname is specified and nout
> 0: the names of output variables calculated in the compiled function func
, present in the shared library
...
additional arguments passed to func
and jacfunc
allowing this to be a generic function