All courses › Numerical Methods › Euler's method

Euler's method

Euler's explicit method solves an ODE y′=f(t,y)y' = f(t, y) numerically by following the slope from each point a small step hh forward. It is simple but low order: the global error is O(h)O(h), so short steps are needed for good accuracy.

yn+1=yn+h f(tn,yn)y_{n+1} = y_n + h\,f(t_n, y_n)one Euler step

Symbols

hhstep size
f(tn,yn)f(t_n, y_n)the slope at (tn,yn)(t_n, y_n)

Example

y′=yy' = y, y0=2y_0 = 2, h=0.1h = 0.1: each step is multiplied by 1.11.1.

y2=2⋅1.12=2.42y_2 = 2\cdot 1.1^2 = 2.42.

Halving hh roughly halves the global error — Euler only has first-order accuracy.
Practise differential equations and stability for free →

← Splines and Gaussian quadrature · Runge–Kutta (RK4) →

Part of Numerical Methods: Differential equations and stability.