R Language Solving ODEs in R

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • ode(y, times, func, parms, method, ...)

Parameters

ParameterDetails
y(named) numeric vector: the initial (state) values for the ODE system
timestime sequence for which output is wanted; the first value of times must be the initial time
funcname of the function that computes the values of the derivatives in the ODE system
parms(named) numeric vector: parameters passed to func
methodthe integrator to use, by default: lsoda

Remarks

Note that it is necessary to return the rate of change in the same ordering as the specification of the state variables. In example "The Lorenz model" this means, that in the function "Lorenz" command

return(list(c(dX, dY, dZ)))

has the same order as the definition of the state variables

yini <- c(X = 1, Y = 1, Z = 1)


Got any R Language Question?