iteration {simecol} | R Documentation |
Solver function to simulate discrete ecological (or other) dynamic
models. It is normally called indirectly from sim
.
iteration(y, times=FALSE, func=FALSE, parms=FALSE, animate = FALSE, ...)
y |
The simObj object to be iterated. |
times |
Placeholder for compatibility with the odesolve package. |
func |
Placeholder for compatibility with the odesolve package. |
parms |
Placeholder for compatibility with the odesolve package. |
animate |
Animation during the simulation (if available for the specified class. |
... |
Optional arguments passed to the plot function if
animate=TRUE . |
The solver method iteration
is used to simulate discrete event
models. It creates a local environment in a way that parameters,
inputs and equations are visible within the main function of the
simObj
.
In contrast to the ODE solvers, the main
function of the model
must not return the first derivative but instead of this
the new state at the specified times explicitly.
The actual value of time is available in the main
function as time
and the current increment as parms$DELTAT
or parms["DELTAT"]
depending on the data type of parms
.
Normally, this function is run indirectly from sim
.
A list of the model outputs (states ...) for each timestep.
sim
, parms
,
lsoda
, rk4
, euler
.
data(conway) ## plot after simulation: plot(sim(conway), delay=100) ## plot during simulation sim(conway, animate=TRUE, delay=100)