Review of Numerical Methods

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

1.

1 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.

A first-order differential equation is an Initial value problem of the form,

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.

Without loss of generality to higher-order systems, we restrict ourselves to first-


order differential equations, because a higher-order ODE can be converted into a
larger system of first-order equations by introducing extra variables. For example,
the second-order equation y'' = −y can be rewritten as two first-order equations:
y' = z and z' = −y.

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

which when re-arranged yields the following formula

and using (1) gives:

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

This is the Euler method.


Heun’s method

In mathematics and computational science, Heun's method may refer to the


improved or modified Euler's method, or a similar two-stage Runge–Kutta method.
It is named after Karl Heun and is a numerical procedure for solving ordinary
differential equations (ODEs) with a given initial value. The procedure for calculating
the numerical solution to the initial value problem via the improved Euler's method
is:

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.

where h is the step size and ti 1  ti  h .

Runge-Kutta Method

Let an initial value problem be specified as follows:

Here y is an unknown function (scalar or vector) of time t, which we would like to


approximate; we are told that ẏ, the rate at which y changes, is a function of t and
of y itself. At the initial time t0 the corresponding y value is y0. The function f and
the data t0, y0 are given.
Now pick a step-size h > 0 and define

for n = 0, 1, 2, 3, ..., using

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.

1.2 Application of Numerical Methods to Solve Transients in DC Circuits

You might also like