Example 3.  Plot the error for Euler's method and the modified Euler's method.

Solution 3.

[Graphics:../Images/Euler'sMethodMod_gr_78.gif]

[Graphics:../Images/Euler'sMethodMod_gr_79.gif]

[Graphics:../Images/Euler'sMethodMod_gr_80.gif]
[Graphics:../Images/Euler'sMethodMod_gr_81.gif]


[Graphics:../Images/Euler'sMethodMod_gr_82.gif]

[Graphics:../Images/Euler'sMethodMod_gr_83.gif]

[Graphics:../Images/Euler'sMethodMod_gr_84.gif]
[Graphics:../Images/Euler'sMethodMod_gr_85.gif]

Just for fun, compare the error for the Euler and modified Euler solutions.

[Graphics:../Images/Euler'sMethodMod_gr_86.gif]

[Graphics:../Images/Euler'sMethodMod_gr_87.gif]

[Graphics:../Images/Euler'sMethodMod_gr_88.gif]

Since we have the analytic or "true solution" at hand, we can run experiments to verify that Euler's method has order  [Graphics:../Images/Euler'sMethodMod_gr_89.gif],  and   the Modified Euler's method has order  [Graphics:../Images/Euler'sMethodMod_gr_90.gif].   Reduce the step size by  [Graphics:../Images/Euler'sMethodMod_gr_91.gif] and see what happens to the error.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004