Example 7.  Plot the absolute value of the error for Euler's method and the modified Euler's method.

Solution 7.

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

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

[Graphics:../Images/Euler'sMethodMod_gr_150.gif]
[Graphics:../Images/Euler'sMethodMod_gr_151.gif]


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

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

[Graphics:../Images/Euler'sMethodMod_gr_154.gif]
[Graphics:../Images/Euler'sMethodMod_gr_155.gif]

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

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

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

[Graphics:../Images/Euler'sMethodMod_gr_158.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_159.gif],  and   the Modified Euler's method has order  [Graphics:../Images/Euler'sMethodMod_gr_160.gif].   Reduce the step size by  [Graphics:../Images/Euler'sMethodMod_gr_161.gif] and see what happens to the error.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004