- y
the initial guess of (state) values for the ode system, a vector.
If y
has a name attribute, the names will be used to label the
output matrix.
- time, times
time for which steady-state is wanted; the default is
times
=0.
(note- since version 1.7, 'times' has been added as an alias to 'time').
- func
either a user-supplied function that computes the values of the
derivatives in the ode system (the model definition) at time
time
, or a character string giving the name of a
compiled function in a dynamically loaded shared library.
If func
is a user-supplied function, it must be called as:
yprime = func(t, y, parms)
. t
is the time point
at which the steady-state is wanted, y
is the current estimate of
the variables in the ode system. If the initial values y
has a
names attribute, the names will be available inside func
.
parms
is a vector of parameters (which may have a names attribute).
The return value of func
should be a list, whose first element is a
vector containing the derivatives of y
with respect to
time
, and whose next elements (possibly with a
names
attribute) are global values that are required as
output.
The derivatives
should be specified in the same order as the state variables y
.
If func
is a string, then dllname
must give the name
of the shared library (without extension) which must be loaded
before stodes()
is called. see Details for more information.
- parms
other parameters passed to func
.
- rtol
relative error tolerance, either a scalar or a vector, one
value for each y.
- atol
absolute error tolerance, either a scalar or a vector, one
value for each y.
- ctol
if between two iterations, the maximal change in y is less
than this amount, steady-state is assumed to be reached.
- sparsetype
the sparsity structure of the Jacobian, one of
"sparseint", "sparseusr", "sparsejan", "sparsereturn", ...,
The sparsity can be estimated internally by stodes (first and last option)
or given by the user (other two). See details.
Note: setting sparsetype
equal to "sparsereturn" will not solve for
steady-state but solely return the ian
and jan
vectors.
- verbose
if TRUE: full output to the screen, e.g. will output the
steady-state settings.
- nnz
the number of nonzero elements in the sparse Jacobian (if
this is unknown, use an estimate); If NULL, a guess will be made, and
if not sufficient, stodes
will return with a message indicating
the size actually required.
If a solution is found, the minimal value of nnz
actually required
is returned by the solver (1st element of attribute dims
).
- inz
if sparsetype
equal to "sparseusr", a two-columned matrix
with the (row, column) indices to the nonzero elements in the sparse
Jacobian. If sparsetype
= "sparsejan", a vector with the elements
ian followed by the elements jan as used in the stodes code. See details.
In all other cases, ignored.
If inz
is NULL, the sparsity will be determined by stodes
.
- lrw
the length of the work array of the solver; due to the sparsicity,
this cannot be readily predicted. If NULL
, a guess will be made, and
if not sufficient, stodes
will return with a message indicating
that lrw should be increased. Therefore, some experimentation may be
necessary to estimate the value of lrw
.
If a solution is found, the minimal value of lrw
actually required
is returned by the solver (3rd element of attribute dims
).
In case of an error induced by a too small value of lrw
, its value
can be assessed by the attributes()$dims
value.
- ngp
number of groups of independent state variables. Due to the
sparsicity, this cannot be readily predicted. If NULL, a guess will be
made, and if not sufficient, stodes
will return with a message
indicating the size actually required. Therefore, some experimentation
may be necessary to estimate the value of ngp
If a solution is found, the minimal value of ngp
actually required
is returned by the solver (2nd element of attribute dims
.
- positive
either a logical or a vector with indices of the state
variables that have to be non-negative; if TRUE, the state variables are
forced to be non-negative numbers.
- maxiter
maximal number of iterations during one call to 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.
- dllname
a string giving the name of the shared library (without
extension) that contains all the compiled function or subroutine
definitions referred to in func
.
- initfunc
if not NULL, the name of the initialisation function
(which initialises values of parameters), as provided in dllname
.
See details.
- 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
.
- ipar
only when dllname
is specified: a vector with integer
values passed to the dll-functions whose names are specified by func
.
- nout
only used if dllname
is specified: the number of output
variables calculated in the compiled function func
, present in the
shared library.
- 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.
- spmethod
the sparse method to be used, one of "yale", "ilut",
"ilutp"
. The default uses the yale sparse matrix solver; the other
use preconditioned GMRES (generalised minimum residual method)
solvers from FORTRAN package sparsekit. ilut stands for incomplete LU
factorisation with trheshold (or tolerances, droptol); the "p" iin ilutp stands for pivoting.
- control
only used if spmethod
not equal to "yale"
,
a list with the control options of the preconditioned solvers. The
default is list( droptol = 1e-3, permtol = 1e-3, fillin = 10,
lenplufac = 2)
.
droptol is the tolerance in ilut, ilutp to decide when to drop a value.
permtol is used in ilutp, to decide whether or not to permute variables.
See Saad 1994, the manual of sparskit and Saad 2003, chapter 10 for details.
- forcings
only used if dllname
is specified: a vector with the
forcing function values, or a list with the forcing function data sets,
each present as a two-columned matrix, with (time,value); interpolation
outside the interval [min(times
), max(times
)] is done by
taking the value at the closest data extreme.
This feature is here for compatibility with models defined in compiled code
from package deSolve; see deSolve's package vignette "compiledCode"
.
- initforc
if not NULL
, the name of the forcing function
initialisation function, as provided in
dllname
. It MUST be present if forcings
has been given a
value.
See deSolve's package vignette "compiledCode"
.
- fcontrol
A list of control parameters for the forcing functions.
See deSolve's package vignette "compiledCode"
.
- ...
additional arguments passed to func
allowing this to be
a generic function.