solveODE

solveODE(func, tspan, y0)

solveODE(func, tspan, y0, options)

Try it yourself:

See also:

solveODE(): Solving Ordinary Differential Equations

solveODE() solves an ordinary differential equation numerically from a model and initial conditions. It is useful for motion, population models, circuits, and dynamic systems.

Model inputs matter

Specify the derivative rule, independent-variable interval, and initial state clearly. Numerical solutions depend on step size and tolerance; compare results at refined settings before trusting sensitive conclusions. Use derivative() for symbolic differentiation, not as a replacement for an ODE solve.

Inspect output shape with size(), summarize trajectories with mean() where appropriate, and use abs() for error magnitude checks.

All functions