Solve an ODE numerically using Euler's forward method with step size control.
Euler's method is the simplest ODE solver: y_{n+1} = y_n + h·f(x_n, y_n). It advances the solution by one step of size h using the slope at the current point. The method has O(h) global error (first-order), meaning you need many small steps for accuracy. It's excellent for teaching but RK4 is preferred in practice.
Euler step
y(n+1) = y(n) + h · f(x(n), y(n))
Euler uses only the slope at the start of each step (first-order). RK4 samples the slope at four points per step, achieving O(h⁴) accuracy vs O(h) for Euler.
For quick estimates, stiff equation detection, or when implementing in hardware with limited computation. It's also used as a building block in more complex adaptive schemes.