2. 2
When dealing with an nth-order differential
equation, n conditions are required to obtain a
unique solution.
If all conditions are specified at the same value of
the independent variable (for example, at x or t = 0),
then the problem is called an initial-value problem.
This is in contrast to boundary-value problems
where specification of conditions occurs at different
values of the independent variable.
3. 3
The Unified Form of Solving ODE
( )dxyx,fdy =
( )hh,y,xyy iii1i φ+=+
Depending on function φφφφ, there are different solutions.
The Runge-Kutta methods are the most popular.
00ii xxatyconditioninitialandxxh =−= +1
( )yx,f
dx
dy
=
4. 4
The Euler’s Method
( )ii
xx
y,xf
dx
dy
i
==
=
φ
Error estimate:
( )
n
n
n
i2i
iii Rh
n!
y
h
2!
y
hyyy +++
′′
+′+=+ L1
( ) ( ) ( ) ( )( )
n
nii
1-n
3ii2ii
iiii Rh
n!
y,xf
h
3!
y,xf
h
2!
y,xf
hy,xfyy ++
′′
+
′
++=+ L1
Et = Et,2 + Et,3 + … + Et,n
Differential equation
evaluated at xi and yi
14. 14
General Idea of Runge-Kutta Methods
Given the order n, the coefficients ai, pi, and qij are determined by equaling
terms to the Taylor series.
( )hh,y,xyy iiii φ+=+1
22. 22
Comparison of Various 2nd-order RK Methods
Integrate f(x,y) = -2x3 + 12x2 – 20x + 8.5
from x = 0 to x = 4 using a step size of 0.5, with initial condition y = 1 at x = 0.
32. 32
Comparison of RK Methods of Different Orders
Integrate f(x,y) = 4e0.8x – 0.5y
with y(0) = 2 from x = a = 0 to x = b = 4 using various step sizes. Compare the accuracy of the
various methods for the result at x = 4 based on the exact answer of y(4) = 75.33896
h
ab
nEffort f
−
=
nf is the number of function evaluations
involved in the particular RK computation.
Example: when n = 4, we need to calculate
k1 through k4, hence 4 evaluations of f(x,y);
so nf = 4.
Inspection of the figure leads to a number of
conclusions: first, that the higher-order methods
attain better accuracy for the same computational
effort and, second, that the gain in accuracy for
the additional effort tends to diminish after a
point. (Notice that the curves drop rapidly at first
and then tend to level off.)
35. 35
4th-order RK Method for System of ODEs
12
2
1
1
104 y0.3y
dx
dy
0.5y
dx
dy
.−−=
−=
Initial conditions: y1(0) = 4, y2(0) = 6
Integrate from x = 0 to x= 2 with 0.5 step size