next up previous
Next: About this document ... Up: Flowlines, Vector Fields, Numerical Previous: Div and Curl

Numerical Integration

The computations behind pictures like these are obtained by numerical integration. Basically, to advance from $\vec{r}(t)$ to $\vec{r}(t+\Delta t)$, one constructs some approximation to the ``average'' of the vector field for a short time, and uses that vector field to as a velocity for that short time interval.

Section 15.1 of Stewart discusses the details of one method of numerical inegration, Euler's Method. The program Numerical Methods in the folder MacMath 9.2 lets you explore this method as well as two more refined ones.

All these methods have two kinds of errors associated. For step sizes $\Delta t$ small but not too small, each method has a characteristic order p so that the error (by some fixed time) in computed solutions is typically $C(\Delta t)^{p}$ for some constant C. This part is called truncation error. However for step sizes too small, roundoff error causes further reduction of step size to cause a random walk, or worse, and consequently no improvement in accuracy. By adjusting the number of bits used for numerical computation in the program Numerical Methods you can control at which stepsize truncation error predominates, and when roundoff does.

For the equation y'=x with y(0)=1, here are some explicit suggestions to look at how the dependence of the error at t=1 depends on choices of method, stepsize, and rounding technique.

Euler Method 64 Bit:
Try step sizes of ${\displaystyle \frac{1}{32}}$, ${\displaystyle \frac{1}{128}}$, and ${\displaystyle \frac{1}{1024}}$. Can you see a truncation error approximately proportional to $\Delta t$?
Midpoint Euler Method 64 Bit:
Try step sizes of ${\displaystyle \frac{1}{16}}$ and ${\displaystyle \frac{1}{1024}}$. Can you see a truncation error approximately proportional to $(\Delta t)^2$?
Midpoint Euler Method 16 Bit Trunc round:
Try step sizes of ${\displaystyle \frac{1}{256}}$, ${\displaystyle
\frac{1}{512}}$, and ${\displaystyle \frac{1}{1024}}$. Can you see a roundoff error approximately proportional to ${\displaystyle \frac{1}{\sqrt{\Delta t}}}$?
Midpoint Euler Method 16 Bit Trunc down:
Try step sizes of ${\displaystyle \frac{1}{256}}$, ${\displaystyle
\frac{1}{512}}$, and ${\displaystyle \frac{1}{1024}}$. Can you see a roundoff error approximately proportional to ${\displaystyle \frac{1}{\Delta t}}$?


next up previous
Next: About this document ... Up: Flowlines, Vector Fields, Numerical Previous: Div and Curl
root
2002-08-23