Numerical Methods & Scientific Computing

ODE Solver

Solve a first-order ordinary differential equation y′ = f(x,y) from an initial condition using a selectable numerical integrator. Compare explicit, adaptive and implicit methods, overlay an optional exact solution, inspect the step table and download the computed trajectory.

Numerical ODE workbench

Classical RK4

4th order. Solve first-order initial-value problems of the form y′ = f(x,y).

Expression syntax: use explicit multiplication such as 2*y. Supported functions include sin, cos, tan, exp, ln, sqrt and abs.

How this tool works

The solver advances y(x) from (x₀,y₀) with the selected time-stepping formula. Fixed-step methods use the entered h; adaptive RK45 uses an embedded Dormand–Prince 5(4) pair to estimate local error and adjust h automatically.

Example

For y′ = −2y with y(0)=1, integrate to x=3 and enter exp(−2x) as the exact solution. Try Euler, RK4 and GL4 with the same step size to see how the global error changes.

Common questions

What equations can this ODE solver handle?

It handles scalar first-order initial-value problems of the form y′ = f(x,y). Use explicit multiplication such as 2*y and functions such as sin, cos, exp, ln, sqrt and abs.

Which method should I choose?

RK4 is a strong general fixed-step method, RK45 is useful when you want automatic error control, and implicit Euler or GL4 can behave better on problems where explicit methods require very small steps.

Does this replace a production scientific solver?

No. It is an educational and engineering-analysis utility. Large systems, events, discontinuities, DAEs and highly stiff problems may require specialized numerical libraries.