Scientific Computing

This module illustrates Euler's method for numerically solving initial
value problems for ordinary differential equations. A numerical method
for an ordinary differential equation (ODE) generates an approximate
solution step-by-step in discrete increments across the interval of
integration, in effect producing a discrete sample of approximate
values of the solution function. Euler's method is the simplest
example of this approach, in which the approximate solution is advanced
at each step by extrapolating along the tangent line whose slope is
given by the ODE. Specifically, from an approximate solution value
*y*_{k} at time *t*_{k} for an
ODE *y*′ = *f*(*t*, *y*)*y*(*t*_{k+1})*t*_{k+1} = *t*_{k} +
*h*_{k}*y*_{k+1} = *y*_{k} +
*h*_{k} *f*(*t*_{k},
*y*_{k})

The user begins by selecting a differential equation from the menu
provided. A solution value *y*_{0} for the selected ODE
at an initial time *t*_{0} is marked with a black dot, and
the exact solution curve for the resulting initial value problem is
drawn in black. Starting from this initial value, the user advances
the solution through successive steps using Euler's method. Each step
of Euler's method is presented as a three-stage process. Each stage is
executed by clicking either *Next* or the currently highlighted
stage:

- Using the slider, the user can select any desired size
*h*_{k}for the step from*t*_{k}to , subject to minimum and maximum allowed values. The provisional solution value that would result from the currently selected step size is shown in red, and it varies as the step size varies. Once the user has set the slider for the desired step size, this choice takes effect by clicking*t*_{k+1}*Choose Step Size*or*Next*, at which point the solution value so determined changes color from red to black. - The current step is concluded by clicking
*Take Step*or*Next*, which prints in the table below the approximate and true solution values at the new point, and draws in gray the exact solution to the ODE passing through the new point. - Preparation for another step is initiated by clicking
*Next Step*or*Next*, which displays the new step in red, ready for selecting the new step size, with a default step size equal to the size of the previous step, if possible.

Successive steps may be continued until the the interval has been fully traversed.

**Reference:** Michael T. Heath, *Scientific Computing,
An Introductory Survey*, 2nd edition, McGraw-Hill, New York,
2002. See Section 9.3.1, especially Example 9.8 and Figures 9.4 and
9.5.

**Developers:** Evan VanderZee and Michael Heath