]>

Numerical solutions of ordinary differential equations

What does it mean to solve a differential equation numerically? Recall that the solution of an ODE is a function, y(t). A function y(t) is fundamentally a set of points having the form (t,y(t)). When we talk about a numerical solution to an ODE, we mean a large list of (t,y) points where the y in each point is approximately equal to y(t).

To find these solutions, we start by looking at our general form of the ODE:

d y ( t ) d t = F ( t , y ( t ) ) , initial condition y ( t 0 ) = y 0 , and F ( t , y ( t ) ) MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqaaeaabiGaciaacaqabeaadaqaaqaaaOqaaiaadAeacaGGOaGaamiDaiaacYcacaWG5bGaaiikaiaadshacaGGPaGaaiykaaaa@3CFF@ is some combination of terms involving the independent variable t and the unknown function y(t).

Numerical solutions of ODE's start with what we know, the initial condition y ( t 0 ) = y 0 , and use this and the ODE itself to estimate the function at a nearby point. The ODE allows us to compute the derivative of the unknown function at the point ( t 0 , y ( t 0 ) ) because

y ' ( t 0 ) = F ( t 0 , y 0 ) MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=xfr=xb9adbeqabeWacmGabiqabeqabmaabaabaaGcbaGaamyEaiaacEcacaGGOaGaamiDamaaBaaaleaacaaIWaaabeaakiaacMcacqGH9aqpcaWGgbGaaiikaiaadshadaWgaaWcbaGaaGimaaqabaGccaGGSaGaamyEamaaBaaaleaacaaIWaaabeaakiaacMcaaaa@4290@

we use this derivative as the slope to give a direction in which to estimate the next point of the numerical solution ( t 1 , y ( t 1 ) ) . This is done over and over until an approximation to the function is known over the total domain of interest. The result of this process is pairs of points t k and y ( t k ) = y k , k=0,1,2,.... The following figure gives a graphical explanation of the idea behind the numerical solution of ODE's.

Maple Screenshot

We know t 0 and y ( t 0 ) and we know the slope of y(t), y' given as y'=F(t,y).
We don't know y(t) for any values of t other than t 0 .

We will describe how to obtain approximate solutions to ODE's using a class of methods called Runge-Kutta methods. (There are other numerical techniques for solving ODE's that we will not discuss.) We consider the equation from an initial time t 0 up to some later time t e n d . We choose a time step Δ t = t 1 t 0 , often denoted in mathematics texts as h. The solution is computed at the discrete times t k = t 0 + k h for k=0,1,2.... The approximate solution at time t k will be denoted by y k . Note that a numerical solution to a differential equation is a table of numbers, each of which gives an approximation to the true solution at each time t k . This is to be distinguished from the exact analytical solution, which is a continuous function.

The first method we will discuss is called Euler's method, named after a famous mathematician named Euler (pronounced "Oiler"). Euler's method is obtained by approximating the derivative at time t k with a simple difference. The approximating equation is

d y d t y k + 1 y k h = F ( t k , y k )

Rearranging, this can be rewritten as
y k + 1 = y k + h F ( t k , y k )

where:

y ' = F ( t , y ) is the standard form of the ODE
Δ t = h is the time step
t 0 is the initial time
t k = t 0 + k h are the discrete times at which the solution is computed for k=0, 1, 2, 3…
y k is the approximate solution at time t k

Be sure to work through the examples and exercises to see how to solve ODEs numerically in Maple.