Mathematical Tools for Physics

(coco) #1
11—Numerical Analysis 336

consistent with the constraint that must be kept on theα’s,


∑N


k=1

αk= 1.

One way is to pick all theαkto equal 1 /N. Another way is to pickα 1 = 1and all the others= 0, and both of
these methods are numerically stable. The book by Lanczos in the bibliography goes into these techniques, and
there are tabulations of these and other methods in Abramowitz and Stegun.


Backwards Iteration
Before leaving the subject, there is one more kind of instability that you can encounter. If you try to solve
y′′= +ywithy(0) = 1andy′(0) =− 1 , the solution ise−x. If you use any stable numerical algorithm to solve
this problem, it will soon deviate arbitrarily far from the desired one. The reason is that the general solution of
this equation isy=Aex+Be−x. Any numerical method will, through rounding errors, generate a little bit of
the undesired solution,e+x. Eventually, this must overwhelm the correct solution. No algorithm, no matter how
stable, can get around this.


There is a clever trick that sometimes works in cases like this: backwards iteration. Instead of going from
zero up, start at some large value ofxand iterate downward. In this direction it is the desired solution,e−x, that
is unstable, and thee+xis damped out. Pick an arbitrary value, sayx= 10, and assign an arbitrary value to
y(10), say 0. Next, pick an arbitrary value fory′(10), say 1. Use these as initial conditions (terminal conditions?)
and solve the differential equation moving left; necessarily the dominant term will be the unstable one,e−x, and
independent of the choice of initial conditions, it will bethesolution. At the end it is only necessary to multiply
all the terms by a scale factor to reduce the value atx= 0to the desired one; automatically, the value ofy′(0)
will be correct. What you are really doing by this method is to replace the initial value problem by a two point
boundary value problem. You require that the function approach zero for largex.


11.6 Fitting of Data


If you have a set of data in the form of independent and dependent variables{xi,yi}(i= 1,...,N), and you

Free download pdf