Example 10.  Error analysis.  The Runge-Kutta method of order N = 4 allegedly has a Final Global Error (FGE) of order  [Graphics:Images/RungeKuttaMod_gr_101.gif].  Hence, the error at the right endpoint should appear to decrease by 1/16 when the number of sub-intervals is doubled. Use the D.E. in exercise 1 and investigate this behavior for m = 15, 30, 60, 120 and 240 sub-intervals of [0,3].  
Notice. The subroutine Runge  stores the values in a list starting with subscript 1 and ending with subscript m+1. We need only check this last point with the value obtained from the analytic solution.  To explore the error we will need to execute things in the following order.
Solution 10.

[Graphics:../Images/RungeKuttaMod_gr_102.gif]
[Graphics:../Images/RungeKuttaMod_gr_103.gif] [Graphics:../Images/RungeKuttaMod_gr_104.gif]
[Graphics:../Images/RungeKuttaMod_gr_105.gif] [Graphics:../Images/RungeKuttaMod_gr_106.gif]
[Graphics:../Images/RungeKuttaMod_gr_107.gif]

The next two computations might take a while.  If you don't want to wait, don't do them.

[Graphics:../Images/RungeKuttaMod_gr_108.gif]
[Graphics:../Images/RungeKuttaMod_gr_109.gif] [Graphics:../Images/RungeKuttaMod_gr_110.gif]
[Graphics:../Images/RungeKuttaMod_gr_111.gif]

Does the error decrease in the fashion [Graphics:../Images/RungeKuttaMod_gr_112.gif]?  i.e.  [Graphics:../Images/RungeKuttaMod_gr_113.gif] should be [Graphics:../Images/RungeKuttaMod_gr_114.gif], etc.
Do the following ratios tend to 16 ?

[Graphics:../Images/RungeKuttaMod_gr_115.gif]


[Graphics:../Images/RungeKuttaMod_gr_116.gif]

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2003