Local (and Global) Truncation = error made in one step when we replace an infinite process by a finite one (independent of round off error). (Global is sum over all steps). The Local Round off = error made by computing with limited precision on one step. (Global is cummulative round-off error). Total Error = sum of roundoff and truncation error. The sources of roundoff error are no different than those considered in the previous semester. The new ones, which we will devote our attention, is the truncation error. We'll mostly ignore rounding errors for now.
Example Suppose we use forward Euler to approximate the solution of
and compare
to true solution
as follows: make a
table (assume for
simplicity that stepsize is constant and of size
). The table
contains
for different values of
.
The table and its analysis constitute a ``convergence analysis.'' Most
likely, we don't have
, the exact answer. Suppose we do.
| ``error''
|
||||
|
|
||||
| approx | true | |||
| approx | true | |||
| approx | true | |||
| etc. |
What you see:
Take
, corresponding to
being halved, and the
absolute difference
at some
. For Euler, we'll see that the
error will drop by
if we have. Since error
drops proportional to
, we say the method's local truncation error
is of order
.
Another way we can convey the global error is by making a plot of
as a function of
. The convention is to plot
on the vertical
axis and
on the horizontal axis, with
DECREASING along the
right. Furthermore, the plot should be a log-log plot. One picks a
location
, sufficiently far from
(this is determined largely
on common sense). The discretization is picked so that for any
is a value taken by
for any given
. At this location the error
is recorded as a function of
for the same initial data. The
plot will show how this global error behaves as
is
changed. Moreover, as we will see later on, the slope of the log plot
will indicate the ``convergence rate'' of the method, if the method
converges. More on this later.
Exercise. In some rare instances one can actually solve the resulting difference equation analytically. For example, we wish to solve
The forward Euler approximation to (11) is
,
with
.
Solution of difference equation: (see difference equations from previous semester, or use induction)
Global error for each fixed value
is
proportional to
There's more to the error analysis, of course. As always, the goal of scientific computing and numerical work is not to compute exactly, but to know exactly what errors are made. We need to learn a number of very useful theorems, which we can be used to tell whether we can have confidence in the answer obtained in a computation (remember as well that computers ALWAYS give answers), and can be extended to design numerical solutions to your practical problems. These theorems, together with detailed and careful work on the assignments will go a long way to teach you the basics of numerical analysis and scientific computing.