All courses › Numerical Methods › System of first-order equations

System of first-order equations

Most numerical solvers are built for systems of first-order equations, so a higher-order ODE is rewritten by introducing new variables for the derivatives. A second-order equation y′′=f(t,y,y′)y'' = f(t, y, y') then becomes two coupled first-order equations.

y1=y, y2=y′y_1 = y,\ y_2 = y'new variables
y1′=y2,y2′=f(t,y1,y2)y_1' = y_2,\quad y_2' = f(t, y_1, y_2)the first-order system

Symbols

y1,y2y_1, y_2position and velocity as separate unknowns

Example

y′′+3y′+2y=0y'' + 3y' + 2y = 0 becomes y1′=y2y_1' = y_2 and y2′=−3y2−2y1y_2' = -3y_2 - 2y_1, solved with e.g. RK4 on the vector (y1,y2)(y_1, y_2).

This rewriting is the key to applying Euler or Runge–Kutta to higher-order equations.
Practise differential equations and stability for free →

← Stiffness and stability

Part of Numerical Methods: Differential equations and stability.