Learn R Programming

simecol (version 0.5-2)

euler: Euler Integration

Description

Solving initial value problems for systems of first-order ordinary differential equations (ODEs) using the simple Euler forward integration method. A special version is available to work with odeModel objects.

Usage

euler(y, times, func, parms, ...) 
  # euler(y)

Arguments

y
The odeModel object to be solved.
times
Placeholder for compatibility with the odesolve package.
func
Placeholder for compatibility with the odesolve package.
parms
Placeholder for compatibility with the odesolve package.
...
Reserved for further extensions.

Value

  • A data frame of the model outputs (e.g. states) for all timesteps.

Details

The solver method euler is used to simulate ODE models. It creates a local environment in a way that parameters, inputs and equations are visible within the main function of the odeModel. Normally, this function is called indirectly from sim. The Euler method is the most primitive integration method and can be regarded simply as a fixed step solution of the corresponding difference equation.

See Also

sim, parms rk4, lsoda, iteration.

Examples

Run this code
# ordinary usage
    data(lv)
    solver(lv) <- "euler"
    plot(sim(lv))

    # alternative usage
    euler(lv)

Run the code above in your browser using DataLab