Review of Numerical Methods
Review of Numerical Methods
Numerical methods for ordinary differential equations are methods used to find
numerical approximations to the solutions of ordinary differential equations (ODEs).
Many differential equations cannot be solved using symbolic computation
("analysis"). For practical purposes, however – such as in engineering – a numeric
approximation to the solution is often sufficient. The algorithms studied here can be
used to compute such an approximation.
where f is a function that maps [t0,∞) × Rd to Rd, and the initial condition y0 ∈ Rd
is a given vector. First-order means that only the first derivative of y appears in the
equation, and higher derivatives are absent.
Euler method
From any point on a curve, you can find an approximation of a nearby point on the
curve by moving a short distance along a line tangent to the curve.
Starting with the differential equation (1), we replace the derivative y' by the finite
difference approximation
This formula is usually applied in the following way. We choose a step size h, and
we construct the sequence t0, t1 = t0 + h, t2 = t0 + 2h, … We denote by yn a
numerical estimate of the exact solution y(tn). Motivated by (3), we compute these
estimates by the following recursive scheme
by way of Heun's method, is to first calculate the intermediate yi 1 value and then
the final approximation yi 1 at the next integration point.
Runge-Kutta Method
Here yn+1 is the RK4 approximation of y(tn+1), and the next value (yn+1) is
determined by the present value (yn) plus the weighted average of four increments,
where each increment is the product of the size of the interval, h, and an estimated
slope specified by function f on the right-hand side of the differential equation.
k1 is the increment based on the slope at the beginning of the interval, using y
(Euler's method);
k2 is the increment based on the slope at the midpoint of the interval, using y
and k1;
k3 is again the increment based on the slope at the midpoint, but now using y
and k2;
k4 is the increment based on the slope at the end of the interval, using y and k3.
The RK4 method is a fourth-order method, meaning that the local truncation error
is on the order of O(h5), while the total accumulated error is on the order of O(h4).
In many practical applications the function f is independent of y (so called
autonomous system, or time-invariant system), and their increments are not
computed at all and not passed to function f, with only the final formula for tn+1
used.