Example 3. Plot the
error for Euler's method and the modified Euler's method.
Solution 3.
![[Graphics:../Images/Euler'sMethodMod_gr_79.gif]](../Images/Euler'sMethodMod_gr_79.gif)
![[Graphics:../Images/Euler'sMethodMod_gr_83.gif]](../Images/Euler'sMethodMod_gr_83.gif)
Just for fun, compare the error for the Euler and modified Euler solutions.
![[Graphics:../Images/Euler'sMethodMod_gr_87.gif]](../Images/Euler'sMethodMod_gr_87.gif)
Since we have the analytic or "true solution" at hand, we can run
experiments to verify that Euler's method has
order
, and the
Modified Euler's method has order
. Reduce
the step size by
and see what happens to the error.
(c) John H. Mathews 2004