Next: Example
Up: First Order ODEs Numerically
Previous: Example
  Contents
Using num3plot.m
- Set up the appropriate iterating equation for Euler's method that
pertains to the ODE being considered. If instructed, solve a few
iterations of the method by hand.
- Make the necessary entries in initn.m.
ftx = '
'; (RHS of
)
eulerfcn = '
'; (Iterating equation
for Euler's method)
hvec = [
]; (Desired step sizes)
t0 =
; tf =
; x0 =
; (initial
-value,
final
-value, initial
-value, respectively)
Save and type initn (or copy-and-paste at the Emporium).
- Type num3plot This may take up to a few minutes
depending on your machine, the choice of step size(s), and/or the
difficulty of the ODE. In your Figure window, you should have three
plots.
- Upper right contains Figure 1, the Euler approximations for each
of the step sizes in hvec, plotted on top of the slope field.
- Lower right contains Figure 3, the RK4 approximations for each
of the step sizes in hvec, plotted on top of the slope field.
- Lower left contains Figure 2, a graphical representation of
errors between the Euler solutions and Runge-Kutta solutions for each
step size in hvec. t is the independent variable, and error
is plotted as the dependent variable.
- Make a visual check that your hand computations match the
appropriate plot(s) in Figure 1. Check that the solutions for each
method tend to follow the slope field as the step size gets smaller.
If all appears correct, print a copy of the display.
- In the upper left of your printout, neatly and orderly rewrite
the work you did for Euler's method in Item 1.
Subsections
Next: Example
Up: First Order ODEs Numerically
Previous: Example
  Contents
Michael Renardy
2000-05-12