Professional Documents
Culture Documents
com
Curve Fitting
Numerical Differentiation
Numerical Integration
Numerical Optimization
http://www.amaderforum.com
http://www.amaderforum.com
Complex Numbers
Complex Functions
http://www.amaderforum.com
http://www.amaderforum.com
Often a function
is approximated by a function
and the error
bound is known to be
.This leads to the following definition.
Definition 3.Assume that
is approximated by the function
and
that there exist a real constant
and a positive integer n so that
for sufficiently small h.
We say thatapproximateswith order of approximationandwrite
.
When this relation is rewritten in the form
that the notation
stands in place of the error bound
http://www.amaderforum.com
,we see
.The
http://www.amaderforum.com
following results show how to apply the definition to simple
combinations of two functions.
and
,and
(i)
(ii)
(iii)
.Then
,
,
provided that
It is instructive to consider
to be the
degree Taylor polynomial
approximation of
;then the remainder term is simply designated
,which stands for the presence of omitted terms starting with
the power
.The remainder term converges to zero with the same
rapidity that
converges to zero as h approaches zero, as expressed
in the relationship
,and
,
is the n-th degree Taylor polynomial expansion of
polynomial of degree nis
and
http://www.amaderforum.com
about
.The Taylor
are all
then
http://www.amaderforum.com
.
The integral form of the remainder is
,
and Lagrange's formula for the remainder is
,
where
where
,
.
and
is a sequence with
http://www.amaderforum.com
Example.Let
convergence
and
.
http://www.amaderforum.com
;then
with a rate of
http://www.amaderforum.com
Solution.
This follows immediately from the relation
for all n.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
.This
without a
http://www.amaderforum.com
.
You need not worry about the computational details, but the coefficients are
and
Exploration.
and substitute
,
which simplifies to
http://www.amaderforum.com
http://www.amaderforum.com
Exploration.
If Cardano could get any value of x that solved a depressed cubic, he could easily get a
corresponding solution to
from the identity
. Happily,
Cardano knew how to solve a depressed cubic. The technique had been communicated to
him by Niccolo Fontana who, unfortunately, came to be known as Tartaglia(the
stammerer) due to a speaking disorder. The procedure was also independently discovered
some 30 years earlier by Scipione del Ferro of Bologna. Ferro and Tartaglia showed that
one of the solutions to the depressed cubic equation is
.
Although Cardano would not have reasoned in the following way, today we can take this
value for x and use it to factor the depressed cubic into a linear and quadratic term. The
remaining roots can then be found with the quadratic formula.
For example, to solve
se the substitution
to get
apply the "Ferro-Tartaglia" formula with
,u
,which is a depressed cubic equation.Next,
and
to get
.S
ince
is a root,
must be a factor of
.Dividing
into
gives
,which yields the remaining (duplicate) roots of
.The solutions to
are obtained by recalling
, which yields the three roots
and
.
http://www.amaderforum.com
http://www.amaderforum.com
Exploration.
, or in a
http://www.amaderforum.com
somewhat different form,
.
Simplifying this expression would have been very difficult if Bombelli
had not come up with what he called a "wild thought."He suspected
that if the original depressed cubic had real solutions, then the two
parts of x in the preceding equation could be written as
and
for some real numbers u and v.That is, Bombeli believed
and
and
.Then, using the wellknown algebraic identity
, and (letting
and
),and assuming that roots of negative numbers obey the rules
of algebra, he obtained
.
By equating like parts, Bombelli reasoned that
and
.Perhaps thinking even more wildly, Bombelli then
supposed that u and v were integers.The only integer factors of 2 are
2 and 1, so the equation
led Bombelli to conclude that
and
.From this conclusion it follows that
, or
.
Amazingly,
and
solve the second equation
, so
Bombelli declared the values for u and v to be u=2 and v=1,
respectively.
Since
, we clearly have
.Similarly,
http://www.amaderforum.com
very real solution, mathematicians had to take a detour through the
uncharted territory of "imaginary numbers."Thus, whatever else might
have been said about these numbers (which, today, we call complex
numbers), their utility could no longer be ignored.
Exploration.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
The points P and P represent the solutions to our equation, which is
clearly correct if
.But how should we picture P and P when
negative roots arise (i.e., when
)?Wallis reasoned that, with
negative roots, b would be less than c, so the lines of length b in
Figure 1.1 would no longer be able to reach all the way to the x
axis.Instead, they would stop somewhere above it, as Figure 1.2
shows.Wallis argued that P and P should represent the geometric
locations of the solutions
and
when
.He evidently thought that, because b is shorter than c, it could no
longer be the hypotenuse of the right triangle as it had been earlier.
The side of length c would now have to take that role.
http://www.amaderforum.com
Two additional mathematicians deserve mention. The Frenchman
Augustin-Louis Cauchy (1789--1857) formulated many of the classic
theorems that are now part of the corpus of complex analysis.The
German Carl Friedrich Gauss (1777--1855) reinforced the utility of
complex numbers by using them in his several proofs of the
fundamental theorem of algebra (see Chapter 6).In an 1831 paper, he
produced a clear geometric representation of x+iy by identifying it
with the point (x, y) in the coordinate plane. He also described how to
perform arithmetic operations with these new numbers.
It would be a mistake, however, to conclude that in 1831 complex
numbers were transformed into legitimacy. In that same year the
prolific logician Augustus De Morgan commented in his book, On the
Study and Difficulties of Mathematics, "We have shown the symbol
to be void of meaning, or rather self-contradictory and absurd.
Nevertheless, by means of such symbols, a part of algebra is
established which is of great utility."
There are, indeed, genuine logical problems associated with complex
numbers. For example, with real numbers
so long as both
sides of the equation are defined. Applying this identity to complex
numbers leads to 1=1=((-1)(-1))=(-1)(-1)=-1.Plausible
answers to these problems can be given, however, and you will learn
how to resolve this apparent contradiction in Section 2.4. De Morgan's
remark illustrates that many factors are needed to persuade
mathematicians to adopt new theories. In this case, as always, a firm
logical foundation was crucial, but so, too, was a willingness to modify
some ideas concerning certain well-established properties of numbers.
As time passed, mathematicians gradually refined their thinking, and
by the end of the nineteenth century complex numbers were firmly
entrenched. Thus, as it is with many new mathematical or scientific
innovations, the theory of complex numbers evolved by way of a very
intricate process. But what is the theory that Tartaglia, Ferro, Cardano,
Bombelli, Wallis, Euler, Cauchy, Gauss, and so many others helped
produce? That is, how do we now think of complex numbers? We
explore this question in the remainder of this chapter.
http://www.amaderforum.com
http://www.amaderforum.com
Complex Functions
Overview
The last chapter developed a basic theory of complex numbers. For the next few chapters
we turn our attention to functions of complex numbers. They are defined in a similar way
to functions of real numbers that you studied in calculus; the only difference is that they
operate on complex numbers rather than real numbers. This chapter focuses primarily on
very basic functions, their representations, and properties associated with functions such
as limits and continuity. You will learn some interesting applications as well as some
exciting new ideas.
http://www.amaderforum.com
http://www.amaderforum.com
Just as z can be expressed by its real and imaginary parts,
,we write
,where u and v are the real and
imaginary parts of w, respectively.Doing so gives us the
representation
.
Because u and v depend on x and y, they can be considered to
be real-valued functions of the real variables x and y; that
is,
and
http://www.amaderforum.com
http://www.amaderforum.com
Example 2.1.Write
in the for
so that
in the
so that
Examples 2.1 and 2.2 show how to find u(x,y) and v(x,y) when
a rule for computing f is given. Conversely, if u(x,y) and
v(x,y) are two real-valued functions of the real
variables x and y, they determine a complex-valued function
,and we can use the formulas
and
to find a formula for f involving the variables z and
http://www.amaderforum.com
http://www.amaderforum.com
Example 2.3.Express
variables
.
Using
in the expression of a complex function f may be
convenient.It gives us the polar representation
,
where U and V are real functions of the real variables r and
.
Remark.For a given function f, the functions u and v defined
above are different from those used previously in
which used Cartesian coordinates
instead of polar coordinates.
Example 2.4.Express
so that
For the polar form, we get v
http://www.amaderforum.com
http://www.amaderforum.com
so that
Example 2.5.Express
in polar form.
Solution. We obtain
so that
http://www.amaderforum.com
http://www.amaderforum.com
We now look at the geometric interpretation of a complex
function.If D is the domain of real-valued functions u(x,y)
and v(x,y), the equations
and
describe a transformation (or mapping) from D in the xy
plane into the uv plane, also called the w plane. Therefore,
we can also consider the function
http://www.amaderforum.com
http://www.amaderforum.com
Figure 2.2
maps A onto B;
maps A into R.
http://www.amaderforum.com
http://www.amaderforum.com
one-to-one function: distinct points get mapped to distinct
points.
Conversely, if
and
are functions that map A into
B and B into A, respectively, and the above hold, then f
maps the set A one-to-one and onto the set B.
Further, if f is a one-to-one mapping from D onto T and if A
is a subset of D, then f is a one-to-one mapping from A onto
its image B.We can also show that, if
is a one-to-one
http://www.amaderforum.com
http://www.amaderforum.com
mapping from A onto B and
is a one-to-one mapping from
B onto S, then the composite mapping
is a one-to-one
mapping from A onto S.
We usually indicate the inverse of by the symbol
.If the
domains of and
are A and B respectively, then we write
for all
,and
for all
Also, for
iff
iff
and
.
,and
.
where
in
is the notation for "if and only if."Note what this result says:
. The image of A under f, therefore, is the set
.
http://www.amaderforum.com
We now look at some elementary mappings.If we let
fixed complex constant, the transformation
denote a
and shows thatTis a one-to-one mapping from the z-plane onto the wplane. The effect of a translation is depicted in Figure 2.5.
,the transformation
http://www.amaderforum.com
http://www.amaderforum.com
This analysis shows thatRis a one-to-one mapping from the z-plane
onto the w-plane.The effect of rotation is depicted in Figure 2.6.
for
http://www.amaderforum.com
http://www.amaderforum.com
If we let
and shows thatSis a one-to-one mapping from the z-plane onto the wplane.The effect of magnification is shown in Figure 2.8.
http://www.amaderforum.com
http://www.amaderforum.com
Figure 2.8The magnification
Finally, if we let
and
then the transformation
.
, where
.To describe
for z to get
Thus
maps
.
,we solve
in Cartesian form as
,
and
,or
is a rotation of the
(when z is multiplied by
) followed by a
http://www.amaderforum.com
translation by the vector
.The first operation yields the set
.The second shifts this set up 1 unit, resulting in the set
illustrate this result in Figure 2.9.
.We
http://www.amaderforum.com
.
,so if we designate
http://www.amaderforum.com
http://www.amaderforum.com
,which simplifies
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
The Solution of Nonlinear Equations f(x) = 0
Fixed Point Iteration
Bisection Method
Newton-Raphson Method
Secant Method
Muller's Method
Halley's Method
Horner's Method
Lin-Bairstow Method
Brent's Method
Graeffe's Method
Nonlinear Systems
Broyden's Method
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
is a number
,it is a
http://www.amaderforum.com
for
,then
is a fixed point of
http://www.amaderforum.com
http://www.amaderforum.com
Theorem (Second Fixed Point Theorem). Assume that the
following hypothesis hold true.
(a) is a fixed point of a function ,
(b)
,
(c) is a positive constant,
(d)
, and
(e)
for all
.
Then we have the following conclusions.
(i).If
for all
,then the iteration
will
converge to the
unique fixed point
.In this case, is said to be an attractive
fixed point.
(ii).If
for all
,then the iteration
will not
converge to .
In this case, is said to be a repelling fixed point and the iteration
exhibits local divergence.
in statement (ii).
, it is
http://www.amaderforum.com
http://www.amaderforum.com
Algorithm (Fixed Point Iteration).To find a solution to the equation
by starting with and iterating
.
Mathematica Subroutine (Fixed Point Iteration).
Example.Use fixed point iteration to find the fixed point(s) for the
function
http://www.amaderforum.com
http://www.amaderforum.com
Solution.
Plot the function and determine graphically that there are two
solutions to the equation
.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Comparison 2. Compare with Mathematica's built in "Solve"
subroutine for symbolically finding solutions.
http://www.amaderforum.com
http://www.amaderforum.com
Now use the FixedPointIteration subroutine to perform the
computations.
in the neighborhood,
.
http://www.amaderforum.com
http://www.amaderforum.com
in the neighborhood,
.
http://www.amaderforum.com
,
converges to the zero
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
There appears to be only one real root which lies in the interval [1,2].
http://www.amaderforum.com
http://www.amaderforum.com
The root lies somewhere in the interval [a,b] the width of which is
Is this the desired accuracy you want ?If not, more iterations are
required.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Remember. The bisection method can only be used to find a real root
in an interval [a,b] in which f[x] changes sign.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
represents the sequence of points generated by the Regula Falsi process, then the
sequence
converges to the zero
.
That is,
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
There appears to be only one real root which lies in the interval [1,2].
http://www.amaderforum.com
Is this the desired accuracy you want ?If not, more iterations are
required.
k
http://www.amaderforum.com
http://www.amaderforum.com
Remember. The Regula Falsi method can only be used to find a real root in an
interval [a,b] in which f[x] changes sign.
http://www.amaderforum.com
http://www.amaderforum.com
Now test the example to see if it still works. Use the last case in
Example 1 given above and compare with the previous results.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Newton&'s Method
If
are continuous near a root , then this extra
information regarding the nature of
can be used to develop
algorithms that will produce sequences
that converge faster to
than either the bisection or false position method. The NewtonRaphson (or simply Newton's) method is one of the most useful and
best known algorithms that relies on the continuity of
.The method is attributed to Sir Isaac Newton (1643-1727) and Joseph
Raphson (1648-1715).
Theorem ( Newton-Raphson Theorem ).Assume that
and
there exists a number
, where
.If
, then there
exists a
such that the sequence
defined by the iteration
for
will converge to
http://www.amaderforum.com
http://www.amaderforum.com
Example.Use Newton's method to find the three roots of the cubic polynomial
.
Determine the Newton-Raphson iteration formula
details of the computations for the starting value
Solution.
http://www.amaderforum.com
that is used.Show
.
http://www.amaderforum.com
Starting with
, Use the Newton-Raphson method to find a
numerical approximation to the root.First, do the iteration one step at
a time.Type each of the following commands in a separate cell and
execute them one at a time.
http://www.amaderforum.com
http://www.amaderforum.com
From the second graph we see that there are two other real roots, use
the starting values0.0and1.4to find them.
First, use the starting value
.
http://www.amaderforum.com
, the convergence of
, the convergence of
is called linear.
is called quadratic.
that
http://www.amaderforum.com
rksufficiently large.
Ifpis a multiple root of orderm,then convergence is linear and
forksufficiently large.
a
nd
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Various Scenarios
http://www.amaderforum.com
http://www.amaderforum.com
for
will converge to
for
http://www.amaderforum.com
.
given two initial
http://www.amaderforum.com
Mathematica Subroutine (Secant Method).
Example.Use the secant method to find the three roots of the cubic
polynomial
.
Determine the secant iteration formula
that is used.
Show details of the computations for the starting value
Solution.
Enter the function.
http://www.amaderforum.com
is
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
From the second graph we see that there are two other real roots.
Use the starting values
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Let's see how good they are.
http://www.amaderforum.com
http://www.amaderforum.com
These answers are in agreement with the ones we found with the
secant method.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Various Scenarios and Animations for the Secant Method.
http://www.amaderforum.com
http://www.amaderforum.com
Muller's Method
Background
Muller's method is a generalization of the secant method, in the
sense that it does not require the derivative of the function. It
is an iterative method that requires three starting points
,
, and
.A parabola is constructed that
passes through the three points; then the quadratic formula is
used to find a root of the quadratic for the next
approximation.It has been proved that near a simple root
Muller's method converges faster than the secant method and
almost as fast as Newton's method.The method can be used to
find real or complex zeros of a function and can be
programmed to use complex arithmetic.
Mathematica Subroutine (Newton-Raphson Iteration).
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Example.Use Newton's method and Muller's method to find numerical
approximations to the multiple root
of the function
.
Show details of the computations for the starting value
.Compare the number
of iterations for the two methods.
Solution.
Starting with
, use the Newton-Raphson method to find a
numerical approximation to the root.
http://www.amaderforum.com
http://www.amaderforum.com
Starting with
,
, and
numerical approximation to the root.
http://www.amaderforum.com
from the
http://www.amaderforum.com
For Muller's method, how far away is the eighth iteration from the root
?
Note. The last iteration is actually stored in .
We are done.
Aside.Compare with Mathematica's built in routine.
http://www.amaderforum.com
http://www.amaderforum.com
Mathematica's answer is not so good, need to adjust the number of
iterations and the working precision.
http://www.amaderforum.com
http://www.amaderforum.com
Aitken's
Process and Steffensen's Acceleration Method
Background for Aitken's Process
We have seen that Newtons method converges slowly at a multiple
root and the sequence of iterates
exhibits linear convergence.A
technique called Aitken's process can be used to speed up
convergence of any sequence that is linearly convergent.In order to
proceed, we will need a definition.
Definition (Forward Difference).Given the sequence
the forward difference
by
for
Higher powers
for
,define
defined by
http://www.amaderforum.com
Steffensen's Acceleration
When Aitken's process is combined with the fixed point iteration in
Newtons method, the result is called Steffensen's acceleration.Starting
with , two steps of Newton's method are used to compute
and
compute
previous steps.
,then Aitken's
process is used to
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Graph the function.
Starting with
, use the Newton-Raphson method to find a
numerical approximation to the root.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
The sequence
converges top.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
, the convergence of
, the convergence of
http://www.amaderforum.com
is called linear.
is called quadratic.
http://www.amaderforum.com
Theorem (Convergence Rate for Newton-Raphson
Iteration)Assume that Newton-Raphson iteration produces a
sequence
that converges to the rootpof the function
.
Ifpis a simple root, then convergence is quadratic and
forksufficiently large.
Ifpis a multiple root of orderm,then convergence is linear and
forksufficiently large.
Algorithm (Newton-Raphson Iteration).To find a root of
given an initial approximation using the iteration
for
http://www.amaderforum.com
Solution.
http://www.amaderforum.com
http://www.amaderforum.com
,the accelerated
http://www.amaderforum.com
,using the
Notice that convergence is much faster than the standard NewtonRaphson iteration.
http://www.amaderforum.com
http://www.amaderforum.com
More Background
Iff(x)has a root of multiplicitymatx=p, thenf(x)can be exssed in the
form
where
http://www.amaderforum.com
Raphson formula
http://www.amaderforum.com
http://www.amaderforum.com
MATHEMATICAL EXPOSITION
An Improved Newton's Method
by
John H. Mathews
The AMATYC Review, Vol. 10, No. 2, Spring, 1989, pp. 9-14.
Introduction
Newton's method is used to locate roots of the equation
Newton-Raphson iteration formula is:
.The
(1)
Given a starting value
,the sequence
(2)
provided that
is computed using:
for
.
If the value is chosen close enough to the root p, then the sequence
generated in (2) will converge to the root p.Sometimes the speed at
which
converges is fast (quadratic) and at other times it is slow
(linear).To distinguish these two cases we make the following
definitions.
http://www.amaderforum.com
http://www.amaderforum.com
Definition 1 (Order of Convergence)Assume that
top,and set
.If two positive constants
and
converges
exist,
, and
is called quadratic.
, and
is called linear.
can be factored as
and
is continuous at
of ordermat
.
and
has a root
A root of order
is often called a simple root, and if
it is called a
multiple root.A root of order
is sometimes called a double root, and
so on.
Theorem 1 (Convergence Rate for Newton-Raphson
Iteration)Assume that Newton-Raphson iteration (2) produces a
sequence
that converges to the rootpof the function
.
(6)Ifpis a simple root, then convergence is quadratic and
forksufficiently large.
(7)Ifpis a multiple root of orderm,then convergence is linear and
http://www.amaderforum.com
http://www.amaderforum.com
forksufficiently large.
There are two common ways to use Theorem 1 and gain quadratic
convergence at multiple roots. We shall call these methods A and B
(see Mathews, 1987, p. 72 and Ralston & Rabinowitz, 1978, pp. 353356).
Method A.Accelerated Newton-Raphson
Suppose thatpis a root of order
Raphson formula is:
(8)
(9)
for
http://www.amaderforum.com
http://www.amaderforum.com
On the other hand, if
function
Using
(10)
Let the starting value
iteratively;
(11)
for
Then the sequence generated by (11) converges quadratically top.
Mathematica Subroutine (Modified Newton-Raphson Iteration).
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Again, the laborious task of finding the formula for
could detract
from using Method B.Furthermore, Ralston and Rabinowitz (1978, pp.
353-356) have observed that
will have poles at points where the
zeros of
are not roots of
.Hence,
may not be a continuous
function.
The New Method C.Adaptive Newton-Raphson
The adaptive Newton-Raphson method incorporates a linear search
method with formula (8).Starting with ,the following values are
computed:
(13)
for
.
(16)
,
where
http://www.amaderforum.com
http://www.amaderforum.com
The iterates
(17)
for
Since
,the iterates get closer topasjgoes from
manifest by the inequalities:
(19)
The values
,which is
.
are shown in Figure 1.
http://www.amaderforum.com
http://www.amaderforum.com
(21)
.
Therefore, the way to computationally determinemis to successively
compute the values using formula (13) for
until we
arrive at
.
The New Adaptive Newton-Raphson Algorithm
Start with
http://www.amaderforum.com
as follows:
http://www.amaderforum.com
Observe that the above iteration involves a linear search in either the
interval
when
or in the interval
when
.In the
algorithm, the value
is stored so that unnecessary
computations are avoided.After the point
has been found, it
should replace
and the process is repeated.
Mathematica Subroutine (Adaptive Newton-Raphson Iteration).
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Solution.
First, we will compute the iterations for each method, and afterward a
table comparing the methods is given.For the method C, all the
iterations in the linear search are included.
Using formula (2), the standard Newton-Raphson method.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Using formula (13) Method C, the adaptive Newton-Raphson method.
The details for obtaining
are:
Since
we reject and set
and continue the iteration using formula
(13).The subroutine makes all these choices automatically.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
reader can use formulas (12) to verify that
is the order of the root
.The new method C is almost as fast as methods A and B.
The goal of this investigation is to show how the adaptive NewtonRaphson method is superior to the standard Newton-Raphson method,
because of the limitations of Methods A and B.
Why is it difficult to locate a multiple root.Because the function values themselves are
essentially "noise" when you get close to a multiple root.
http://www.amaderforum.com
http://www.amaderforum.com
The formula
should be considered the "true value."
So one should be suspect of the computation
for values
ofxis nearx=1.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Halley's Method
Background
Definition (Order of a Root)Assume thatf(x)and its derivatives
are defined and continuous on an interval about
.We say that
has a root of ordermat
if and only if
.
A root of order
is often called a simple root, and if
it is called a
multiple root.A root of order
.is sometimes called a double root,
and so on.The next result will illuminate these concepts.
Definition (Order of Convergence)Assume that converges
top,and set
.If two positive constants
exist,
and
, the convergence of
is called linear.
(ii)If
, the convergence of
is called quadratic.
(ii)If
, the convergence of
is called cubic.
http://www.amaderforum.com
http://www.amaderforum.com
Furthermore, if
convergence
,i.e.
Furthermore, if
convergence
,i.e.
http://www.amaderforum.com
http://www.amaderforum.com
Square Roots
The function
where
can be used with (1) and (2) to
produce iteration formulas for finding
.If it is used in (1), the result
is the familiar Newton-Raphson formula for finding square roots:
(3)
(4)or
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Verify the convergence rate.At the simple root
Solution 1 (b).
Now we will investigate Halley's iteration for finding square roots.
http://www.amaderforum.com
http://www.amaderforum.com
Form the Halley iteration functionh(x).
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
proceeding cubically.
We can conclude that Halley's method is faster than Newton's method.
Verify the convergence rate.At the simple root
.
http://www.amaderforum.com
http://www.amaderforum.com
Horner's Method
Evaluation of a Polynomial
Let the polynomial
form
.Then
,
for
Then
can be
and
where
is the quotient polynomial of degreen-1and
remainder.
http://www.amaderforum.com
is the
http://www.amaderforum.com
Example.Use synthetic division (Horner's method) to find
polynomial
.
for the
Example.
Use synthetic division (Horner's method) to find
.
Solution.
This example is for pedagogical purposes.Our eventual goal is to use a vector for the
coefficients, but for now we will enter them separately into each coefficient.First we will
check out the nested multiplication idea.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Moreover, let us verify the formulas for the quotient and remainder
,
where
http://www.amaderforum.com
is the remainder.
http://www.amaderforum.com
Heuristics
In the days when "hand computations" were necessary, the Horner
tableau (or table) was used.The coefficients
of the polynomial are
entered on the first row in descending order, the second row is
reserved for the intermediate computation step(
)and the bottom
row contains the coefficients and
.
and
is a number for which
and
are to be evaluated.We
have already seen that
can be computed recursively as follows.
,and
for
and
.
We can compute
(i)
,and
for
(ii)
The Horner tableau (or table) was used for computing the coefficients
is given below.
http://www.amaderforum.com
http://www.amaderforum.com
.
Given the value
coefficients
for
for
Then
Newton-Horner method
Assume that
is a polynomial of degree
and there exists a
number
, where
.If
, then there exists a
such
that the sequence
defined by the Newton-Raphson iteration
formula
for
will converge torfor any initial approximation
.The
recursive formulas in the Lemma can be adapted to compute
and
and the resulting Newton-Horner
http://www.amaderforum.com
http://www.amaderforum.com
iteration formula looks like
for
Algorithm (Newton-Horner Iteration).To find a root of
an initial approximation using the iteration
for
http://www.amaderforum.com
given
http://www.amaderforum.com
.
Given the value
is
and
for
Polynomial Deflation
Given the polynomial
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
The coefficients ofQ[x]printed above have been rounded off.Actually there is a little bit
of round off error in the coefficients forming
,we will have to dig them out to look at
them.
We should carry out one more step in the iteration using the
commandNewtonHorner[3.0,7]and get a more accurate calculation for the
coefficients of
.When this is done the result will be:
are
.
This still leaves some unanswered questions that we will answer in other modules.The
quadratic factors can be determined using the Lin-Bairstow method.Or if one prefers
complex arithmetic, then Newton's method can be used.For example, starting with the
imaginary number
Newton's method will create a complex sequence
converging to the complex root
of
.
http://www.amaderforum.com
http://www.amaderforum.com
For cases involving complex numbers the reader should look at the Lin-Bairstow and the
Fundamental Theorem of Algebra modules.
Getting Real Roots
The following example illustrates polynomial deflation and shows that the order in which
the roots are located could be important.In light of example 6 we know that better
calculations are made for evaluating
whenxis small.The Newton-Horner subroutine
is modified to terminate early if
evaluates close to zero (when a root is located).
Mathematica Subroutine (Newton-Horner Iteration).
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
.Then
(1)
Let
can be expressed as
(2)
where
.Here
,
is the remainder when
is divided by
is a polynomial of degree
and can be represented by
(3)
.
If we set
and
,then
(4)
,
where
(5)
and equation (4) can be written
(6)
.
The terms in (6) can be expanded so that
(7)
The numbers
coefficients
(8)Set
http://www.amaderforum.com
http://www.amaderforum.com
,and then
for
Example.
Use quadratic synthetic division to divide
.
by
Solution.
First, construct the polynomial
Second, given
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
We are done.
Aside.We can have Mathematica compute the quotient and remainder using the built in
proceduresPolynomialQuotientandPolynomialRemainder.This is just for fun!
http://www.amaderforum.com
http://www.amaderforum.com
Heuristics
In the days when "hand computations" were necessary, the quadratic synthetic division
tableau (or table) was used.The coefficients
of the polynomial are entered on the
first row in descending order, the second and third rows are reserved for the intermediate
computation steps(
and
)and the bottom row contains the coefficients ,
and
.
.
Given the quadratic
,the quotient
and
.
http://www.amaderforum.com
and remainder
are
http://www.amaderforum.com
The recursive formulas for computing the coefficients
of
are
,and
,and then
for
can be expressed as
.
(10)
is closer to a factor of
,and
.
The differentials of the functionsuandvare used to produce the approximations
and
The new values
are to satisfy
http://www.amaderforum.com
http://www.amaderforum.com
,and
.
When the quantities
are small, we replace the above approximations with
equations and obtain the linear system:
(11)
All we need to do is find the values of the partial derivatives
and
and then use Cramer's rule to compute
announce that the values of the partial derivatives are
,
.Let us
,and
,and then
for
in (8).Since
,and
,and
the linear system in (11)can be written as
Cramer's rule can be used to solve this linear system.The required determinants are
,
and the new values
,and
http://www.amaderforum.com
http://www.amaderforum.com
,
and
.
The iterative process is continued until good approximations torandshave been found.If
the initial guesses
are chosen small, the iteration does not tend to wander for a
long time before converging.When
,the larger powers ofxcan be neglected in
equation (1) and we have the approximation
.
Hence the initial guesses for
.
could be
and
,provided that
If hand calculations are done, then the quadratic synthetic division tableau can be
extended to form an easy way to calculate the coefficients
.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Brent's Method
Background
We start by reviewing the secant method and then extend it to the inverse quadratic
interpolation method.Mueller's proposed a method using successive bisection and inverse
quadratic interpolation which was extended by Brent's and others.It uses a combination of
the bisection, regula falsi, and inverse quadratic interpolation methods.
Theorem ( Secant Method ).Assume that
and there exists
a number
, where
.If
, then there exists a
such that the sequence
defined by the iteration
for
will converge to
.
for
.
Mathematica Subroutine (Secant Method).
http://www.amaderforum.com
http://www.amaderforum.com
for
will converge to
for
http://www.amaderforum.com
given
http://www.amaderforum.com
The computation of
is
seen to require 12 function evaluations (because occurs 13
times).This number can be reduced to 3 function evaluations per
iteration by using the following "algebraic trick."
Algorithm ( Inverse Quadratic Method ).Find a root of
given
three initial approximations
iteration.When the code in the
above subroutine is executed the computation of
is
seen to require 13 function evaluations.(because occurs 13
times).The number of function evaluations can by using the following
scheme.
for
http://www.amaderforum.com
http://www.amaderforum.com
More Background
We will now review some root bracketing methods.The regula falsi
method usually converge faster than the bisection method
bisection.However, examples can be found when the bisection method
converges faster.To speed things up, Brent included inverse quadratic
interpolation and his method combines the root bracketing methods:
bisection, regula falsi; and inverse quadratic interpolation methods.
Theorem ( Bisection Method ). Assume that
and that there
exists a number
such that
.If
have opposite
signs, and
represents the sequence of midpoints generated by the
bisection process, then
fo
r
http://www.amaderforum.com
and that
http://www.amaderforum.com
http://www.amaderforum.com
Brent's Method
The secant method and inverse quadratic interpolation method can be
used to find a root
of the function
.Combining these
methods and making variations which include inverse interpolation
have been presented by A. van Wijngaarden, J. A. Zonneveld and E. W.
Dijkstra (1963), J. H. Wilkinson (1967), G. Peters and J. H. Wilkinson
(1969), T. J. Dekker (1969) and were improved by R. P. Brent (1971).
Brent's method can be used to find a root
provided that
have opposite signs.At a typical step we have three points
such that
,and the pointamay coincide with the
pointc.The points
change during the algorithm, and the root
always lies in either
or
.The valuebis the best approximation to
the root andais the previous value ofb.The method uses a combination
of three methods: bisection, regula falsi, and inverse quadratic
interpolation.It is difficult to see how each of these ideas are
incorporated into the subroutine.To assist with locating the lines that
must be used in logical sequence some of the lines have been color
coded.But some lines are used in more than one method so look
carefully at the subroutine and the portions listed below.
The Brent subroutine will find the root of the function
in the
interval
to within a tolerance
where is a positive
http://www.amaderforum.com
http://www.amaderforum.com
tolerance and
.
Algorithm (Brent's Method).Find a rootpof
given initial
bracketing interval
where
must have opposite signs.At
a typical step we have three points
such that
,andamay coincide withc.The points
change during the
algorithm, and the root always lies in either
or
.The valuebis
the best approximation to the root andais the previous value ofb.The
iteration uses a combination oftechniques:
(i)The Bisection Method
,or
(ii)Regula Falsi Method
,or
(iii) Quadratic Interpolation
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Graeffe's Method
Background
We use the following important result from the study of the theory of equations.
Theorem ( Vieta's Formulas ).Consider a polynomial of
roots
of degreenwith
.
Let be the elementary symmetric function or symmetric polynomial
for the variables
,
...
then
.
Moreover, we have the important identities relating the coefficients of
for
http://www.amaderforum.com
http://www.amaderforum.com
Separated Roots
If the roots of
are widely separated in magnitude, then they can
be approximated using ratios of the coefficients of
.This is the
heart of the Graeffe method.
with roots
.Then
of degree n in
is defined by
.
http://www.amaderforum.com
http://www.amaderforum.com
The Goal
If the roots of
are real and distinct then successive root squaring
will generate a sequence of polynomials
,where each
polynomial
are
of degree
as follows:
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
these cases and leave them for the reader to investigate.We will look
at two of the easier cases which give a glimpse of what might happen.
Repeated Real Roots
The standard Graeffe iteration given in the Mathematica subroutine is
robust enough to treat the case of repeated real roots.However,
knowing that a double root appears is essential information that will be
used.If is a root of orderj,then
and the magnitude of
the repeated roots are given by the following computation.After v
iterations the polynomial
is constructed
.
The Efficient Graeffe Subroutine
It can be observed that the functions
are never used in Graeffe's
method, only their coefficients.So it is an unnecessary step to form the
polynomials.The following streamlined version of the subroutine uses
only the coefficients.Also, this version can be used with decimal entries
for the coefficients, where the previous version will not.
Mathematica Subroutine (Graeffe's Method)).
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
.
Similarly, if
independent variables
is
.
Generalized Differential
For a function of several variables, the differential is used to show how changes of the
independent variables affect the change in the dependent variables. Suppose that we have
http://www.amaderforum.com
http://www.amaderforum.com
Suppose that the values of these functions in are known at the point
and we
wish to predict their value at a nearby point
.Let
,denote differential
changes in the dependent variables and , and
denote differential changes in
the independent variables. These changes obey the relationships
,
,
.
If vector notation is used, then this can be compactly written by using
the Jacobian matrix. The function changes aredFand the changes in
the variables are denoteddX.
or
.
Convergence near a Fixed Point
In solving for solutions of a system of equations, iteration is used.We
now turn to the study of sufficient conditions which will guarantee
convergence.
Definition (Fixed Point).A fixed point for the system of two
equations
,
.
is a point
such that
.Similarly, in three dimensions a
fixed point for the system of three equations
,
,
http://www.amaderforum.com
http://www.amaderforum.com
.
is a point
such that
.
,and
,
Theorem (Fixed-Point Iteration).Assume that all the functions and
their first partial derivatives are continuous on a region that contains
the fixed point
or
, respectively.If the starting point is
chosen sufficiently close to the fixed point, then one of the following
cases apply.
Case (i)Two dimensions.If
is sufficiently close to
and if
,
,
then fixed point iteration will converge to the fixed point
Case (ii)Three dimensions.If
and if
is sufficiently close to
+
+
< 1,
http://www.amaderforum.com
http://www.amaderforum.com
+
+
< 1,
+
+
< 1,
then fixed point iteration will converge to the fixed point
If these conditions are not met, the iteration might diverge, which is
usually the case.
ProofNonlinear SystemsNonlinear Systems
Algorithm (Fixed Point Iteration for Non-Linear Systems) In two
dimensions, solve the non-linear fixed point system
given one initial approximation
,i.e.
,i.e.
http://www.amaderforum.com
,
given one initial approximation
the solution ,
which converges to
.
Remark. First we give a subroutine for performing fixed point iteration.
Computer ProgramsNonlinear SystemsNonlinear Systems
Mathematica Subroutine (Fixed Point Iteration in nDimensions).
Example 1.Use fixed point iteration to find a solution to the nonlinear system
http://www.amaderforum.com
http://www.amaderforum.com
Example 1. Use fixed point iteration to find a solution to the nonlinear system
Solution 1.
First, enter the coordinate functions
Mathematica.
http://www.amaderforum.com
http://www.amaderforum.com
How many points of intersection are there ?
Use fixed point iteration to find a numerical approximation to the solution near
.
http://www.amaderforum.com
http://www.amaderforum.com
Accuracy is determined by the tolerance and number of iterations. How accurate was the
solution "really"?
Use fixed point iteration to attempt finding a numerical approximation to the solution
near
.
But this time attempt only 10 iterations !
http://www.amaderforum.com
http://www.amaderforum.com
A fixed point satisfies the equation
, check it out.
? Why ?
http://www.amaderforum.com
http://www.amaderforum.com
Where did all those complex number come from ? Thought we were looking at curves in
the plane ?
Try solving the first equation for x then substituting one of the solutions in for x is the
second equation.
http://www.amaderforum.com
http://www.amaderforum.com
For our course, we don't want the complex solutions because we usually work with real
numbers and our iteration schemes produces more real numbers.
However, you should be convinced that the second solution we seek is
{x -> 1.5560974843220556, y -> -0.5756507696188449}
Do you think we should have started closer to the solution and that fixed point iteration
should then work ?
If so, try the following iteration.
http://www.amaderforum.com
http://www.amaderforum.com
Theoretically, if we know the fixed point and look at the partial derivatives of the
equations then the row sum should be small.
Case (i) Two dimensions. If
is sufficiently close to
,
http://www.amaderforum.com
and if
http://www.amaderforum.com
,
then fixed point iteration will converge to the fixed point
The sum of the absolute values of the partial derivatives is too big, so we should not have
expected that iteration would converge.
http://www.amaderforum.com
http://www.amaderforum.com
Newton's Method for Nonlinear Systems
We now outline the derivation of Newtons method in two
dimensions.Newtons method can easily be extended to higher
dimensions.Consider the system
(1)
which can be considered a transformation from thexy-plane to the uvplane.We are interested in the behavior of this transformation near the
point
whose image is the point
.If the two functions have
continuous partial derivatives, then the differential can be used to
write a system of linear approximations that is valid near the point
:
o
r
(2)
.
Consider the system (1) with u and v set equal to zero,
(3)
Suppose we are trying to find the solution
, then we can apply (2) and write
.
http://www.amaderforum.com
http://www.amaderforum.com
Since
,
this becomes
,
or
.
When we solve this latter equation for
we get
is
.
Suppose that
.
http://www.amaderforum.com
http://www.amaderforum.com
Mathematica Subroutine (Newton's Method for Systems in nDimensions).
http://www.amaderforum.com
http://www.amaderforum.com
Broyden's Method
Background
Newton's method can be used to solve systems of nonlinear equations.
Theorem (Newton-Raphson Method for 2-dimensional
Systems).To solve the non-linear system
,given one initial
approximation ,and generating a sequence
which converges to the solution
,i.e.
.Suppose that has been obtained, use the following steps to obtain
.
Step 1.Evaluate the function
.
Step 2.Evaluate the Jacobian
.
Step 3.Solve the linear system
fo
r
http://www.amaderforum.com
http://www.amaderforum.com
More Background
A drawback of Newton's method is the requirement that the Jacobian matrix be
computed, which requires the calculation of partial derivatives per iteration.One
obvious improvement is to use a finite difference approximation for the Jacobian
matrix.For two dimensions this is
function evaluations.
http://www.amaderforum.com
http://www.amaderforum.com
Broyden's Method
Calculation of the Jacobian matrix requires partial derivative
evaluations and the approximate Jacobian matrix requires
function
evaluations.Hence, a more computationally efficient method is
desired.Broyden's method is a least change secant update method or
quasi-Newton method.Recall the one-dimensional case of Newton's
method for solving
. The secant method replaces the derivative
with the difference quotient
http://www.amaderforum.com
.Then in successive iterations uses an update the approximate
Jacobian with the matrix :
fo
r
and
http://www.amaderforum.com
Mathematica Subroutine (Broyden's Method for Systems in nDimensions).
http://www.amaderforum.com
this time consuming step each time an iteration is performed.A matrix
inversion formula of Sherman and Morrison can facilitate in making a
more efficient algorithm.Except for
, no matrix inverse or solution
of a linear system computation is performed in the general step.This is
efficient when n is large.
Theorem ( Sherman-Morrison Formula ).If is a nonsingular
matrix and
are vectors such that
,then
or
.
Theorem (Broyden's Method for n-dimensional Systems).To
solve the non-linear system
,given one initial approximation
,and generating a sequence
which converges to the solution ,i.e.
.Compute the initial Jacobian matrix
.
Use it to compute the first approximation using Newton's method
.
For
.Suppose that
obtain
.
,and
.
Step 3.Compute
http://www.amaderforum.com
Mathematica Subroutine (Improved Broyden's Method for
Systems in n-Dimensions).
http://www.amaderforum.com
http://www.amaderforum.com
Tri-Diagonal Matrices
Inverse Matrix
LU Factorization
Pivoting Methods
Iterative Refinement
Kirchoff's Law
Leontief Model
http://www.amaderforum.com
http://www.amaderforum.com
Background
We will now develop the back-substitution algorithm , which is
useful for solving a linear system of equations that has an uppertriangular coefficient matrix.
Definition ( Upper-Triangular Matrix ). An
matrix
called upper-triangular provided that the elements satisfy
whenever
.
If A is an upper-triangular matrix, then
triangular system of linear equations.
is
is said to be an upper-
(1)
is an upperfor
http://www.amaderforum.com
http://www.amaderforum.com
for
Or, use the "generalized rule"
for
http://www.amaderforum.com
http://www.amaderforum.com
Lower-triangular systems.
We will now develop the lower-substitution algorithm, which is
useful for solving a linear system of equations that has a lowertriangular coefficient matrix.
Definition ( Lower-Triangular Matrix ). An
matrix
called lower-triangular provided that the elements satisfy
whenever
.
If A is an lower-triangular matrix, then
triangular system of linear equations.
(2)
http://www.amaderforum.com
is
is said to be a lower-
http://www.amaderforum.com
Theorem (Forward Substitution). Suppose that
triangular system with the form given above in (2). If
then there exists a unique solution.
is an lowerfor
for
Remark. The loop control structure will permit us to use one formula
for
http://www.amaderforum.com
http://www.amaderforum.com
Definition ( Newton Polynomial ). The following expression is
called a Newton polynomial of degree n.
or
If n+1 points
are given, then the following equations can
be used to solve for the n+1 coefficients
.
or
for
...
http://www.amaderforum.com
http://www.amaderforum.com
Gauss-Jordan Elimination
matrix
is nonsingular (i.e.,
is an
matrix. The
has a unique
exists).
is nonzero, i.e.
The system
, with augmented matrix , can be solved by
performing row operations on . The variables are placeholders for
the coefficients and cam be omitted until the end of the computation.
http://www.amaderforum.com
http://www.amaderforum.com
Theorem ( Elementary Row Operations ). The following operations
applied to the augmented matrix yield an equivalent linear system.
(i) Interchanges:
(ii) Scaling:
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
=
=
=
=
=
=
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Background
In applications, it is often the case that systems of equations arise
where the coefficient matrix has a special structure. Sparse matrices
which contain a majority of zeros occur are often encountered. It is
usually more efficient to solve these systems using a taylor-made
algorithm which takes advantage of the special structure. Important
examples are band matrices, and the most common cases are the
tridiagonal matrices.
http://www.amaderforum.com
http://www.amaderforum.com
The enumeration scheme for the elements
in (1) do not take
advantage of the overwhelming number of zeros. If the two subscripts
were retained the computer would reserve storage for
elements. Since practical applications involve large values of
,
it is important to devise a more efficient way to label only those
elements that will be used and conceptualize the existence of all those
off diagonal zeros. The idea that is often used is to call elements of
the main diagonal
, subdiagonal elements
are directly
below the main diagonal, and the superdiagonal elements
are
directly above the main diagonal. Taking advantage of the single
subscripts on
we can reduce the storage requirement to
merely
elements. This bizarre way of looking at a tridiagonal
matrix is
.
Observe that A does not have the usual alphabetical connection with
its new elements named
, and that the length of the
subdiagonal and superdiagonal is n-1.
(2)
A tri-diagonal linear system
http://www.amaderforum.com
http://www.amaderforum.com
(3)
=
=
=
=
=
Goals
To understand the "Gaussian elimination process."
To understand solutions to"large matrices" that are contain mostly zero
elements, called "sparse matrices."
To be aware of the uses for advanced topics in numerical analysis:
(i) Used in the construction of cubic splines,
(ii) Used in the Finite difference solution of boundary value
problems,
(iii) Used in the solution of parabolic P.D.E.'s.
Mathematica Subroutine
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Background
Theorem ( Inverse Matrix ) Assume that is an
nonsingular
matrix. Form the augmented matrix
of dimension
. Use Gauss-Jordan elimination to reduce the matrix so that the
identity
is in the first columns. Then the inverse
is located in
columns
. The augmented matrix
looks like:
http://www.amaderforum.com
http://www.amaderforum.com
for
and
of
http://www.amaderforum.com
When exact computations are needed these formulas should be used
instead of using a subroutine or built in procedure for computing the
inverse of
.
(1)
for
.
. Solve the linear
and construct the approximation
http://www.amaderforum.com
http://www.amaderforum.com
Background
Definition ( LU-Factorization ). The nonsingular matrix A has an
LU-factorization if it can be expressed as the product of a lowertriangular matrix L and an upper triangular matrix U:
.
When this is possible we say that A has an LU-decomposition. It turns
out that this factorization (when it exists) is not unique. If L has 1's
on it's diagonal, then it is called a Doolittle factorization. If U has 1's
on its diagonal, then it is called a Crout factorization. When
, it
is called a Cholesky decomposition. In this module we will develop an
algorithm that produces a Doolittle factorization.
Theorem ( LU Factorization with NO pivoting). If row
interchanges arenot needed to solve the linear system AX = B, then A
has the LU factorization (illustrated with 44 matrices).
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
in a definite order. For example,
is a permutation of the five
integers
. The standard base vectors
for
are used in the next definition.
will interchange
http://www.amaderforum.com
PA = LU.
http://www.amaderforum.com
http://www.amaderforum.com
This is the second version of LUfactor and it uses more loops and
traditional programming.
Mathematica Subroutine (LUfactor).
http://www.amaderforum.com
http://www.amaderforum.com
Remark. Everything has been carefully set up so that L, U,
and P can all be studied.
that fits the n data points is obtained by solving the following linear
system
http://www.amaderforum.com
http://www.amaderforum.com
Background
Definition ( LU-Factorization ). The nonsingular matrix A has an
LU-factorization if it can be expressed as the product of a lowertriangular matrix L and an upper triangular matrix U:
.
When this is possible we say that A has an LU-decomposition. It turns
out that this factorization (when it exists) is not unique. If L has 1's
on it's diagonal, then it is called a Doolittle factorization. If U has 1's
on its diagonal, then it is called a Crout factorization. When
(or
), it is called a Cholesky decomposition.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
, where
http://www.amaderforum.com
http://www.amaderforum.com
that fits the n data points is obtained by solving the following linear
system
http://www.amaderforum.com
using the normal equations
(1)
for
.
. Solve the linear
and construct the approximation
http://www.amaderforum.com
http://www.amaderforum.com
Background
Iterative schemes require time to achieve sufficient accuracy and
are reserved for large systems of equations where there are a majority
of zero elements in the matrix. Often times the algorithms are taylormade to take advantage of the special structure such as band
matrices. Practical uses include applications in circuit analysis,
boundary value problems and partial differential equations.
Iteration is a popular technique finding roots of
equations. Generalization of fixed point iteration can be applied to
systems of linear equations to produce accurate results. The method
Jacobi iteration is attributed to Carl Jacobi (1804-1851) and GaussSeidel iteration is attributed to Johann Carl Friedrich Gauss (17771855) and Philipp Ludwig von Seidel (1821-1896).
Consider that the nn square matrix A is split into three parts, the
main diagonal D, below diagonal L and above diagonal U. We have A
= D - L - U.
http://www.amaderforum.com
http://www.amaderforum.com
for
is strictly
If
is carefully chosen a sequence
is generated which converges
to the solution P, i.e.
.
A sufficient condition for the method to be applicable is that A is
strictly diagonally dominant or diagonally dominant and irreducible.
http://www.amaderforum.com
http://www.amaderforum.com
where
and
If
is carefully chosen a sequence
is generated which converges
to the solution P, i.e.
.
A sufficient condition for the method to be applicable is that A is
strictly diagonally dominant or diagonally dominant and irreducible.
http://www.amaderforum.com
http://www.amaderforum.com
Warning.
Iteration does not always converge. A sufficient condition for
iteration to Jacobi iteration to converge is that A is strictly
diagonally dominant. The following subroutine will check to see if a
matrix is strictly diagonally dominant. It should be used before any
call to Jacobi iteration or Gauss-Seidel iteration is made. There exists
a counter-example for which Jacobi iteration converges and GaussSeidel iteration does not converge. The "true" sufficient condition for
Jacobi iteration to converge is that the "spectral radius" of
is less than 1, where
is the diagonal of . That is, the magnitude
of the largest eigenvalue of M must be less than 1. This condition
seems harsh because numerical computation of eigenvalues is an
advanced topic compared to solution of a linear system.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Background
Suppose that iteration is used to solve the linear system
,
and that
is an approximate solution. We call
the
residual vector, and if
is a good approximation then
. A
method based on reducing the norm of the residual will produce a
sequence
that converges faster. The successive over relaxation SOR method introduces a parameter
which speeds up
convergence. The SOR method can be used in the numerical solution
of certain partial differential equations.
Consider that the nn square matrix A is split into three parts, the
main diagonal D, below diagonal L and above diagonal U. We have A
= D - L - U.
http://www.amaderforum.com
http://www.amaderforum.com
for
is strictly
If
is carefully chosen a sequence
is generated which converges
to the solution P, i.e.
.
A sufficient condition for the method to be applicable is that A is
strictly diagonally dominant or diagonally dominant and irreducible.
http://www.amaderforum.com
http://www.amaderforum.com
where
and
If
is carefully chosen a sequence
is generated which converges
to the solution P, i.e.
.
A sufficient condition for the method to be applicable is that A is
strictly diagonally dominant or diagonally dominant and irreducible.
If
is carefully chosen a sequence
is generated which converges
to the solution P, i.e.
.
Remark. A theorem of Kahan states that the SOR method will
converge only if
is chosen in the interval
.
Remark. When we choose
Gauss-Seidel method.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Pivoting Methods
Background
In the
Gauss-Jordan module we saw an algorithm for solving a general linear
system of equations
consisting of n equations and n unknowns
where it is assumed that the system has a unique solution. The
method is attributed
Johann Carl Friedrich Gauss (1777-1855) and
Wilhelm Jordan (1842 to 1899). The following theorem states the
sufficient conditions for the existence and uniqueness of solutions of a
linear system
.
matrix
is an
matrix. The
has a unique
is
exists).
is nonzero, i.e.
http://www.amaderforum.com
system is represented as follows:
The system
, with augmented matrix , can be solved by
performing row operations on . The variables are placeholders for
the coefficients and cam be omitted until the end of the computation.
http://www.amaderforum.com
http://www.amaderforum.com
upper-triangular matrix with
for
. After
constructed, back substitution can be used to solve
for
are
. ng
Pivoting Strategies
There are numerous pivoting strategies discussed in the
literature. We mention only a few to give an indication of the
possibilities.
(i) No Pivoting. No pivoting means no row interchanges. It can be
done only if Gaussian elimination never run into zeros on the
diagonal. Since division by zero is a fatal error we usually avoid this
pivoting strategy.
Pivoting to Avoid
If
, then row p cannot be used to eliminate the elements in
column p below the main diagonal. It is necessary to find row k,
where
and k > p, and then interchange row p and row k so that
a nonzero pivot element is obtained. This process is called pivoting,
and the criterion for deciding which row to choose is called a pivoting
strategy. The first idea that comes to mind is the following one.
(ii) Trivial Pivoting. The trivial pivoting strategy is as
follows. If
, do not switch rows. If
, locate the first row
below p in which
and then switch rows k and p. This will result
in a new element
, which is a nonzero pivot element.
Pivoting to Reduce Error
Because the computer uses fixed-precision arithmetic, it is possible
that a small error will be introduced each time that an arithmetic
operation is performed. The following example illustrates how use of
the trivial pivoting strategy in Gaussian elimination can lead to
significant error in the solution of a linear system of equations.
(iii) Partial Pivoting. The partial pivoting strategy is as
follows. If
, do not switch rows. If
, locate row u below
http://www.amaderforum.com
http://www.amaderforum.com
p in which
and
and then switch rows u and
p. This will result in a new element
, which is a nonzero pivot
element.
Remark. Only row permutations are permitted. The strategy is to
switch the largest entry in the pivot column to the diagonal.
(iv) Scaled Partial Pivoting. At the start of the procedure we
compute scale factors for each row of the matrix as follows:
for
.
The scale factors are interchanged with their corresponding row in the
elimination steps. The scaled partial pivoting strategy is as
follows. If
, do not switch rows. If
, locate row u below
p in which
and
and then switch rows u
and p. This will result in a new element
, which is a nonzero
pivot element.
Remark. Only row permutations are permitted. The strategy is to
switch the largest scaled entry in the pivot column to the diagonal.
(v) Total Pivoting. The total pivoting strategy is as
follows. If
, do not switch rows. If
, locate row u below
p and column v to the right of p in which
and
and then: first switch rows u and p and second switch column v
and p. This will result in a new element
, which is a nonzero
pivot element. This is also called "complete pivoting" or "maximal
pivoting."
Remark. Both row and column permutations are permitted. The
strategy is to switch the largest entry in the part of the matrix that we
have not yet processed to the diagonal.
http://www.amaderforum.com
http://www.amaderforum.com
Background
In the
LU-Factorization module we developed the "LU-solve" method which
will now be used as the computational engine in the iterative
refinement - residual correction method.
Definition ( LU-Factorization ). The matrix A has an LUfactorization if it can be expressed as the product of a lower-triangular
matrix L and an upper triangular matrix U
.
Theorem (A = LU; Factorization with NO Pivoting). Assume that
A has a LU-factorization. The solution X to the linear system
,
is found in three steps:
1. Construct the matrices
, if possible.
2. Solve
for
using forward substitution.
3. Solve
for
using back substitution.
. The elements of
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Form the error in the computation
(2)
Now subtract
, obtaining
substitution
from
or
. Use the
and this equation becomes
.
as follows
.
is made
(4)
The process can be iterated to obtain a sequence
to
converging
For
For
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
FORTRAN is well suited for defining the type of a variable to be either
single precision or
double precision. A resource for this technique is found in, Section 2.5
Iterative Improvement of a Solution to Linear Equations pp. 47-50, in
the book by William H. Press, Saul A. Teukolsky, William T. Vetterling,
Brian P. Flannery: Numerical Recipes in Fortran 77, Cambridge
University Press, 1992, Cambridge, UK.
Remark 2. The examples we present are for pedagogical purposes
and because this module does not use FORTRAN, we cannot illustrate
the full purpose of iterative improvement. Also, because the
convergence will be rapid, we only perform two iterations and to not
need a subroutine for the computations.
http://www.amaderforum.com
http://www.amaderforum.com
Background
An important technique for solving a system of linear
equations
is to form the augmented matrix
reduce
to reduced row echelon form.
and
, where
http://www.amaderforum.com
(i)
If
(ii) If
of solution.
(iii) If
solution.
Free Variables
When the linear system is underdetermined, we needed to
introduce free variables in the proper location. The following
subroutine will rearrange the equations and introduce free variables in
the location they are needed. Then all that is needed to do is find the
row reduced echelon form a second time. This is done at the end of
the next example.
http://www.amaderforum.com
http://www.amaderforum.com
Mathematica Subroutine (Under Determined Equations).
http://www.amaderforum.com
http://www.amaderforum.com
Background
We have seen how Gaussian elimination can be used to obtain the
reduced row echelon form of a matrix and the solution of a linear
system
.
Now we consider the special case of solving a homogeneous linear
system where the column vector is
.
(1)
http://www.amaderforum.com
http://www.amaderforum.com
(i) In each row that does not consist of all zero elements, the first
non-zero element in this row is a 1. (called. a "leading 1).
(ii) In each column that contains a leading 1 of some row, all other
elements of this column are zeros.
(iii) In any two successive rows with non-zero elements, the leading
1 of the the lower row occurs farther to the right than the leading 1 of
the higher row.
(iv) If there are any rows contains only zero elements then they are
grouped together at the bottom.
Lemma.
, where
Theorem.
(i)
If
(ii) If
solution.
Theorem.
(i)
If
http://www.amaderforum.com
.
.
http://www.amaderforum.com
(ii) If
solution.
Free Variables
When the linear system is underdetermined, we needed to
introduce free variables in the proper location. The following
subroutine will rearrange the equations and introduce free variables in
the location they are needed. Then all that is needed to do is find the
row reduced echelon form a second time. This is done at the end of
the next example.
Mathematica Subroutine (Under Determined Equations).
http://www.amaderforum.com
http://www.amaderforum.com
Application to Chemistry
Propane is used to reduce automobile emissions. Consider the chemical equation
which relates how propane molecules (
) combine with oxygen atoms ( ) to form
carbon dioxide (
) and water (
):
http://www.amaderforum.com
http://www.amaderforum.com
Kirchoff's Law
Background
Solution of linear systems can be applied to resistor network
circuits. Kirchoff's voltage law says that the sum of the voltage drops
around any closed loop in the network must equal zero. A closed loop
has the obvious definition: starting at a node, trace a path through the
circuit that returns you to the original starting node.
Network #1
Consider the network consisting of six resistors and two battery,
shown in the figure below.
There are two closed loops. When Kirchoff's voltage law is applied, we
obtain the following linear system of equations.
Network #2
Consider the network consisting of nine resistors and one battery,
shown in the figure below.
http://www.amaderforum.com
http://www.amaderforum.com
Network #3
Consider the network consisting of six resistors and two batteries,
shown in the figure below.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Introduction
The mathematics model for the economy of a country or a region is
based on the various sectors of this economy. The Leontief model is
addresses this problem. Assume that each industry in the economy
has two types of demands: an external demand (from outside the
system) and an internal demand (demand placed on one industry by
another in the same system), the Leontief model is a system of linear
equations. The Leontief model was invented in the 30's by Wassily
Leontief who developed an economic model of the United States
economy by dividing it into 500 economic sectors. Wassily Leontief
received the economics Nobel Prize on October 18, 1973.
The Closed Leontief Model
Assume that an economy consists of n interdependent industries
(or sectors)
. Each industry will consume some of the
goods produced by the other industries, including itself (for example, a
power-generating plant uses some of its own power for
production). An economy is called
closed if it satisfies its own needs; that is, no goods leave or enter the
system. We make the following conventions:
(i)
(ii)
is the number of units produced by industry
necessary to produce one unit by industry ,
that is
(iii)
is the number of units produced by industry
consumed by industry
,
(iv)
produced by industry
and
equals
http://www.amaderforum.com
for
is the
for
http://www.amaderforum.com
,
where
and
are the same as in the closed model and
demand vector.
is the
.
Of course, the matrix
must be invertible, which might not be
always the case. If, in addition,
has nonnegative entries, then
the components of the vector
are nonnegative and therefore they
are acceptable as solutions for this model. We say in this case that the
matrix
is productive.
http://www.amaderforum.com
http://www.amaderforum.com
.
The region
is a convex polytope. If all the vertices of
are
known, then the maximum of
will occur at one of these
vertices.
The solution can be constructed using the simplex method and is
attributed to George Dantzig (1914 - ) who was born in Portland,
Oregon. The simplex method starts at the origin and follows a path
along the edges of the polytope to the vertex where the maximum
occurs. The history of the development of the simplex method has
been summarized in the article:
An Interview with George B. Dantzig: The Father of Linear
Programming by Donald J. Albers; Constance Reid; in The College
Mathematics Journal, Vol. 17, No. 4. (Sep., 1986), pp. 292-314,
Jstor.
http://www.amaderforum.com
http://www.amaderforum.com
Standard Form of the Linear Programming Problem
The standard form of the linear programming problem is to
maximize
of
variables
.
(1)
Maximize
where
(2)
where
(3)
for
for
for
The coefficients
and
can be any real number. It is often
the case that
, but the cases
or
can occur.
http://www.amaderforum.com
http://www.amaderforum.com
Column
in the tableau.
and form a
(ii) Determine the exchange variable, the pivot row and pivotal
element.
The exchange variable is chosen in the pivot column
where
is the smallest negative coefficient.
http://www.amaderforum.com
over
http://www.amaderforum.com
occurs
(iii) Perform row operations to zero out elements in the pivotal column
above and below the pivot row .
(iv) Repeat steps (ii) and (iii) until there are no negative
coefficients
in the bottom row.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Cubic Splines
B-Splines
Bzier Curves
Pade Approximation
Rational Approximation
Legendre Polynomials
Catenary
http://www.amaderforum.com
http://www.amaderforum.com
Background.
When a Taylor series is truncated to a finite number of terms the
result is a Taylor polynomial. A Taylor series expanded about
, is
called a Maclarin series. These Taylor (and Maclaurin) polynomials are
used to numerically approximate functions. We attribute much of the
founding theory to Brook Taylor (1685-1731), Colin Maclaurin (16981746) and Joseph-Louis Lagrange (1736-1813).
, and
.
The remainder term
for
for
http://www.amaderforum.com
, then
.
is
http://www.amaderforum.com
for
, then
,
where
http://www.amaderforum.com
http://www.amaderforum.com
Lagrange Polynomials
Background.
We have seen how to expand a function
in a Maclaurin polynomial about
involving the powers and a Taylor polynomial about
involving the powers
. The Lagrange polynomial of degree passes through the
points
for
and were investigated by the mathematician Joseph-Louis
Lagrange (1736-1813).
and we write
.
The Lagrange polynomial goes through the
for
The remainder term
points
, i.e.
.
has the form
,
for some value
http://www.amaderforum.com
http://www.amaderforum.com
The cubic curve in the figure below illustrates a Lagrange polynomial of degree n = 3,
which passes through the four points
for
.
is valid for
http://www.amaderforum.com
http://www.amaderforum.com
(ii).
is valid for
(iii).
is valid for
(iv).
is valid for
(v).
is valid for
,
.
for
for
for degree
. The
are:
You can use the first Mathematica subroutine that does things in the
"traditional way" or you are welcome to use the second subroutine that
illustrates "Object Oriented Programming."
Mathematica Subroutine (Lagrange Polynomial). Traditional
programming.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Mathematica Subroutine (Lagrange Polynomial). Compact
object oriented programming.
http://www.amaderforum.com
http://www.amaderforum.com
Background.
We have seen how to expand a function
polynomial about
involving the powers
about
involving the powers
.
in a Maclaurin
and a Taylor polynomial
and we write
.
The Newton polynomial goes through the
for
The remainder term
http://www.amaderforum.com
.
has the form
points
, i.e.
http://www.amaderforum.com
,
for some value
that lies in the interval
. The
coefficients
are constructed using divided differences.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
is valid for
(ii).
(iii).
(iv).
(v).
is valid for
is valid for
is valid for
is valid for
,
.
http://www.amaderforum.com
http://www.amaderforum.com
where
and
.
Remark 2. Mathematica's arrays are lists and the subscripts must
start with 1 instead of 0.
http://www.amaderforum.com
http://www.amaderforum.com
is continuous on
http://www.amaderforum.com
for
and
. The details are found in
advanced texts on numerical analysis
http://www.amaderforum.com
http://www.amaderforum.com
Cubic Splines
IV.
for
The second derivative is continuous.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Remark. There are five popular types of splines: natural spline, clamped
spline, extrapolated spline, parabolically terminated spline, endpoint
curvature adjusted spline.
When Mathematica constructs a cubic spline it uses the "natural cubic spline."
Clamped Spline.
http://www.amaderforum.com
and
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
B-Splines
http://www.amaderforum.com
does not apply and construction of the cubic spline require a more
cumbersome algorithm because each piecewise cubic will need to be
individually crafted in order to meet all the conditions for a cubic
spline.
http://www.amaderforum.com
http://www.amaderforum.com
G
lobal`B
Verify that
is a cubic spline.
Each part of
is piecewise cubic.
Are the functions
,
and
continuous for all
?
Since
is composed of the piecewise functions
,
,
,
,
,
, all that is necessary is to see if they join up properly
at the nodes
. However, this will take 15 computations
to verify. This is where Mathematica comes in handy. Follow the link
below if you are interested in the proof.
http://www.amaderforum.com
http://www.amaderforum.com
The above proof that
is a cubic spline used the formulas
,
,
,
,
.
It is the analytic way to do things and illustrates "precise
mathematical" reasoning.
for
http://www.amaderforum.com
http://www.amaderforum.com
for
For the natural cubic spline, we want the second derivatives to be zero
at the left endpoint
.
Therefore we must have
For the natural cubic spline, we want the second derivatives to be zero
at the right endpoint
.
Therefore we must have
Computation will reveal that
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Background.
Figure 1.
http://www.amaderforum.com
http://www.amaderforum.com
Figure 2.
interval
where
are cubic equations defined in the
as shown in Figure 3.
http://www.amaderforum.com
http://www.amaderforum.com
Figure 3.
for
More background
If a control point is chosen farther away from a endpoint, (but in the
same direction), then the Bzier curve will more closely approximate
the tangent line near that endpoint.
http://www.amaderforum.com
http://www.amaderforum.com
Bernstein polynomials.
Definition (Bernstein Polynomials). The Bernstein polynomials of
degree are
, for
, where
,
and
.
Verify that the two functions
and
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Chebyshev Polynomials
.
and
given by
that
minimizes
. Research investigating the minimum error
in polynomial interpolation is attributed to the Russian mathematician
Pafnuty Lvovich Chebyshev (1821-1894).
http://www.amaderforum.com
http://www.amaderforum.com
Table of Chebyshev Polynomials.
=
=
=
=
=
=
=
=
Recursive Relationship.
The Chebyshev polynomials can be generated recursively in the
following way. First, set
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
The roots of
are
.
These will be the nodes for polynomial approximation of degree n.
and
. To minimize the factor
, Chebyshev discovered that
must be chosen so
that
Moreover,
.
http://www.amaderforum.com
http://www.amaderforum.com
Rule of Thumb.
The "best a priori choice" of interpolation nodes for the interval [1,1] are the n+1 nodes that are zeros of the Chebyshev
polynomial
.
Here is a visual analysis of equally spaced nodes verses Chebyshev
nodes on [-1,1], and their affect on the magnitude of Q(x) in the
remainder term
.
,
. The required Chebyshev nodes of
,
and the interpolating nodes
change of variable
then
http://www.amaderforum.com
http://www.amaderforum.com
,
and
for
where
for
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Pad Approximation
Background.
A Pad rational approximation to f(x) on [a,b] is the quotient of two
polynomials
and
of degrees n and m, respectively. We use
the notation
to denote this quotient:
.
We attribute much of the founding theory to Henri Eugne Pad (18631953).
http://www.amaderforum.com
, and that
. Then
http://www.amaderforum.com
Rational Approximation
Background
A rational approximation to f(x) on the interval [a,b] is obtained by
forming the quotient of two polynomials
and
of degrees n
and m, respectively. We use the notation
to denote this
quotient:
.
The polynomials used in the construction are:
and
.
The Pade approximation is a form of rational approximation which is
analogous to the Taylorapproximation because it is based on the
derivatives of f(x) at x=0. The Pad approximation is very accurate
near the center of expansion. However, the error increases as one
moves away from the center of expansion. More accurate rational
approximations are obtained if "interpolation nodes" are used, and we
permit the error to be spread out more evenly over the entire
interval. The process is similar to Lagrange and Chebyshev
interpolation.
http://www.amaderforum.com
http://www.amaderforum.com
Background
We will now study the iterated interpolation methods of Aitken and
Neville. Alexander Craig Aitken (1895-1967) was one of New
Zealand's prominent mathematicians. Eric Harold Neville (1889-1961)
was a mathematics professor at University of Reading, Berkshire,
U.K. The algorithms we seek are remarkably similar:
http://www.amaderforum.com
http://www.amaderforum.com
that passes through the n+1 points
for
, i.e.
.
Iterated Interpolation
We now discuss some heuristic methods of constructing
interpolation polynomials recursively. The methods of Aitken and
Neville are examples of how iteration is used to construct a sequence
of polynomial approximating of increasing order.
Definition (Selected Interpolation). Given the function
that is to be approximated, and the set of nodes:
.
For any subset of k nodes
is denoted
.
The polynomial
knots
for
Successive Interpolation
Consider polynomial interpolation based on equally spaced nodes
If all
nodes are used then a loose claim is that the interpolating
polynomial
will have order of approximation
http://www.amaderforum.com
http://www.amaderforum.com
. Usually there is an abundance of nodes (think 50, 100,...) and the
degree of the interpolating polynomial is small (think 2, 3, 4, 5 or
6). Polynomials of smaller degree
are of practical value:
points
, i.e.
,
for some value
http://www.amaderforum.com
http://www.amaderforum.com
at the
,
at the
.
Then
http://www.amaderforum.com
http://www.amaderforum.com
,
or
,
and it agrees with
nodes
at all the
.
are
,
or
.
http://www.amaderforum.com
http://www.amaderforum.com
Recursive Programming
Aitken's and Neville's polynomials can be programmed recursively
with the following subroutines.
Computer Programs Aitken's and Neville's Interpolation Methods
Mathematica Subroutine (Neville Polynomials).
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
nodes
.
If
be the rearrangement of
such that
sequence. Then the diagonal terms
will converge to
nodes.
, then let
is an increasing
http://www.amaderforum.com
http://www.amaderforum.com
Table 3. Neville's
Method
for
.
Aitken's Method. In each new elements is computed using the
element in the {same row, preceding column} and {top row,
preceding column}.
Table 4. Aitken's
Method
for
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Legendre Polynomials
Background
We have seen how Newton polynomials and Lagrange polynomials
are used to approximate
on an interval
. The constructions
were based on a discrete set of interpolation points in the interval. We
will now consider "least squares" approximations where the polynomial
is "close" to the function throughout the interval
. Our final
construction will use Legendre polynomials that were first studied by
the French mathematician Adrien-Marie Legendre (1752-1833).
Given a set of interpolation points
t
he Newton polynomial and Lagrange polynomial are algebraically
equivalent, and they are equivalent to the polynomial constructed with
Mathematica's built in subroutine "InterpolatingPolynomial." The
subroutine "Fit" can be used to construct the discrete least squares fit
polynomial.
polynomial
is the discrete least squares interpolation
fit provided that the coefficients
of
minimize the sum
satisfies the
for
equations
http://www.amaderforum.com
finding the coefficients
for
Remark. This is the degenerate case of a least squares fit (i.e. if there
were
data points we would have used
instead of
).
Information on polynomial curve fitting can be found in the module
Least Squares Polynomials.
The following example shows that if n+1 points are used to find the
discrete least squares approximation polynomial of degree n , then it is
the same as the Newton (and Lagrange) interpolation polynomial that
passes through the n+1 points.
http://www.amaderforum.com
satisfies the
equations
http://www.amaderforum.com
for
for
Orthogonal Polynomials
To start we need some background regarding an the inner product.
Definition ( Inner Product ). Consider the vector space of functions
whose domain is the interval
. We define the inner product of two
functions
as follows
.
Mathematica Function ( Inner Product ). To compute the inner
product of two real functions over
.
Basis Functions
A basis for a vector space V of functions is a set of linear independent
functions
which has the property that any
can be
written uniquely as a linear combination
http://www.amaderforum.com
http://www.amaderforum.com
.
Fact. The set
power series.
and
when
for
we say that
is an
over the
, and define
http://www.amaderforum.com
polynomials, and form a basis for the set of polynomials and power
series over the interval
.
Corollary 1. The set of orthogonal polynomials
is a basis for
the set V of all polynomials and power series over the interval
.
Corollary 2. The set of Legendre polynomials
is a
basis for the set V of all polynomials and power series over the interval
.
Proof Legendre Polynomials
Efficient Computations
We now present the efficient way to compute the continuous least
squares approximation. It has an additional feature that each
successive term increases the degree of approximation. Hence, an
increasing sequence of of approximations can obtained recursively:
http://www.amaderforum.com
http://www.amaderforum.com
Theorem (Legendre Series Approximation) The Legendre series
approximation of order for a function
over
is given by
where
is the
,
.
Exploration.
where
http://www.amaderforum.com
is the
http://www.amaderforum.com
The Tangent Parabola
by
John H. Mathews
Russell W. Howell The AMATYC Review, Vol. 23, No. 1, Fall 2001, pp.
25-32.
Background
The limit of "the secant line" is "the tangent line." We recast this in
the context of polynomial approximation. The secant line is the
Newton polynomial
, and the tangent line as the Taylor
polynomial
, where each has degree
.
The Newton polynomial
(i)
which simplifies to be
(ii)
which is easily solved using forward elimination:
, and
get
. Substitute
and
(iii)
As h approaches 0 in equation (iii), the limit of the difference
http://www.amaderforum.com
http://www.amaderforum.com
quotient
Newton Polynomial
is the derivative
and the limit of the
is seen to be the Taylor polynomial
:
.
http://www.amaderforum.com
http://www.amaderforum.com
, at
http://www.amaderforum.com
http://www.amaderforum.com
(1)
and
.
Simplification produces the following two equations which will be used
to solve for
.
,
(3)
.
Subtract the first equation in (3) from the second and then divide
by 2h and get
.
Add the equations in (3), subtract
http://www.amaderforum.com
and get
http://www.amaderforum.com
.
The Secant Parabola Formula
The secant parabola for
which passes through
, and
involves the variable x and
parameters
and has the form
(4)
.
A Numerical Experiment
Formulas for the above graphs of the secant parabola
for
are constructed using formula (4). The
computations are centered at the point
using the step
sizes
.
, at
http://www.amaderforum.com
where
are
(5)
.
The first limit in (5) is well known, it is
.
The second limit in (5) is studied in numerical analysis, and is known
to be
, which can be verified by applying L'hopital's rule using
the variable h as follows
http://www.amaderforum.com
polynomial of degree
, and
, we have
http://www.amaderforum.com
http://www.amaderforum.com
,
where
depends on
as
.
it is plain to see that
,
which is the remainder term for the Taylor polynomial of degree
. This cinches the fact that the limit of the secant polynomial is the
tangent polynomial.
Conclusion
The purpose of this article has been to show that the Taylor
polynomial is the limiting case of a sequence of interpolating
polynomials. The development has been to first show graphical
convergence, which is quite rapid. This can be illustrated in the
classroom by using graphical calculators or with computer software
such as Mathematica or Maple. Then a selected set of interpolating
polynomials is tabulated, which is a new twist to the idea of limit, it
involves the concept of convergence of a sequence of
functions. Finally, the power of calculus is illustrated by discovering
that the limiting coefficients are
and
. Then one
recognizes that the "tangent polynomial" is a Taylor polynomial
approximation. Moreover, we have motivated the "what if" exploration
by showing what happens to "the secant parabola" with interpolation
points
,
, and
when the points
"collide" at the single point
. Thus the mystery behind the
Taylor polynomial being based on a single point is revealed. It is
hoped that teachers reading this article will gain insight to how to use
technology in teaching mathematics. Higher degree polynomials have
been investigated by the authors in the article "Investigation of
Tangent Polynomials with a Computer Algebra System ", and some of
the ideas are given below.
http://www.amaderforum.com
approximation of higher degrees?" Exploration of the Newton
polynomials involves complicated symbolic manipulations and is prone
to error when carried out with hand computations. These derivations
can become instructive and enjoyable when they are performed with
computer algebra software. Let
be the Newton polynomial that
passes through the four points
for
. It may be
shown that the Taylor polynomial
is the limit of
as
. We shall use the power of Mathematica to assist us with this
derivation. Begin by setting
equal to the general form of a
Newton polynomial of degree n by issuing the following Mathematica
commands:
Now form the set of four equations that force the polynomial to pass
through the four equally-spaced points. Notice that this is a lowertriangular system of linear equations.
Then solve this lower triangular linear system, and construct the
polynomial
, and store it as the function
.
http://www.amaderforum.com
http://www.amaderforum.com
Finally, compute the limit to verify that our conjecture was correct:
http://www.amaderforum.com
http://www.amaderforum.com
Now form the set of seven equations that force the polynomial to pass
through the four equally-spaced points.
Finally, compute the limit and see that it is the Taylor polynomial.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
The Catenary
Background
A catenary is the curve formed by a flexible cable of uniform density
hanging from two points under its own weigh. Cables of suspension
bridges and attached to telephone poles hang in this shape. If the
lowest point of the catenary is at
, then the equation of the
catenary is
Approximated by a parabola
Notice that
http://www.amaderforum.com
http://www.amaderforum.com
Arc Length
The arc length of the curve
is found by using
the integrand
. The length of the
catenary over the interval [0,a] is given by the calculation
.
Catenary Fit
In order to find a catenary that has width
and height
http://www.amaderforum.com
http://www.amaderforum.com
Conclusion
Either a hanging cable is in the shape of a parabola or a catenary,
let's look at the history of this controversy. The following paragraph is
from the "Concise Encyclopedia of Mathematics" by Eric W. Weisstein.
"The curve a hanging flexible wire or chain assumes when
supported at its ends and acted upon by a uniform gravitational
force. The word catenary is derived from the Latin word for
"chain''. In 1669, Jungius disproved Galileo's claim that the curve of
a chain hanging under gravity would be a Parabola ( MacTutor
Archive ). The curve is also called the Alysoid and Chainette. The
equation was obtained by Leibniz, Huygens, and Johann Bernoulli in
1691 in response to a challenge by Jakob Bernoulli." Other
mathematicians involved with the study of the catenary have been
Robert Adrain, James Stirling, and Leonhard Euler.
An article suitable for undergraduates to read is "The Catenary and
the Tractrix (in Classroom Notes)", Robert C. Yates, American
Mathematical Monthly, Vol. 66, No. 6. (Jun. - Jul., 1959), pp. 500-505.
The St. Louis Arch at the Jefferson National Expansion Memorial was
http://www.amaderforum.com
http://www.amaderforum.com
constructed in the shape of a catenary. Visit the National Park Service
web site arch history and architecture. Or, go directly to the web
page for the precise mathematical formula for the St. Louis arch
( catenary curve equation ).
The University of British Columbia Mathematics Department has an
amusing property of the catenary (Java animation). Which is part of
their "Living Mathematics Project" for "Constructing a new medium for the
communication of Mathematics''.
http://www.amaderforum.com
http://www.amaderforum.com
Curve Fitting
Logistic Curve
Conic Fit
Circle of Curvature
http://www.amaderforum.com
http://www.amaderforum.com
Background
The formulas for linear least squares fitting were independently
derived by German mathematician Johann Carl Friedrich Gauss (17771855) and the French mathematician Adrien-Marie Legendre (17521833).
Theorem (Least Squares Line Fitting ). Given the
points
, the least squares line
fits the points has coefficients a and b given by:
data
and
.
Remark. The least squares line is often times called the line of
regression.
http://www.amaderforum.com
that
http://www.amaderforum.com
Another "Fit"
Theorem (Power Fit). Given the
data
points
, the power curve
points has coefficients a given by:
.
Remark. The case m = 1 is a line that passes through the origin.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Least Squares Polynomials
that fits the n data points is obtained by solving the following linear system
One thing is certain, to find the least squares polynomial the above
linear system must be solved. There are various linear system solvers
that could be used for this task. However, since this is such an
important computation, most mathematical software programs have a
built-in subroutine for this purpose. In Mathematica it is called the "
Fit" procedure. Fit[data, funs, vars] finds a leastsquares fit to a list
of data as a linear combination of the functions funs of variables vars.
We will check the "closeness of fit" with the Root Mean Square or
RMS measure for the "error in the fit."
http://www.amaderforum.com
http://www.amaderforum.com
Mathematica Subroutine (Least Squares Parabola).
http://www.amaderforum.com
.
Theorem (Linear Least Squares). The solution to the linear least
squares problem is found by creating the matrix
whose elements
are
The coefficients
where
http://www.amaderforum.com
and
http://www.amaderforum.com
Nonlinear Curve Fitting
we see
are used to construct the coefficients which are then used to "fit the
curve"
http://www.amaderforum.com
in the xy-plane.
http://www.amaderforum.com
Data Linearization Method for a Power Function Curve Fitting.
Fit the curve
. Then the
we see
are used to construct the coefficients which are then used to "fit the
curve"
http://www.amaderforum.com
in the xy-plane.
http://www.amaderforum.com
Logistic Curve Fitting
to the data
.
, i.e. same
.
Use the "Fit" procedure get Y = A X + B, which must match the form
, hence we must have
and a = A.
Remark. For the method of "data linearization" we must know the constant L in
advance. Since L is the "limiting population" for the "S" shaped logistic curve, a value
of L that is appropriate to the problem at hand can usually be obtained by guessing.
Example. Use the method of "data linearization" to find the logistic curve that fits the
data for the population of the U.S. for the years 1900-1990. Fit the
curve
http://www.amaderforum.com
http://www.amaderforum.com
Date
Populatlion
76094000
92407000
106461000
123076741
132122446
152271417
180671158
205052174
227224681
249464396
http://www.amaderforum.com
http://www.amaderforum.com
Fast Fourier Transform (FFT)
If
,
where the coefficients
formulae:
,
and
.
where
denote the left-hand and right-hand limits,
respectively. With this understanding, we have the Fourier Series
expansion:
http://www.amaderforum.com
http://www.amaderforum.com
,
where the coefficients
formulae:
,
and
.
,
There are n subintervals of equal width
. The coefficients are
based on
for
and
for
http://www.amaderforum.com
http://www.amaderforum.com
where
and
,
The abscissa's form n subintervals of equal width
on
for
http://www.amaderforum.com
based
http://www.amaderforum.com
and
for
The construction is possible provided that
http://www.amaderforum.com
.
.
http://www.amaderforum.com
Background.
Five points in the plane uniquely determine an equation for a conic
section. The implicit formula for a conic section is often mentioned in
textbooks, and the special cases for an ellipse, hyperbola, parabola,
circle are obtained by either setting some coefficients equal to zero or
making them the same value.
http://www.amaderforum.com
http://www.amaderforum.com
The Circle of Curvature: It's a Limit!
by
John H. Mathews
The AMATYC Review, Vol. 25, No. 1, Fall 2003, pp. 57-63.
point (x,f(x)) is
, which can be written as
http://www.amaderforum.com
A new construction of the Circle of Curvature
What determines a circle? A center and a radius. The formula
for the radius of curvature is well established. What idea could we use
to help understand the situation. We could use the fact that three
points determine a circle and see where this leads.
http://www.amaderforum.com
http://www.amaderforum.com
function
The computer gets the correct formula, but leaves out all the human
understanding. The formula for
can be rewritten so that
http://www.amaderforum.com
http://www.amaderforum.com
human insight and inspiration is involved, but the computer cannot
think of the formulas we desire to see. So human intervention must
be called upon and the simplifications must be typed in by hand.
http://www.amaderforum.com
http://www.amaderforum.com
We already knew that Mathematica knows the rules for taking limits of
functions when the formula is given. Now we know that it has the
"artificial intelligence" to rearrange quantities involving an arbitrary
function and can identify difference quotients for approximating
derivatives and find their appropriate limits. It takes quite a bit of
trust to let Mathematica do our thinking. From the steps we filled in,
we can gain trust for the computer's way of doing it.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
for the
http://www.amaderforum.com
The Abscissa the Easy Way
Subtract from
http://www.amaderforum.com
http://www.amaderforum.com
The limit of
as
is merely
, and we have
already observed that the limit in the denominator is
and both
quotients in the numerator tend to
as
.
Thus we have established the formula
the ordinate of center of the circle of curvature.
http://www.amaderforum.com
for
http://www.amaderforum.com
The Ordinate of the Circle the Easy Way
Add to
http://www.amaderforum.com
http://www.amaderforum.com
Generalizations for 2D
In two dimensions, a curve can be expressed with the parametric
equations
and
. Similarly, the formulas for the radius
of curvature and center of curvature can be derived using limits. At
the point
the center and radius of the circle of
convergence is
http://www.amaderforum.com
http://www.amaderforum.com
The Abscissa the Easy Way
Subtract from
the radius of curvature times
abscissa of the circle of curvature is
. The
http://www.amaderforum.com
. The
http://www.amaderforum.com
Numerical Differentiation
Numerical Differentiation
Richardson Extrapolation
Derive Numerical Differentiation Formulae
http://www.amaderforum.com
http://www.amaderforum.com
Background.
Numerical differentiation formulas formulas can be derived by first constructing the
Lagrange interpolating polynomial
through three points, differentiating the
Lagrange polynomial, and finally evaluating
at the desired point. In this
module the truncation error will be investigated, but round off error from computer
arithmetic using computer numbers will be studied in another module.
Theorem (Three point rule for
derivative, based on three points is
,
and the remainder term is
.
Together they make the equation
the truncation error bound is
where
notation for the error term for
, and
,
and the remainder term is
.
Together they make the equation
the truncation error bound is
http://www.amaderforum.com
, and
http://www.amaderforum.com
where
for
This gives rise to the Big "O" notation or the error term
:
.
Project I.
Investigate the numerical differentiation
formula
bound
wher
e
. The truncation error is
investigated. The round off error from computer arithmetic using computer numbers will
be studied in another module.
Enter the three point formula for numerical differentiation.
Aside. From a mathematical standpoint, we expect that the limit of the difference
quotient is the derivative. Such is the case, check it out.
http://www.amaderforum.com
http://www.amaderforum.com
Solution
http://www.amaderforum.com
http://www.amaderforum.com
Project II.
Investigate the numerical differentiation formulae
and truncation error bound
where
. The truncation error is investigated. The round off error
from computer arithmetic using computer numbers will be studied in another module.
Enter the formula for numerical differentiation.
Aside. It looks like the formula is a second divided difference, i.e. the difference quotient
of two difference quotients. Such is the case.
Aside. From a mathematical standpoint, we expect that the limit of the second divided
difference is the second derivative. Such is the case.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Richardson Extrapolation
Numerical differentiation formulas can be derived by first constructing the Lagrange
interpolating polynomial
through three points, differentiating the Lagrange
polynomial, and finally evaluating
at the desired point. The truncation error is
be investigated, but round off error from computer arithmetic using computer numbers
will be studied in another lab.
Theorem (Three point rule for
derivative, based on three points is
,
and the remainder term is
.
Together they make the equation
error bound is
where
for
. This gives rise to the Big "O" notation for the error term
:
.
,
and the remainder term is
.
Together they make the equation
error bound is
http://www.amaderforum.com
http://www.amaderforum.com
where
for
. This gives rise to the Big "O" notation for the error term
:
.
and
Richardson's Extrapolation.
Richardson's extrapolation relates the five point rule and the three point
rule,
Project III.
Investigate the numerical differentiation
formulae
http://www.amaderforum.com
and error
http://www.amaderforum.com
bound
where
.
The truncation error is be investigated, but round off error from computer arithmetic
using computer numbers will be studied in another lab.
Enter the five point formula for numerical differentiation.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Project IV.
Investigate Richardson's extrapolation for numerical differentiation.
Example In general, show that
Solution
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
We have two equations in the two unknown
and
, and all the other
quantities ,
,
,
,
and
are considered as
constants.Now use the Mathematica command "Solve" to solve for
and
The result is not too easy to read, so we can use the commands
and
to
manipulate the formula.In the print statements we add"
"to remind us that we are
using truncated infinite series.The following commands will create a nicer looking
printout for the above solution.
http://www.amaderforum.com
We have obtained the desired numerical differentiation formulas and their remainder
terms.We should mention that new in version 4.1 ofMathematica is symbolic recognition
of order of approximation for divided difference formulas.We can add the term to the
numerical differentiation formula term, and Mathematica will conclude that it is the
derivative plus .The following commands illustrate this feature of Mathematica.
and
are
and
http://www.amaderforum.com
http://www.amaderforum.com
(1)
http://www.amaderforum.com
http://www.amaderforum.com
We can consider that these are four equations in the four unknowns
,
,
and
, and all the other quantities ,
,
,
,
,
,
and
are constants.Now use Mathematica to solve
for
,
,
and
.Since this requires typing of four derivatives
to be solved, we will automate this process too, by using a table to construct the
"variables."
Amazingly, the algebra involved in solving the four equations will result in the
cancellation of
in the odd order derivatives and the term
will cancel in
the even order derivatives.This can be accomplished using Mathematica's Solve
procedure.
The output is not too clear to read, so we shall use the formula manipulation commands
and
to group the numerical differentiation portion, and then use the
ReplaceAll command to change
and
to
and
, then a final
http://www.amaderforum.com
http://www.amaderforum.com
use of Together will clean up the numerical differentiation formula part.All this will be
accomplished in the following three Mathematica commands.If the reader is curious
about exactly what is happening in each step, then the semi-colons can be deleted and the
results of each operation will be shown.
http://www.amaderforum.com
http://www.amaderforum.com
and
if desired.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Numerical Integration
Riemann Sums
Midpoint Rule
Newton-Cotes Integration
Boole's Rule
Romberg Integration
Gauss-Legendre Quadrature
Monte Carlo Pi
http://www.amaderforum.com
http://www.amaderforum.com
Riemann Sums
Definition. Definite Integral as a Limit of a Riemann Sum. Let
be continuous
over the interval
,
and let
be a partition, then the definite integral is given
by
,
where
and the mesh size of the partition goes to zero in the "limit," i.e .
.
The following two Mathematica subroutines are used to illustrate this concept, which was
introduced in calculus.
in the definition.
in the definition.
http://www.amaderforum.com
http://www.amaderforum.com
in the definition.
Improvements can be made in two directions, the midpoint rule evaluates the function
at
, which is the midpoint of the subinterval
Riemann sum.
, i.e.
in the
The Trapezoidal Rule is the average of the left Riemann sum and the right Riemann
sum.
Mathematica Subroutine (Trapezoidal Rule).
Example Let
over
. Use the left Riemann sum with n = 25, 50, and
100 to approximate the value of the integral.
http://www.amaderforum.com
http://www.amaderforum.com
Midpoint Rule
Theorem (Midpoint Rule) Consider
. The midpoint rule is
over
, where
.
This is an numerical approximation to the integral of
and we have the expression
over
.
The remainder term for the midpoint rule is
somewhere between
, and have the equality
, where lies
over
of equal width
by using
.
The
.
This is an numerical approximation to the integral of
and we write
http://www.amaderforum.com
over
http://www.amaderforum.com
of width
is
.
The
" notation
.
the error term
,
by sampling
, where
http://www.amaderforum.com
for
should
http://www.amaderforum.com
Mathematica Subroutine (Midpoint Rule).
http://www.amaderforum.com
by using the
http://www.amaderforum.com
Newton-Cotes Integration
Introduction to Quadrature
We now approach the subject of numerical integration. The goal is
to approximate the definite integral of f(x) over the
interval [a,b] by evaluating f(x) at a finite number
of sample points.
Definition (Quadrature Formula) Suppose that
. A formula of the form
(1)
with the property that
(2)
is called a numerical integration or quadrature formula. The
term E[f] is called the truncation error for integration. The values
are called the quadrature nodes and
are called the weights.
http://www.amaderforum.com
http://www.amaderforum.com
when degree
and
when degree
The form of
can be anticipated by studying what happens
when f(x) is a polynomial. Consider the arbitrary polynomial
of degree i. If
, then
for
all x, and
for all x. Thus it is not surprising that
the general form for the truncation error term is
(3)
http://www.amaderforum.com
.
(9) Simpsons rule has degree of precision n=3. If
, then
.
(10) Simpsons
, then
.
(11) Booles rule has degree of precision n=5. If
, then
.
Example Consider the function
, the equally
spaced quadrature nodes
,
,
,
, and
, and the corresponding function values
,
,
,
, and
. Apply the various
quadrature formulas (4) through (7).
http://www.amaderforum.com
http://www.amaderforum.com
Trapezoidal Rule
http://www.amaderforum.com
Simpsons Rule
Booles Rule
http://www.amaderforum.com
Trapezoidal Rule for Numerical Integration
Theorem (Trapezoidal Rule) Consider
. The trapezoidal rule is
, where
over
.
This is an numerical approximation to the integral of
and we have the expression
over
.
The remainder term for the trapezoidal rule is
lies somewhere between
, and have the equality
, where
over
by using
The
.
This is an numerical approximation to the integral of
and we write
http://www.amaderforum.com
over
http://www.amaderforum.com
" notation
,
by sampling
, where
at the
. Notice that
http://www.amaderforum.com
and
for
.
should
http://www.amaderforum.com
Mathematica Subroutine (Trapezoidal Rule).
by using the
http://www.amaderforum.com
obey the
http://www.amaderforum.com
Definition (Sequence of Trapezoidal
Rules) Define
with step size
define
size
for
where
The recursive trapezoidal rule is used for the Romberg integration algorithm.
http://www.amaderforum.com
http://www.amaderforum.com
Simpson's Rule for Numerical Integration
The numerical integration technique known as "Simpson's Rule" is credited to the
mathematician Thomas Simpson (1710-1761) of Leicestershire, England. His also
worked in the areas of numerical interpolation and probability theory.
, where
over
.
This is an numerical approximation to the integral of
and we have the expression
over
.
The remainder term for Simpson's rule is
somewhere between
, and have the equality
, where lies
over
by using the
. The
.
http://www.amaderforum.com
http://www.amaderforum.com
over
Suppose that
of width
.
is an numerical approximation to the integral, and
.
Furthermore, if
error term
so that the
.
This is expressed using the "big
" notation
,
by sampling
for
at the
, where
http://www.amaderforum.com
and
and
http://www.amaderforum.com
http://www.amaderforum.com
by using
http://www.amaderforum.com
Simpson's 3/8 Rule for Numerical Integration
The numerical integration technique known as "Simpson's 3/8 rule" is credited to the
mathematician Thomas Simpson (1710-1761) of Leicestershire, England. His also
worked in the areas of numerical interpolation and probability theory.
, where
.
This is an numerical approximation to the integral of
and we have the expression
over
.
The remainder term for Simpson's 3/8 rule is
somewhere between
, and have the equality
, where lies
over
subintervals
of equal width
by using the
equally spaced sample points
for
. The
composite Simpson's 3/8 rule for
subintervals is
http://www.amaderforum.com
http://www.amaderforum.com
.
This is an numerical approximation to the integral of
we write
over
and
Suppose that
of width
.
is an numerical approximation to the integral, and
.
Furthermore, if
error term
so that the
.
This is expressed using the "big
" notation
http://www.amaderforum.com
http://www.amaderforum.com
,
by sampling
for
at the
, where
and
http://www.amaderforum.com
http://www.amaderforum.com
Boole's Rule
Theorem (Boole's Rule) Consider
,
, and
. Boole's rule is
over
, where
.
This is an numerical approximation to the integral of
and we have the expression
over
.
The remainder term for Boole's rule is
, and have the equality
. Suppose
of
equal width
by using the equally spaced sample
points
for
. The composite Boole's rule for
subintervals is
.
This is an numerical approximation to the integral of
we write
.
http://www.amaderforum.com
over
and
http://www.amaderforum.com
Suppose that
of width
. The
.
is an numerical approximation to the integral, and
.
Furthermore, if
error term
so that the
.
This is expressed using the "big
" notation
,
by sampling
for
at the
, where
and
http://www.amaderforum.com
is
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Romberg Integration
Background for Romberg Integration. To approximate the
integral
by generating a table of approximations, and using
as
the final answer.
The approximations
are stored in a special lower triangular matrix. The
elements
of the first column are computed using the sequential trapezoidal rule
based on
subintervals of
; then
is computed using Romberg's rule.
Elements of row j are
The algorithm is terminated when
.
.
The subroutine Romberg is "dynamic" in the following sense. At the start, we initialize
the array with the command
and it contains one row and one
element
, in which we place one element
. Next, the
increment command,
is used to make
, and the Append
command,
, is invoked which adds a second row to ,
which is initialized with zeros,
. Then the TrapRule subroutine is called to
perform the sequential trapezoidal rule and fill in the first entry
and Romberg's
rule is used to fill in the second entry
. And so it goes, the sequential trapezoidal
rule is used to fill in the first entry in succeeding rows and Romberg's rule fills in rest of
the entries in that row. The algorithm is terminated when
.
Mathematica Subroutine (Romberg Integration).
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Adaptive Simpson's Rule
The adaptive Simpson's rule for quadrature uses the two subroutines "Simpson" and
"Adapt."The program is "recursive".There is no brake available if something goes wrong,
i.e. if a pathological "bad" function is thrown it's way it may proceed on a slippery path
of infinite recursion.
Execute the following Mathematica subroutine, which is the "long version" of the
subroutine we have been using previously.
http://www.amaderforum.com
http://www.amaderforum.com
Gauss-Legendre Quadrature
Background. Gauss-Legendre Quadrature.
We wish to find the area under the curve
. What method gives
the best answer if only two function evaluations are to be made? We have already seen
that the trapezoidal rule is a method for finding the area under the curve that uses two
function evaluations at the endpoints (-1,f[-1]), and (1,f[1]). But if the graph of y
= f[x] is concave, the error in approximation is the entire region that lies between the
curve and the line segment joining the points. If we are permitted to use the nodes
and
that lie inside the interval [-1,1], the line through the two points
and
crosses the curve, and the area under the line more closely approximates
the area under the curve. This method is attributed to Johann Carl Friedrich Gauss (17771855) and Adrien-Marie Legendre (1752-1833).
The line
.
and
is
http://www.amaderforum.com
(1)
).
If the abscissas
and
=
the Gauss-Legendre 2 point quadrature rule
, and weights
,
which exact for cubic polynomials (i.e.
).
is obtained by sampling
at the
unequally spaced abscissas
, where the corresponding weights are
.
The abscissa's and weights for Gauss-Legendre quadrature are often expressed in decimal
form.
http://www.amaderforum.com
http://www.amaderforum.com
n=2 Rule
where
n=3 Rule
where
n=4 Rule
where
n=5 Rule
where
Remark. For ease of reading the above list of rules has used the notation
instead of
and
, respectively.
and
Theorem (Error for Gauss-Legendre Quadrature). The error terms for the rules n = 2,
3, 4 and 5 can be expressed as follows:
n=2 Rule
n=3 Rule
http://www.amaderforum.com
http://www.amaderforum.com
n=4 Rule
n=5 Rule
Mathematica Subroutine (Gauss-Legendre Quadrature).
http://www.amaderforum.com
http://www.amaderforum.com
Cubic Spline Quadrature
Background for Cubic Spline.
Suppose that
. The function
polynomials
the properties:
I.
for
II.
for
.
The spline passes through each data point.
III.
for
.
The spline forms a continuous function over [a,b].
IV.
for
The spline forms a smooth function.
IV.
for
The second derivative is continuous.
Natural Spline. There exists a unique cubic spline with the free
boundary conditions
and
.
Cubic Spline Quadrature. Integrate the natural cubic spline over the
interval [a,b].
Algorithm Natural Cubic Spline. To construct and evaluate the cubic
spline interpolant
for the
data
points
, using the free boundary
conditions
and
. Then integrate the natural cubic
spline for a quadrature method.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Monte Carlo Pi
Background
We start the familiar example of finding the area of a circle. Figure 1 below shows a
circle with radius
inscribed within a square. The area of the circle is
, and the area of the square is
. The ratio of the area of the circle to the
area of the square is
Figure 1.
If we could compute ratio, then we could multiple it by four to obtain the value
. One particularly simple way to do this is to pick lattice points in the square and count
how many of them lie inside the circle, see Figure 2. Suppose for example that the points
are selected, then there are 812 points inside the circle
and 212 points outside the circle and the percentage of points inside the circle
is
with the following calculation
http://www.amaderforum.com
http://www.amaderforum.com
Figure 2.
http://www.amaderforum.com
. In a typical simulation
, shown in Figure
http://www.amaderforum.com
Figure 3.
Every time a Monte Carlo simulation is made using the same sample size it will
come up with a slightly different value. The values converge very slowly of the
order
. This property is a consequence of the Central Limit Theorem.
Remark. Another interesting simulation for approximating
is known as Buffon's
Needle problem. The reader can find many references to it in books, articles and on the
internet.
Mathematica Subroutine (Monte Carlo Pi).
http://www.amaderforum.com
http://www.amaderforum.com
Area Under a Curve
Monte Carlo simulation can be used to approximate the area under a
curve
for
. First, we must determine the rectangular box
as follows.
where
containing
.
An "estimate" for the accuracy of the above computation is
http://www.amaderforum.com
for
. Use Monte
http://www.amaderforum.com
Mathematica Subroutine (Monte Carlo Simulation).
http://www.amaderforum.com
http://www.amaderforum.com
Caveat. The above subroutine is for pedagogical purposes. The standard
implementation of Monte Carlo integration is done by selecting points only in the domain
of the function, for a one dimensional integral we would use random numbers to select
points
in the interval
and then use the approximation
.
This idea will be developed in the module Monte Carlo integration.
http://www.amaderforum.com
http://www.amaderforum.com
Monte Carlo Integration
Background
We will be discussing how to approximate the value of an integral based on the
average of function values. The following concept is useful.
Theorem (Mean Value Theorem for Integrals). If
, then there exists a number , with
, such that
is continuous over
.
This can be written in the equivalent form:
.
Remark. This computation shows that the area under the curve is the base width
times the "average height"
.
Composite Midpoint Rule
An intuitive method of finding the area under a curve
is to
approximate that area with a series of rectangles that lie above the
intervals
.
Theorem (Composite Midpoint Rule). Consider
. Let the interval
be subdivided into
subintervals
of equal width
spaced nodes
rule for n subintervals is
for
.
This can be written in the equivalent form
,
http://www.amaderforum.com
where
over
http://www.amaderforum.com
Corollary (Remainder term for the Midpoint Rule) The composite
midpoint rule
the integral, and
is an numerical approximation to
.
Furthermore, if
error term
with
so that the
.
This is expressed using the "big
" notation
,
by sampling
, where
at the
for
http://www.amaderforum.com
(1909-1986), because of the similarity of statistical simulation to games of chance, and
because Monte Carlo is a center for gambling and games of chance.
(ii)
in the interval
.
(iii)
(iv)
where
Every time a Monte Carlo simulation is made using the same sample size it will come
up with a slightly different value. Larger values of
will produce more accurate
approximations. The values converge very slowly of the order
. This property
is a consequence of the Central Limit Theorem.
Mathematica Subroutine (Monte Carlo for 1 Dimensional Integrals).
http://www.amaderforum.com
http://www.amaderforum.com
The above subroutine is all we need to "do the math." The following subroutine presents
the results in a nice format.
http://www.amaderforum.com
http://www.amaderforum.com
Iterated Integrals in Higher Dimensions
Sometimes we are given integrals which cannot be done analytically, especially in
higher dimensions where the standard methods of discretization can become
computationally expensive. For example, the error in the composite midpoint rule (and
the composite trapezoidal rule) of an d-dimensional integral has the order of
convergence
. We can apply the inequality
when
to see that Monte-Carlo integration will usually converge faster for quintuple multiple
integrals and higher, i.e.
, etc.
in the
.
.
(iii)
.
(iv)
where
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
2D Trapezoidal and Simpson Rules
Background
The trapezoidal rule and Simpson's rule for ordinary integrals can be extended to
multiple integrals.
where
, that is
http://www.amaderforum.com
http://www.amaderforum.com
Remark. The Trapezoidal rule had the pattern of weights
the Trapezoidal 2D rule extends this pattern to a grid in the rectangle R.
and
where
, that is
.
http://www.amaderforum.com
http://www.amaderforum.com
Remark. Simpson's rule had the pattern of weights
and Simpson's 2D rule extends this pattern to a grid in the rectangle R.
http://www.amaderforum.com
http://www.amaderforum.com
Runge-Kutta Method
Runge-Kutta-Fehlberg Method
Adams-Bashforth-Moulton Method
Milne-Simpson's Method
Galerkin's Method
Painleve Property
Lotka-Volterra Model
Pendulum
Projectile Motion
Lorenz Attractor
Harvesting Model
Picard Iteration
Spring-Mass Systems
http://www.amaderforum.com
http://www.amaderforum.com
Euler's Method for ODE's
The first method we shall study for solving differential equations is called Euler's
method, it serves to illustrate the concepts involved in the advanced methods. It has
limited use because of the larger error that is accumulated with each successive
step.However, it is important to study Euler's method because the remainder term and
error analysis is easier to understand.
Theorem(Euler's Method)
Assume thatf(t,y)is continuous and satisfies a Lipschits condition in the
variabley,and consider theI. V. P. (initial value problem)
with
,over the interval
.
Euler's method uses the formulas
,and
for
as an approximate solution to the differential equation using the discrete set of points
.
Error analysis for Euler's Method
When we obtained the formula
for Euler's method, the neglected term for each step
has the form
.If this was the only error at each step, then at the end of
the interval
, after
steps have been made, the accumulated error would be
http://www.amaderforum.com
http://www.amaderforum.com
.
The error is more complicated, but this estimate predominates.
,for
.
The error at the right end of the interval is called the final global error
.
Remark.The global truncation error
is used to study the behavior of the error for various step
sizes.It can be used to give us an idea of how much computing effort
must be done to obtain an accurate approximation.
Numerical methods used in this module.Use Euler's method and the modified Euler's
method. Construct numerical solutions of order
and
, respectively.The theory for the modified Euler method is not presented at this
time, we are to trust that its development is similar, but the order for the error is better
and is known to be
.
http://www.amaderforum.com
http://www.amaderforum.com
Algorithm (Euler's Method).To approximate the solution of the initial value
problem
with
over
at a discrete set of points using the formulas
,and
for
.
Mathematica Subroutine (Euler's Method).
http://www.amaderforum.com
http://www.amaderforum.com
Mathematica Subroutine (Modified Euler's Method).
http://www.amaderforum.com
http://www.amaderforum.com
Taylor Series Method for ODE's
The Taylorseries method is of general applicability and it is the standard to which we can
compare the accuracy of the various other numerical methods for solving an I. V. P.It can
be devised to have any specified degree of accuracy.
for
where
is
evaluated at
,as an approximate solution to the differential equation using the discrete set of points
.
http://www.amaderforum.com
The error at the right end of the interval is called the final global error
.
http://www.amaderforum.com
http://www.amaderforum.com
Runge-Kutta Method
Theorem (Runge-Kutta Method of order 4) Assume that f(t,y) is
continuous and satisfies a Lipschits condition in the variable y, and consider the I. V. P.
(initial value problem)
with
, over the interval
.
The Runge-Kutta method uses the formulas
, and
for
where
as an approximate solution to the differential equation using the discrete set of points
.
http://www.amaderforum.com
http://www.amaderforum.com
, for
.
The error at the right end of the interval is called the final global
error
.
Algorithm (Runge-Kutta Method). To compute a numerical
approximation for the solution of the initial value problem
with
over
at a discrete set of points using the formula
, for
where
,
,
, and
.
http://www.amaderforum.com
http://www.amaderforum.com
Mathematica Subroutine (Runge-Kutta Method of Order 4).
http://www.amaderforum.com
http://www.amaderforum.com
Runge-Kutta-Fehlberg Method
Runge-Kutta-Fehlberg Method (RKF45)
GATEGATEGATEGATEOne way to guarantee accuracy in the solution of
an I.V.P. is to solve the problem twice using step sizes h and
and compare answers at the mesh points corresponding to the
larger step size.GATEGATEBut this requires a significant amount of
computation for the smaller step size and must be repeated if it is
determined that the agreement is not good enough. The Runge-KuttaFehlberg method (denoted RKF45) is one way to try to resolve this
problem.GATEGATEIt has a procedure to determine if the proper step
size h is being used.GATEGATEAt each step, two different
approximations for the solution are made and compared.GATEGATEIf
the two answers are in close agreement, the approximation is
accepted. If the two answers do not agree to a specified accuracy, the
step size is reduced.GATEGATEIf the answers agree to more significant
digits than required, the step size is increased.
GATEGATEGATEGATEEach Runge-Kutta-Fehlberg step requires the use
of the following six values:
GATEGATEGATE
Then an approximation to the solution of the I.V.P. is made using a
Runge-Kutta method of order 4:
http://www.amaderforum.com
http://www.amaderforum.com
GATEGATE
And a better value for the solution is determined using a Runge-Kutta
method of order 5:
where
is the specified error control tolerance.
Mathematica Subroutine (Runge-Kutta-Fehlberg Method
RFK45)GATEGATETo compute a numerical approximation for the
solution of the initial value problem
with
over
at a discrete set of points with an error controlGATEGATE
.GATEGATEStart with the initial pointGATEGATE
GATEGATEand generate the sequence of approximationsGATEGATE
.GATEGATEThe step size is automatically adjusted.GATEGATEThus the
number
is determined by the subroutine.GATEGATEAt each step the final answer is computed
using the formulaGATEGATEGATE
.GATEGATE
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Remark.GATEGATEThe formula for adjusting the step size is a popular
choice for numerical analysis textbooks.GATEGATE
Remark.GATEGATESome textbooks are now promoting the use of the
RK order five formulaGATEGATE
GATEGATEas the accepted value instead ofGATEGATE
GATEGATEfrom the order four formula.GATEGATEThe following
subroutine includes these adjustments.GATEGATE
GATE
Mathematica Subroutine (Runge-Kutta-Fehlberg Method
RFK54)GATEGATETo compute a numerical approximation for the
solution of the initial value problem
with
over
at a discrete set of points with an error controlGATEGATE
.GATEGATEStart with the initial pointGATEGATE
GATEGATEand generate the sequence of approximationsGATEGATE
.GATEGATEThe step size is automatically adjusted.GATEGATEGATEThus
the number
is determined by the subroutine.GATEGATEAt each step the final answer is computed
using the formula
.GATEGATE
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Remark.GATEGATEOne might question the wisdom of using the RKF54
instead of the RKF45, it is still being debated.GATEGATEIn some sense
the "guarantee" of accuracy is diminished.GATEGATEThe RKF54 is
given for you to explore.
http://www.amaderforum.com
http://www.amaderforum.com
Adams-Bashforth-Moulton Method
The methods of Euler, Heun, Taylor and Runge-Kutta are called single-step methods
because they use only the information from one previous point to compute the successive
point, that is, only the initial point
is used to compute
and in
general
is needed to compute
. After several points have been found it is
feasible to use several prior points in the calculation. The Adams-Bashforth-Moulton
method uses
in the calculation of
. This method is not selfstarting; four initial points
,
,
, and
must be given in
advance in order to generate the points
.
A desirable feature of a multistep method is that the local truncation error (L. T. E.) can
be determined and a correction term can be included, which improves the accuracy of the
answer at each step. Also, it is possible to determine if the step size is small enough to
obtain an accurate value for
, yet large enough so that unnecessary and timeconsuming calculations are eliminated. If the code for the subroutine is fine-tuned, then
the combination of a predictor and corrector requires only two function evaluations
of f(t,y) per step.
.
, and
, and
the corrector
for
as an approximate solution to the differential equation using the discrete set of
points
.
Remark. The Adams-Bashforth-Moulton method is not a self-starting method. Three
additional starting values
must be given. They are usually computed using
the Runge-Kutta method.
Theorem (Precision of Adams-BashforthMoultonMethod) Assume that
is the solution to the
http://www.amaderforum.com
http://www.amaderforum.com
I.V.P.
with
. If
and
is
the sequence of approximations generated by Adams-Bashforth-Moulton
method, then at each step, the local truncation error is of the order
, and the overall global truncation error
is of the order
, for
The error at the right end of the interval is called the final global
error
.
Algorithm (Adams-Bashforth-Moulton Method). To approximate the solution of
the initial value problem
with
over
at a
discrete set of points using the formulas:
use the predictor
and the corrector
for
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Milne-Simpson's Method
The methods of Euler, Heun, Taylor and Runge-Kutta are called single-step methods
because they use only the information from one previous point to compute the successive
point, that is, only the initial point
is used to compute
and in general
is needed to compute
. After several points have been found it is feasible to use several prior points in the
calculation. The Milne-Simpson method uses
in the calculation of
. This method is not self-starting; four initial points
,
,
, and
must be given in advance in order to generate the points
.
A desirable feature of a multistep method is that the local truncation error (L. T. E.) can
be determined and a correction term can be included, which improves the accuracy of the
answer at each step. Also, it is possible to determine if the step size is small enough to
obtain an accurate value for
, yet large enough so that unnecessary and time-consuming calculations are
eliminated. If the code for the subroutine is fine-tuned, then the combination of
a predictor and corrector requires only two function evaluations of f(t,y) per step.
Theorem (Milne-Simpson's Method) Assume that f(t,y) is continuous and
satisfies a Lipschits condition in the variable y, and consider the I. V. P. (initial value
problem)
with
, over the interval
.
The Milne-Simpson method uses the formulas
, and
the predictor
, and
the corrector
for
http://www.amaderforum.com
http://www.amaderforum.com
as an approximate solution to the differential equation using the discrete set of points
.
Remark. The Milne-Simpson method is not a self-starting method. Three additional
starting values
must be given. They are usually computed using the Runge-Kutta method.
Theorem (Precision of the Milne-Simpson Method) Assume
that
is the solution to the I.V.P.
with
. If
and
is the sequence of approximations generated by MilneSimpson method, then at each step, the local truncation error is of the order
, and the overall global truncation error
is of the order
, for
.
The error at the right end of the interval is called the final global
error
http://www.amaderforum.com
for
.
Mathematica Subroutine (Milne-Simpson's Method).
http://www.amaderforum.com
http://www.amaderforum.com
Shooting Methods for ODE's
Background for Boundary Value Problems
Another type of differential equation has the form
(1)
for
with the boundary conditions
with
This is called a boundary value problem. The conditions that
guarantee that a solution to (1) exists should be checked before any
numerical scheme is applied; otherwise, a list of meaningless output
may be generated. The general conditions are stated in the following
theorem.
and
,
then the boundary value problem
with
http://www.amaderforum.com
http://www.amaderforum.com
and
,
then the linear boundary value problem
with
has a unique solution
.
We are all familiar with the differential equation
and its general solution
. The boundary conditions with
can only be solved if
. Unfortunately, because of this counter example, the "theory" which "guarantees" a
solution must be phrased with
http://www.amaderforum.com
http://www.amaderforum.com
. A careful reading of the "theory" reveals that this is a
sufficient condition and not a necessary condition. Indeed there are many problems that
can be solved with the "shooting method" , all we ask is to be cautious with its
implementation and take note that it might not apply sometimes.
with
.
Furthermore, suppose that v(t) is the unique solution to the I.V.P.
with
.
Then the linear combination
.
is a solution to
with
.
Program (Linear Shooting Method). To approximate the solution of
the boundary value problem
with
over the interval [a,b] by using the Runge-Kutta method of order
n=4.
http://www.amaderforum.com
http://www.amaderforum.com
The method involves solving a two systems of equations over
. First solve
with
,
and
.
Then solve
with
,
and
.
Finally, the desired solution x(t) is the linear combination
.
The subroutine Runge2D will be used to construct the two solutions
, and
.
Theory of computation.
What should the "theory" really say? "Existence theory" needs for numerical analysis
needs to be "computational theory." We really need to be guaranteed that two "linearly
independent" solutions u(t) and v(t) given above can be computed. In practice, if
then we need to compute
.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Background
Theorem (Boundary Value Problem). Assume that
is continuous on the region
and that
and
are continuous on
. If there exists a constant
for which
satisfy
and
,
then the boundary value problem
with
has a unique solution
.
The notation
has been used to distinguish the third variable of the
function
. Finally, the special case of linear differential equations is
worthy of mention.
http://www.amaderforum.com
are continuous on
. If there exists a constant
for which p(t) and q(t) satisfy
and
,
then the linear boundary value problem
with
has a unique solution
.
Finite-Difference Method
Methods involving difference quotient approximations for derivatives
can be used for solving certain second-order boundary value
problems. Consider the linear equation
(1)
over [a,b] with
. Form a partition of [a, b] using the points
, where
and
for
. The central-difference formulas discussed in Chapter 6
are used to approximate the derivatives
(2)
http://www.amaderforum.com
http://www.amaderforum.com
and
(3)
for
, where
and
. This system has the familiar tridiagonal form.
We are all familiar with the differential equation
and its general solution
. The boundary conditions with
can only be solved if
. Unfortunately, because of this counter example, the "theory"
which "guarantees" a solution must be phrased with "
." A careful reading of the "theory" reveals that
this is a sufficient condition and not a necessary condition. Indeed
there are many problems that can be solved with the "shooting
method" , all we ask is to be cautious with its implementation and take
note that it might not apply sometimes.
http://www.amaderforum.com
http://www.amaderforum.com
Program (Finite-Difference Method). To approximate the solution
of the boundary value problem
with
and
over the interval
by using the finite difference method of order
. The mesh we use is
and the solution points are
.
Procedures.
(i) Construct the tri-diagonal matrix and vector.
(ii) Solve the system in (i).
(iii) Join the mesh points and vector from (ii) to form the solution
points.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Galerkin's Method
Background
To start we need some background regarding an the inner product.
Definition (Inner Product). Consider the vector space of real functions whose domain
is the closed interval
. We define the inner product of two functions
as follows
.
Remark. The inner product is a continuous infinite dimensional analog to the ordinary
dot product that is studied in linear algebra. If the inner product is zero then
are said to be orthogonal to each other on
. All the functions we use are assumed to be square-integrable, i. e.
.
Mathematica Function (Inner Product). To compute the inner product of two real
functions over
.
Lemma. If
for any function
, then
.
Basis for a Vector Space
A complete basis for a vector space V of functions is a set of linear independent
functions
which has the property that any
can be written uniquely as a linear combination
.
http://www.amaderforum.com
http://www.amaderforum.com
For example, if V the set of all polynomials and power series, then a complete basis is
.
Property. If
and
all
then
.
We mention these concepts without proof so as to provide a little background.
http://www.amaderforum.com
and replace
with
on the left side of (1).
The residual is defined as follows
(4)
The goal is to construct
so that the integral of the residual will be zero for some choices of weight
functions. That is,
will partially satisfy (2) in the sense that
(5)
for some choices of
.
Galerkin's Method
One of the most important weighted residual methods was invented by the Russian
mathematician Boris Grigoryevich Galerkin (February 20, 1871 - July 12,
1945). Galerkin's method selects the weight function functions in a special way: they are
chosen from the basis functions, i.e.
. It is required that the following
equations hold true
(6)
for
.
To apply the method, all we need to do is solve these
equations for the coefficients
.
Galerkin's Method for solving an I. V. P.
Suppose we wish to solve the initial value problem
(i)
,
http://www.amaderforum.com
http://www.amaderforum.com
with
over the interval
.
We use the trial function
(ii)
.
There are
equations to solve
for
, i.e.
(iii)
for
.
Remark. For the solution of an I. V. P. we choose
.
Galerkin's Method for solving an a B. V. P.
Suppose we wish to solve a boundary value problem over the interval
,
(I)
,
with
We define
and use the trial function
(II)
.
http://www.amaderforum.com
http://www.amaderforum.com
There are
equations to solve
for
, i.e.
(III)
for
.
Remark. The functions
must all be chosen with the boundary properties
and
for
.
http://www.amaderforum.com
http://www.amaderforum.com
Painleve Property
Background
If you are tired of your Runge-Kutta solution "blowing up" at a
singularity, then this module could help remedy the situation.
Definition (Singularity). A singularity of
is a point
at which
"blows up" or is not defined.
Definition (Removable Singularity). A singular point
is called a removable singularity if
has a Taylor series expansion about
, i.e. if
has a representation of the form
valid for
.
A common situation is that
is not defined and we only need to define
in order to "remove the singularity."
Definition (Pole). A singular point
is called a pole if
has a series expansion about
which includes only a finite number of negative powers
with
, i.e. if
has a representation of the form
http://www.amaderforum.com
http://www.amaderforum.com
valid for
.
The leading coefficient must be non-zero,
, and we say that
has a pole of order
at
. When
we say it has a simple pole at
.
Remark. When you look at the graph
, a pole at
is a vertical asymptote at
.
Theorem (Poles and Zeros). If
has a pole at
then the function
has a removable singularity at
. If we define
then the equation
will have a root at
.
Definition (Logarithmic Singularity). A logarithmic singularity
involves a logarithmic branch point in the complex plane.
For example, the function
has a logarithmic singularitie at the point
.
Definition (Algebraic Branch Point). A algebraic branch point is a
singular point associated with a fractional power.
For example, the "multivalued function"
has algebraic branch point at
.
http://www.amaderforum.com
http://www.amaderforum.com
Restriction
The Painlev property excludes the occurance of logarighmic branch
points and algebraic branch points. The underlying solution must be
analytic except at isolated points where it has poles. It is not
necessary to dwell on the above definitions, but it is important to know
that we are restricting the type of singularities we want to allow.
Definition (Movable Singularity). If the singularities of a
differential equation depend on the initial conditions then they are said
to be movable singularities.
Definition 1. (Painlev Property) The second-order ordinary
differential equation
has the Painlev property if all movable singularities of
all solutions are poles.
Remark. We will take the liberty to extend this concept to first order
equations.
Definition 2. (Painlev Property) The first-order ordinary
differential equation
has the Painlev property if all movable singularities of all
solutions are poles.
Remark. Movable singularities depend on initial conditions and in
general it is difficult to predict their location. The following examples
have been chosen because the analytic solution can be found.
Computed Solution Curves for Differential Equations
An important problem in numerical analysis is to compute
approximate solutions of the differential equation
(1)
.
Under modest (and well known) assumptions on f, the "general
solution" of (1) consists of an infinite family of functions, each of which
may be distinguished by selection of an initial point
. Starting from this initial point, numerical methods attempt
to approximate the solution
on some specified interval
. Continuity of
http://www.amaderforum.com
http://www.amaderforum.com
does not ensure the continuity of
.
Suppose that
has an infinite discontinuity at
, that is
. Then the reciprocal
tends to zero as
, and
will have a removable singularity at
provided that we define
. We can use the change of variable
(2)
.
Now differentiate each side of (2) and get
Then substitute
from (1) and obtain
(3)
http://www.amaderforum.com
(4)
.
Numerical methods "track" a specific solution curve through the
starting point
. The success of using (4) for tracking the solution
near a singularity is the fact that
as
if and only if
as
. A numerical solution
to (4) can be computed over a small interval containing
, then (2) is used to determine a solution curve for (1) that lies on
both sides of the vertical asymptote
.
A procedure such as the Runge-Kutta method, uses a fixed step
size
and for each
an approximation
is computed for
. If
as
then the numerical method fails to follow the true solution
accurately because of the inherent numerical instability of computing a
"rise" as the product of a very large slope and very small "run" (a
computation which magnifies the error present in the value
). One way to reduce this error is to select a bound B and change
computational strategy as soon as a value
is computed for which
, that is, as soon as the possibility of a singularity is
"sensed." Then we stop using (1) and start with the point
as an initial value to the differential equation (4). Then
proceed to track the reciprocal
, which will not suffer from the difficulties created by steep
slopes.
The following strategy can be employed to extend any single-step
numerical method. We use equation (1) and the initial value
http://www.amaderforum.com
http://www.amaderforum.com
and compute
where
for
and
.
Then switch equations and use (4) with the initial value
and compute
where
for
and
.
Continue in a similar fashion and alternate between formula (1) and
formula (4) until
The decision process, for the "extended" Runge-Kutta method is:
IF
THEN
Perform one Runge-Kutta step using
to compute
,
ELSE
Set
and perform one Runge-Kutta step using
to compute
,
and keep track of
.
http://www.amaderforum.com
http://www.amaderforum.com
ENDIF
Before (4) is used for numerical computations, the formula for
should be simplified in advance so that the "
" or "
" computational problems do not occur.
http://www.amaderforum.com
http://www.amaderforum.com
Lotka-Volterra Model
Background
Math-Model (Lotka-Volterra Equations) The "Lotka-Volterra equations" refer to two
coupled differential equations
,
where
,
,
, and
.
http://www.amaderforum.com
http://www.amaderforum.com
Extension to 2D. The Runge-Kutta method is easily extended to solve a system of D.E.'s
over the interval
.
Mathematica Subroutine (Runge-Kutta Method in 2D space) To
compute a numerical approximation for the solution of the initial value
problem
with
,
with
,
over the interval
at a discrete set of points.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Pendulum
The second order D. E. approach
Math-Model (Nonlinear Pendulum) A simple pendulum consists of a point
mass m attached to a rod of negligible weight. The torque
is
(1)
where
denotes the the angle of the rod measured downward from a vertical axis. The
moment of inertia for the point mass is
where l is the length of the rod. The
torque can also be expressed as
, where
is the angular acceleration, using
Newton's second law, and the second derivative, this can be written as
(2)
Math-Model (Linear Pendulum) Introductory courses discuss the pendulum with small
oscillations as an example of a simple harmonic oscillator. If the angle of oscillation
is small, use the approximation
in equation (3) and obtain the familiar
linear D. E. for simple harmonic motion:
(4)
(5)
http://www.amaderforum.com
with
over the interval
http://www.amaderforum.com
,
,
at a discrete set of points.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Projectile Motion
Background
In calculus, a model for projectile motion with no friction is considered, and a
"parabolic trajectory" is obtained. If the initial velocity is
and
is the initial angle
to the horizontal, then the parametric equations for the horizontal and vertical
components of the position vector are
(1)
and
(2)
,
which is an equation of a parabola.
The time
,
yields
,
and the maximum height is
.
The time till impact is found by solving
, which yields
and for this model,
. The range is found by calculating
,
:
.
For a fixed initial velocity
when
, the range
http://www.amaderforum.com
is a function of
, and is maximum
http://www.amaderforum.com
Numerical solution of second order D. E.'s
This module illustrates numerical solutions of a second order differential
equation. First, we consider the special case where the projectile is fired vertically along
the y-axis and has no horizontal motion, i. e. x(t)= 0. The effect of changing the
amount of air drag or air resistance is investigated. It is known that the drag force acting
on an object which moves very slowly through a viscous fluid is directly proportional to
the velocity of that object. However, there are examples, such as Millikan's oil drop
experiment, when the drag force is proportional to the square of the velocity. Further
investigations into the situation could involve the Reynolds number.
No air resistance
.
, and
(ii).
, and
.
(iii).
(iv).
, for
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Lorenz Attractor
Lorenz Attractor
The Lorenz attractor is a set of differential equations which are popular in the field of
Chaos. The equations describe the flow of fluid in a box which is heated along the
bottom. This model was intended to simulate medium-scale atmospheric
convection. Lorenz simplified some of the Navier-Stokes equations in the area of fluid
dynamics and obtained three ordinary differential equations
,
,
.
The parameter p is the Prandtl number,
is the quotient of the Rayleigh
number and critical Rayleigh number and b is a geometric factor. Lorenz is attributed to
using the values
There are three critical points (0,0,0) corresponds to no convection, and the two
points
and
correspond to
steady convection.
The latter two points are to be stable, only if the following equation holds
.
Program (Runge-Kutta Method in 3D space) To compute a
numerical approximation for the solution of the initial value problem
with
with
with
over the interval
,
,
,
at a discrete set of points.
http://www.amaderforum.com
http://www.amaderforum.com
Rssler Attractor
In 1976 the Swiss mathematician Otto Rssler was studying oscillations in chemical
reactions and discovered another set of equations with attractor. They also are involved
with the study of Navier-Stokes equations.
,
,
.
Rssler is acclaimed to use the parameters where a = 0.2, b = 0.2, and c =
5.7. Screw chaos occurs when the parameter values are a = 0.343, b =
1.82 and c = 9.75. Rssler wanted to find a minimum system which would exhibit
chaos. This system of equations looks easier than the Lorenz system, but it is harder to
analyze.
http://www.amaderforum.com
http://www.amaderforum.com
The van der Pol equation can be written as a second order system
,
and
.
Any convenient numerical differential equation solver such as the
Runge-Kutta method can be used to compute the solutions.
http://www.amaderforum.com
Program (Runge-Kutta Method in 2D space) To compute a
numerical approximation for the solution of the initial value problem
with
,
with
,
over the interval
at a discrete set of points.
http://www.amaderforum.com
http://www.amaderforum.com
Harvesting Model
Background
The exponential model
is used to study uninhibited population growth and
solution is the exponential function
. When the term
is added we obtain the logistic differential equation which is used to model
inhibited population growth or bounded population growth. The logistic differential
equation is
.
One form of the solution is
.
The terms have been carefully determined so that the initial condition is
.
The limiting value L of y(t) is given by
.
The graph is the so called "S-shaped" curve. The choice of parameters
creates the curve shown below.
http://www.amaderforum.com
http://www.amaderforum.com
.
There are three solution forms for this differential equation, and they correspond to the
nature of the stationary solutions ( x(t) = c).
Case (i) If
there is one stationary solution
.
When
http://www.amaderforum.com
http://www.amaderforum.com
, the differential equation has the form
and the solution is
.
If
then
.
If
then function x(t) has a vertical asymptote at
http://www.amaderforum.com
http://www.amaderforum.com
Case (ii) If
there are two stationary solutions
and
.
When
, the differential equation has the form
and the solution is
.
If
then
.
If
http://www.amaderforum.com
http://www.amaderforum.com
then the population x(t) becomes extinct at some time
, i. e.
.
Case (iii) If
there are no stationary solutions.
When
, the differential equation has the form
and the solution is
.
The function x(t) has a vertical asymptote at
so the population x(t) becomes extinct at some time
(where
.), i.e.
.
http://www.amaderforum.com
http://www.amaderforum.com
Numerical Solutions
If only the graph of the solution is required, and the formula is not needed, then an
efficient way to solve the differential equation is with a numerical method such as
Modified Euler's method or the Runge-Kutta method. The choice of method depends on
the accuracy required. If an accurate table of numerical values is required then the
Runge-Kutta method should be used.
Program (Modified Euler's Method) To compute a numerical
approximation for the solution of the initial value problem
with
over
at a discrete set of points using the formula
.
http://www.amaderforum.com
http://www.amaderforum.com
Frobenius Series Solution
Background.
Consider the second order linear differential equation
(1)
.
Rewrite this equation in the form
, then use the substitutions
and
and rewrite the differential equation (1) in the form
(2)
.
http://www.amaderforum.com
http://www.amaderforum.com
Definition (Ordinary Point). If the functions
and
are analytic at
, then the point
is called an ordinary point of the differential equation
.
Otherwise, the point
is called a singular point.
http://www.amaderforum.com
http://www.amaderforum.com
Method of Frobenius.
This method is attributed to the german mathemematican Ferdinand Georg Frobenius
(1849-1917 ). Assume that
is regular singular point of the differential equation
.
A Frobenius series (generalized Laurent series) of the form
and
http://www.amaderforum.com
http://www.amaderforum.com
The Recursive Formulas.
For each root
of the indicial equation, recursive formulas are used to calculate the unknown
coefficients
. This is custom work because a numerical value for
is easier use.
.
Surface equation for the vibrating drum.
The solution we are seeking in Example 7 is
where the boundary condition
requires that
, hence
. Therefore the fundamental solutions to the wave equation for
the drum head is
, for n = 1,2,3.
http://www.amaderforum.com
http://www.amaderforum.com
Picard Iteration
Introduction
The term "Picard iteration" occurs two places in undergraduate mathematics. In
numerical analysis it is used when discussing fixed point iteration for finding a numerical
approximation to the equation
. In differential equations, Picard iteration is a
constructive procedure for establishing the existence of a solution to a differential
equation
that passes through the point
.
The first type of Picard iteration uses computations to generate a "sequence of
numbers" which converges to a solution. We will not present this application, but
mention that it involves the traditional role of computer software as a "number
cruncher."
The goal of this article is to illustrate the second application of Picard iteration; i. e.
how to use a computer to efficiently generate a "sequence of functions" which converges
to a solution. We will see that computer software can perform the more sophisticated
task of "symbol cruncher." For years, see references [3 to 7].
Background
Most differential equations texts give a proof for the existence and uniqueness of the
solution to a first order differential equation. Then exercises are given for performing the
laborious details involved in the method of successive approximations. The concept
seems straightforward, just repeated integration, but students get bogged down with the
details. Now computers can do all the drudgery and we can get a better grasp on how the
process works.
Theorem 1 (Existence Theorem). If both
rectangle
and
solution to the initial value problem (I.V.P.)
(1)
for all values of x in some (smaller) interval
.
contained in
http://www.amaderforum.com
Symbolic Analysis
Computer algebra systems are useful for performing the arduous task of repeated
integrations. To perform Picard iteration using Mathematica one must define
, and supply the initial value
, and the number of iterations n. The following
subroutine will compute the first
approximations.
Mathematica Subroutine (Picard Iteration).
http://www.amaderforum.com
http://www.amaderforum.com
Getting the Graphs
If we want to graph several solution, we will need to store them somewhere. The
following version of the Picard subroutine uses the vector . Since the subscript for the
elements of a vector start with
, the notation for the sequence of stored functions will
be
.
Mathematica Subroutine (Vector Form for Picard Iteration).
and
(7)
http://www.amaderforum.com
http://www.amaderforum.com
(9)
http://www.amaderforum.com
http://www.amaderforum.com
Spring-Mass Systems
Background
Consider the system of two masses
and two springs with no external force. Visualize a wall on the left and to the
right a spring , a mass, a spring and another mass. Assume that the spring constants are
. See Figure 1 below.
Figure 1. Coupled masses with spring attached to the wall at the left.
Assume that the masses slide on a frictionless surface and that the functions
denote the displacement from static equilibrium of the masses
, respectively. It can be shown by using Newton's second law and Hooke's law
that the system of D. E.'s for
is
Remark. The eigenfrequencies can be obtained by taking the square root of the
eigenvalues of the matrix
.
More Background
Consider the system of two masses
and three springs with no external force. Visualize a wall on the left and to the
right a spring , a mass, a spring, a mass, a spring and another wall. Assume that the
spring constants are
. See Figure 2 below.
http://www.amaderforum.com
http://www.amaderforum.com
Figure 2. Coupled masses with springs attached to walls at the left and right.
Assume that the masses slide on a frictionless surface and that the functions
denote the displacement from static equilibrium of the masses
, respectively. It can be shown by using Newton's second law and Hooke's law
that the system of D. E.'s for
is
Remark. The eigenfrequencies can be obtained by taking the square root of the
eigenvalues of the matrix
.
http://www.amaderforum.com
http://www.amaderforum.com
Crank-Nicolson Method
Elliptic PDE's
http://www.amaderforum.com
http://www.amaderforum.com
Finite Difference Method
for0 < x < aand0 < t < b,with the boundary conditions
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Crank-Nicolson Method
http://www.amaderforum.com
,for
.
http://www.amaderforum.com
http://www.amaderforum.com
Elliptic PDE's
It is often the case that the boundary values for the functionu(x,y)are
known at all points on the sides of a rectangular regionRin the plane.
In this case, each of these equations can be solved by the numerical
technique known as the finite-difference method.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Power method
Jacobi method
Householder Transformations
Compartment Model
Earthquake Model
Matrix Exponential
Faddeev-Leverrier Method
Hessenberg Factorization
http://www.amaderforum.com
http://www.amaderforum.com
Eigenvalues and Eigenvectors
Background
We will now review some ideas from linear algebra. Proofs of the theorems are either left
as exercises or can be found in any standard text on linear algebra.We know how to solve
n linear equations in n unknowns.It was assumed that the determinant of the matrix was
nonzero and hence that the solution was unique. In the case of a homogeneous system
AX = 0, the unique solution is the trivial solution X = 0.If
,there exist nontrivial
solutions to AX = 0. Suppose that
,and consider solutions to the homogeneous
linear
system
are said
implies that
.If the vectors are not linearly
independent they are said to be linearly dependent.
Two vectors in
http://www.amaderforum.com
http://www.amaderforum.com
parallel.Three vectors in
are linearly independent if and only if they
do not lie in the same plane.
Definition (Linearly Dependent).The vectors
be linearly dependent if there exists a set of numbers
all zero, such that
are said to
not
Theorem.
The vectors
are linearly dependent if and only if at least one
of them is a linear combination of the others.
A desirable feature for a vector space is the ability to express each vector as s linear
combination of vectors chosen from a small subset of vectors.This motivates the next
definition.
Definition (Basis).Suppose that
is a set ofmvectors
in
.The setS i s called a basis for if for every vector
there exists
a unique set
of scalars
so thatXcan be expressed as the linear
combination
be vectors in
http://www.amaderforum.com
eigenvalues and eigenvectors is powerful enough to help solve these
otherwise intractable problems.
LetAbe a square matrix of dimensionn nand letXbe a vector of
dimensionn.The productY = AXcan be viewed as a linear
transformation fromn-dimensional space into itself.We want to find
scalars for which there exists a nonzero vectorXsuch that
(1)
(4)
Definition (Characteristic Polynomial).When the determinant in
(4) is expanded, it becomes a polynomial of degree n, which is called
the characteristic polynomial
(5)
http://www.amaderforum.com
http://www.amaderforum.com
There exist exactly n roots (not necessarily distinct) of a polynomial of
degree n.Each root can be substituted into equation (3) to obtain an
underdetermined system of equations that has a corresponding
nontrivial solution vector X.If is real, a real eigenvectorXcan be
constructed. For emphasis, we state the following definitions.
Definition (Eigenvalue).IfAis andn nreal matrix, then
itsneigenvalues
are the real and complex roots of the
characteristic polynomial
.
Definition (Eigenvector).If is an eigenvalue ofAand the nonzero
vectorVhas the property that
.
The next three results concern the existence of eigenvectors.
Theorem (Corresponding Eigenvectors).Suppose thatAis andn
nsquare matrix.
(a)For each distinct eigenvalue there exists at least one
eigenvectorVcorresponding to .
(b)If has multiplicityr,then there exist at mostrlinearly independent
eigenvectors
that correspond to .
Theorem (Linearly Independent Eigenvectors).Suppose thatAis
andn nsquare matrix.If the eigenvalues
are distinct and
http://www.amaderforum.com
http://www.amaderforum.com
are the k eigenpairs, then
linearly independent vectors.
is a set ofk
Free Variables
When the linear system is underdetermined, we needed to introduce
free variables in the proper location. The following subroutine will
rearrange the equations and introduce free variables in the location
they are needed.Then all that is needed to do is find the row reduced
echelon form a second time.This is done at the end of the next
example.
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Power method
Power Method
We now describe the power method for computing the dominant eigenpair.Its extension
to the inverse power method is practical for finding any eigenvalue provided that a good
initial approximation is known.Some schemes for finding eigenvalues use other methods
that converge fast, but have limited precision.The inverse power method is then invoked
to refine the numerical values and gain full precision.To discuss the situation, we will
need the following definitions.
DefinitionIf is an eigenvalue of Athat is larger in absolute value
than anyother eigenvalue, it is called the dominant eigenvalue. An
eigenvector corresponding to is called a dominant eigenvector.
DefinitionAn eigenvectorVis said to be normalized if the coordinate of
largest magnitude is equal to unity (i.e., the largest coordinate in the
vectorVis the number 1).
Remark.It is easy to normalize an eigenvector
forming a new vector
where
by
and
and
and
where
eigenvector
and
and
and eigenvalue
http://www.amaderforum.com
http://www.amaderforum.com
Speed of Convergence
In the iteration in the theorem uses the equation
,
and the coefficient of
is governed by the
terms
.Consequently, the rate of convergence is linear.Similarly,
the convergence of the sequence of constants
to is linear.The
Aitken method can be used for any linearly convergent sequence
to form a new sequence,
,
that converges faster. TheAitken can be adapted to speed up the
convergence of the power method.
,then
http://www.amaderforum.com
http://www.amaderforum.com
Theorem (Shifted-Inverse Eigenvalues)Suppose that ,Vis an
eigenpair ofA.If
, then
and
generated recursively by
and
where
and
,will converge to the dominant
eigenpair , of the matrix
. Finally, the corresponding
eigenvalue for the matrixAis given by the calculation
http://www.amaderforum.com
http://www.amaderforum.com
where
vector is
and
.
The computation
redistributed in the next state.Similarly we see that
http://www.amaderforum.com
is
http://www.amaderforum.com
is redistributed in the
next state.
and
shows how the
state.
Therefore, the distribution for the next state is
http://www.amaderforum.com
http://www.amaderforum.com
Jacobi method
Jacobis Method
Jacobis method is an easily understood algorithm for finding all eigenpairs for a
symmetric matrix. It is a reliable method that produces uniformly accurate answers for
the results. For matrices of order up to 1010, the algorithm is competitive with more
sophisticated ones. If speed is not a major consideration, it is quite acceptable for
matrices up to order 2020. A solution is guaranteed for all real symmetric matrices when
Jacobis method is used. This limitation is not severe since many practical problems of
applied mathematics and engineering involve symmetric matrices. From a theoretical
viewpoint, the method embodies techniques that are found in more sophisticated
algorithms. For instructive purposes, it is worthwhile to investigate the details of Jacobis
method.
so that
.
In practice we will stop when the off-diagonal elements are close to
zero. Then we will have
.
Remark.Current research by James W. Demmel and Kresimir Veselic (1992) indicate
that Jacobi's method is more accurate than QR.You can check out their research by
following the link in the list of internet resources.The abstract for their research follows
below.
Abstract.We show that Jacobi's method (with a proper stopping criterion) computes
small eigenvalues of symmetric positive definite matrices with a uniformly better relative
accuracy bound than QR, divide and conquer, traditional bisection, or any algorithm
which first involves tridiagonalizing the matrix. In fact, modulo an assumption based on
extensive numerical tests, we show that Jacobi's method is optimally accurate in the
following sense: if the matrix is such that small relative errors in its entries cause small
http://www.amaderforum.com
http://www.amaderforum.com
relative errors in its eigenvalues, Jacobi will compute them with nearly this accuracy. In
other words, as long as the initial matrix has small relative errors in each component,
even using infinite precision will not improve on Jacobi (modulo factors of
dimensionality). ...
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Householder Transformations
Householder's Method
Each transformation in Jacobi's method produced two zero off-diagonal
elements, but subsequent iterations might make them nonzero. Hence
many iterations are required to make the off-diagonal entries
sufficiently close to zero.
Suppose that A is a real symmetric matrix.Householder's method is
used to construct a similar symmetric tridiagonal matrix.Then the QR
method can be used to find all eigenvalues of the tridiagonal matrix.
We now develop the method attributed to Alston Scott Householder
(May 5, 1904 - July4, 1993) which is routinely taught in courses in
linear algebra, and numerical analysis. Several several zero offdiagonal elements are created with each iteration, and they remain
zero in subsequent iterations. We start by developing an important
step in the process.
is
Corollary (
Householder Matrix)Let be an
matrix, and
vector.If is an integer with
, we can construct a vector
matrix
so that
any
and
http://www.amaderforum.com
http://www.amaderforum.com
(1)
Householder Transformations
Suppose that is a symmetric
matrix. Then a sequence of
transformations of the form
will reduce to a symmetric tridiagonal
matrix.Let us visualize the process when
.The first transformation
is defined to be
,where is constructed by applying the above
Corollary with the vector being the first column of the matrix .The
general form of is
(2)
http://www.amaderforum.com
http://www.amaderforum.com
(3)
Again, the
elements of
.
Thus it has taken three transformations to reduce
to tridiagonal form.
http://www.amaderforum.com
http://www.amaderforum.com
Theorem (Computation of One Householder Transformation)If
is a Householder matrix, the transformation
is accomplished as
follows.Let
Let
and compute
and
,
then
is a symmetric
matrix.Start with
.
Construct the sequence
for
http://www.amaderforum.com
.Then
.This process is
http://www.amaderforum.com
Compartment Model
for
http://www.amaderforum.com
for
http://www.amaderforum.com
, and
.Then the
http://www.amaderforum.com
Remark. For a tractable example, if the size of the tanks is increasing then ordinary
eigenvectors are obtained to form the solution.Otherwise, the system might require
"generalized eigenvectors" which are important, but we do not want to digress in that
direction in this module.
Example 3.Find the solution to the "five-stage system" where
http://www.amaderforum.com
for
http://www.amaderforum.com
Earthquake Model
Background.
In the study of earthquake induced vibrations on multistory buildings, the free transverse
oscillations satisfy the equation
(1)
Example 1.Consider a building withn = 6floors each of massm = 1250 slugs (weight of
20 tons)
and the horizontal restoring force ofk = 10,000 lb/ft = 5 tons/footbetween floors.
Then
http://www.amaderforum.com
http://www.amaderforum.com
More Background.
A horizontal earthquake oscillation of amplitude of the form
will produce an
acceleration
, and the opposite internal force on each floor of the building is
.The resulting non-homogeneous system is
,where
ande = 0.075.
Find the coefficient vectorvand the vectorX[t].Plot the vibrations of each floor.
Example 3.For the above non-homogeneous system the coefficient vectorvis the solution
to the equation
.
Plot the maximum amplitude of oscillation of the floors vs the parameter over the
interval
,
this graph should have six vertical asymptotes corresponding to each value in the table
above.
Then plot the maximum amplitude as a function of the periodpin seconds.
http://www.amaderforum.com
http://www.amaderforum.com
Matrix Exponential
,denote the
,and
.
Definition (Fundamental Matrix Solution)The fundamental matrix solution
formed by using the two column vectors
.
(1)
The general solution to
(2)
.
is the linear combination
.
,is
as follows
http://www.amaderforum.com
.
Notation.When we introduce the notation
,
and
can be written as
.
.
The vector of constant
.
The solution with the prescribed initial conditions is
.
Observe that
where
following important definition
http://www.amaderforum.com
http://www.amaderforum.com
Notation. This can be written as
(5)
or
(6)
,
.
Fact.For a
is
,
or
.
Theorem (Matrix Diagonalization)The eigen decomposition of a
is
square matrix A
,
which exists when A has a full set of eigenpairs
diagonal matrix
for
,and d is the
and
is the augmented matrix whose columns are the eigenvectors of A.
.
Matrix power
How do you compute the higher powers of a matrix ?For example, given
then
,
http://www.amaderforum.com
http://www.amaderforum.com
and
,etc.
The higher powers seem to be intractable!But if we have an eigen decomposition, then
we are permitted to write
and
in general
Fact.For a
matrix this is
,which becomes
http://www.amaderforum.com
http://www.amaderforum.com
Faddeev-Leverrier Method
Faddeev-Leverrier Method
Let be ann nmatrix.The determination of eigenvalues and eigenvectors
requires the solution of
(1)
where is the eigenvalue corresponding to the eigenvector .The values
must satisfy the equation
(2)
, which
.
,is
http://www.amaderforum.com
(6)
For a proof for equations (6) and (7) see Vera Nikolaevna Faddeeva,
"Computational Methods of Linear Algebra," (Translated From The
Russian By Curtis D. Benster), Dover Publications Inc. N.Y., Date
Published: 1959 ISBN: 0486604241.
http://www.amaderforum.com
http://www.amaderforum.com
Hessenberg Factorization
Background
If A is symmetric then Householder's method can be used to reduce it to a similar
symmetric tridiagonal matrix.If A is nonsymmetric then Householder's method can be
used to reduce it to a similar Hessenberg matrix.These are the preliminary steps that are
made before applying the QR method for finding eigenvalues of .
Definition(Hessenberg Matrix)
An
matrix with
Hessenberg matrix is
for
Definition(Unitary Matrix)
(i) For real matrices, a unitary matrix is a matrix for which
(ii)For complex matrices, a unitary matrix is a matrix for which
.
.
so that
.
(iv) Given a complex matrix , there exists a unitary matrix and Hessenberg matrix
so that
.
http://www.amaderforum.com
http://www.amaderforum.com
Theorem (Hessenberg Factorization of a Symmetric Matrix)Given a real symmetric
matrix , there exists a unitary matrix and tri-diagonal symmetric matrix so that
.
Remark.This is the case that is easiest to illustrate in a first course in numerical methods.
TheoremIf
then
eigenvectors of .
Remark.The eigenvectors of
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Numerical Optimization
Numerical Optimization
Fibonacci Search
Powell's Method
http://www.amaderforum.com
http://www.amaderforum.com
Golden Ratio Search
Bracketing Search Methods
An approach for finding the minimum of
in a given interval is
to evaluate the function many times and search for a local
minimum. To reduce the number of function evaluations it is
important to have a good strategy for determining where
is to be
evaluated. Two efficient bracketing methods are the golden ratio and
Fibonacci searches. To use either bracketing method for finding the
minimum of
, a special condition must be met to ensure that
there is a proper minimum in the given interval.
Definition (Unimodal Function) The function
on
, if there exists a unique number
is decreasing on
is unimodal
such that
and
is increasing on
http://www.amaderforum.com
http://www.amaderforum.com
If
, then squeeze from the right and use
the
If
, then squeeze from the left and use
the
new interval
and the four points
.
new
interval
and the four points
.
Figure 1. The decision process for the golden ratio
search.
,
,
(to preserve the ordering
http://www.amaderforum.com
).
http://www.amaderforum.com
We want the value of r to remain constant on each
subinterval. If r is chosen judicially then only one new
point e (shown in green in Figure 1) needs to be constructed for the
next iteration. Additionally, one of the old interior points (either c or
d) will be used as an interior point of the next subinterval, while the
other interior point (d or c) will become an endpoint of the next
subinterval in the iteration process. Thus, for each iteration only one
new point e will have to be constructed and only one new function
evaluation
, will have to be made. As a consequence, this means
that the value r must be chosen carefully to split the interval of
into subintervals which have the following ratios:
(3)
and
(4)
If
interval
and
and
Use the facts in (3) and (4) to rewrite this equation and then simplify.
,
,
,
.
Now the quadratic equation can be applied and we get
.
The value we seek is
"golden ratio." Similarly, if
that
http://www.amaderforum.com
http://www.amaderforum.com
Algorithm (Golden Ratio Search for a Minimum). To numerically
approximate the minimum of
on the interval
by using a
golden ratio search. Proceed with the method only if
is a
unimodal function on the interval
. Terminate the process
after max iterations have been completed.
Mathematica Subroutine (Golden Ratio Search for a Minimum).
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
The next example compares the secant method for root-finding with
the golden ratio search method.
http://www.amaderforum.com
given
http://www.amaderforum.com
Fibonacci Search
Bracketing Search Methods
An approach for finding the minimum of
in a given interval is
to evaluate the function many times and search for a local
minimum. To reduce the number of function evaluations it is
important to have a good strategy for determining where
is to be
evaluated. Two efficient bracketing methods are the golden ratio and
Fibonacci searches. To use either bracketing method for finding the
minimum of
, a special condition must be met to ensure that
there is a proper minimum in the given interval.
Definition (Unimodal Function) The function
on
, if there exists a unique number
is decreasing on
is unimodal
such that
and
is increasing on
Fibonacci Search
In the golden ratio search two function evaluations are made at the
first iteration and then only one function evaluation is made for each
subsequent iteration. The value of
remains constant on each
subinterval and the search is terminated at the
subinterval,
provided that
or
where
are the
predefined tolerances. The Fibonacci search method differs from the
golden ratio method in that the value of
is not constant on each
subinterval. Additionally, the number of subintervals (iterations) is
predetermined and based on the specified tolerances.
The Fibonacci search is based on the sequence of Fibonacci
numbers which are defined by the equations
for
Thus the Fibonacci numbers are
http://www.amaderforum.com
http://www.amaderforum.com
Assume we are given a function
interval
. As in the golden ratio search a value
is
selected so that both of the interior points
will be used in the
next subinterval and there will be only one new function evaluation.
If
If
, then squeeze from the right and
, then squeeze from the left and
use the new interval
.
interval
.
If
use the new
http://www.amaderforum.com
http://www.amaderforum.com
If
in the interval
subinterval
, then we select
for the
. We already have relabeled
and since
we will relabel it by
.
is chosen so that
and subtraction produces
(2)
And the ratio
is chosen so that
(3)
http://www.amaderforum.com
http://www.amaderforum.com
Solving (6) for
(7)
produces
.
for the
and get the
and
for
http://www.amaderforum.com
http://www.amaderforum.com
The
the
subinterval by a factor of
length of the last subinterval will be
. After
steps the
.
If the abscissa of the minimum is to be found with a tolerance of
, then we want
. It is necessary to
use n iterations, where n is the smallest integer such that
(8)
Note. Solving the above inequality requires either a trial and error
look at the sequence of Fibonacci numbers, or the deeper fact that the
Fibonacci numbers can be generated by the formula
.
Knowing this fact may be useful, but we still need to compute all the
Fibonacci numbers
in order to calculate the
ratios
subinterval
are
,
.
Note. The value of n used in formulas (9) and (10) is found using
inequality (8).
Algorithm (Fibonacci Search for a Minimum). To numerically
approximate the minimum of
on the interval
by using a
Fibonacci search. Proceed with the method only if
is a unimodal
http://www.amaderforum.com
http://www.amaderforum.com
function on the interval
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Each iteration requires the determination of two new interior points,
one from the previous iteration and the second from formula (9) or
(10). When
, the two interior points will be concurrent
in the middle of the interval. In following example, to distinguish the
last two interior points a small distinguishability constant, , is
introduced. Thus when
is used in formula (9) or (10), the
coefficients of
are
http://www.amaderforum.com
or
, respectively.
http://www.amaderforum.com
Quadratic Interpolative Search
Background for Search Methods
An approach for finding the minimum of
in a given interval is
to evaluate the function many times and search for a local
minimum. To reduce the number of function evaluations it is
important to have a good strategy for determining where
is to be
evaluated. Two efficient bracketing methods are the golden ratio and
Fibonacci searches. To use either bracketing method for finding the
minimum of
, a special condition must be met to ensure that
there is a proper minimum in the given interval.
is unimodal
such that
and
is increasing on
,
.
Suppose that
; then
and the step size h should be
chosen positive. It is an easy task to find a value of h so that the
http://www.amaderforum.com
http://www.amaderforum.com
three points in (1) satisfy (2). Start with
(provided that
Case (i)
); if not, take
in formula (1)
, and so on.
Case (ii)
If
, then
.
We need to check points that lie farther to the right. Double the
step size and repeat the process.
Case (iii)
If
, we have jumped over p and h is too
large.
We need to check values closer to
. Reduce the step size by a
factor of
When
, the step size h should be chosen negative and then
cases similar to (i), (ii), and (iii) can be used.
where
The derivative of
.
is
(4)
Solving
.
in the form
(5)
Multiply each term in (5) by
http://www.amaderforum.com
yields
.
and collect terms involving
http://www.amaderforum.com
.
The value
is a better approximation to p than
. Hence we can replace
with
and repeat the two processes
outlined above to determine a new h and a new
. Continue the
iteration until the desired accuracy is achieved. In this algorithm the
derivative of the objective function
was used implicitly in (4) to
locate the minimum of the interpolatory quadratic. The reader should
note that the subroutine makes no explicit use of the derivative.
http://www.amaderforum.com
minimum). At the minimum we have
the form:
, and we write
(6)
and
in
(7)
The introduction of
in the denominators of (6) and (7) will
make further calculations less tiresome. It is required
that
,
,
, and
. To
find
we define:
(8)
Then substitute
and we have
(9)
Use use (7) to obtain
http://www.amaderforum.com
http://www.amaderforum.com
Then substitute
and we have
(10)
Finally, use (7) and write
(12)
, therefore
http://www.amaderforum.com
Hence,
(14)
Therefore, the value of
is found by substituting the calculated
value of
in (14) into the formula
. To continue the
iteration process, let
and replace and with and ,
respectively, in formulas (12), (13), and (14). The algorithm outlined
above is not a bracketing method. Thus determining stopping criteria
becomes more problematic. One technique would be to require that
, since
.
http://www.amaderforum.com
http://www.amaderforum.com
Nelder Mead Method
Nelder-Mead Method
The Nelder-Mead method is a simplex method for finding a local
minimum of a function of several variables. It's discovery is attributed
to J. A. Nelder and R. Mead. For two variables, a simplex is a triangle,
and the method is a pattern search that compares function values at
the three vertices of a triangle. The worst vertex, where
is
largest, is rejected and replaced with a new vertex. A new triangle is
formed and the search is continued. The process generates a
sequence of triangles (which might have different shapes), for which
the function values at the vertices get smaller and smaller. The size of
the triangles is reduced and the coordinates of the minimum point are
found.
The algorithm is stated using the term simplex (a generalized
triangle in n dimensions) and will find the minimum of a function of n
variables. It is effective and computationally compact.
Initial Triangle
Let
be the function that is to be minimized. To start, we are
given three vertices of a triangle:
, for
. The
function
is then evaluated at each of the three
points:
, for
. The subscripts are then reordered
so that
. We use the notation
(1)
, and
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Note: The choice between and might seem inappropriate for the
two-dimensional case, but it is important in higher dimensions.
Shrink Toward
If the function value at is not less than the value at , the points
and must be shrunk toward . The point is replaced with , and
is replaced with , which is the midpoint of the line segment joining
with .
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Powell's Method
Background - The Taxi Cab Method
Let
be an initial guess at the location of the minimum of the
function
. Assume that the partial derivatives
of the function are not available. An intuitively appealing approach to
approximating a minimum of the function f is to generate the next
approximation
by proceeding successively to a minimum
of f along each of the n standard base vectors. This process can be
called the taxi-cab method and generates the sequence of points
.
Along each standard base vector
the
function f is a function of one variable, and the minimization
of f might be accomplished by the application of either the golden
ratio or Fibonacci searches if f is unimodal in this search direction.
The iteration is then repeated to generate a sequence of points
. Unfortunately, the method is, in general, inefficient due to the
geometry of multivariable functions. But the construction
is involved in the first step of Powell's method, and it is
worthwhile to see how it works. A typical sequence of points generated by the
taxi-cab method is shown in Figure 1 below.
http://www.amaderforum.com
http://www.amaderforum.com
Algorithm (Taxi Cab Method for Finding a Minimum). To numerically
approximate a local minimum of
, where f is a continuous
function of n real variables and
by starting with one
point
and using the "taxi-cab" search along the directions of the
standard base vectors
.
Mathematica Subroutine (Taxi Cab Method for Finding a
Minimum). To numerically approximate a local minimum of
, start with and using the "taxi-cab" search.
Notice. To streamline the algorithm we use Mathematica's built in
procedure FindMinimum to perform the line searches along the base
vectors
. In practice alternate methods could be employed.
Powell's Method
The essence of Powell's method is to add two steps to the process
described in the preceding paragraph. The vector
represents,
in some sense, the average direction moved over the n intermediate
steps
in an iteration. Thus the point
is determined
to be the point at which the minimum of the function f occurs along
the vector
. As before, f is a function of one variable along this
vector and the minimization could be accomplished with an application
of the golden ratio or Fibonacci searches. Finally, since the
vector
was such a good direction, it replaces one of the
http://www.amaderforum.com
http://www.amaderforum.com
direction vectors for the next iteration. The iteration is then repeated
using the new set of direction vectors to generate a sequence of
points
. In one step of the iteration instead of a zig-zag path
the iteration follows a "dog-leg" path. The process is outlined below.
Let
function
.
Let
for
be the set of standard
base vectors.
Initialize the vectors
for
and use their
transpose
to form the columns of the matrix U as follows:
.
Initialize the counter
(i)
Set
(ii) For
find the value of
and set
(iii) Set
set
(iv)
,
that minimizes
.
for
and
.
that minimizes
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Steepest Descent - Gradient Search
Gradient and Newton's Methods
Now we turn to the minimization of a function
of n variables,
where
and the partial derivatives of
are
accessible.
exists for
, is the vector
be a function of
such
. The gradient of
(1)
, denoted
Illustrations
Recall that the gradient vector in (1) points locally in the direction of
the greatest rate of increase of
. Hence
points locally in
the direction of greatest decrease
. Start at the point
and
search along the line through
in the direction
. You will arrive at a point
, where a local minimum occurs when
the point
is constrained to lie on the line
. Since partial
derivatives are accessible, the minimization process can be executed
using either the quadratic or cubic approximation method.
Next we compute
and move in the search
direction
. You will come to
, where a local
minimum occurs when
is constrained to lie on the line
. Iteration will produce a sequence,
, of points with the
property
If
then
http://www.amaderforum.com
http://www.amaderforum.com
Outline of the Gradient Method
Suppose that
(i)
(ii)
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com
Newton's Search Method
Newton's Method
The quadratic approximation method for finding a minimum of a
function of one variable generated a sequence of second degree
Lagrange polynomials, and used them to approximate where the
minimum is located. It was implicitly assumed that near the
minimum, the shape of the quadratics approximated the shape of the
objective function
. The resulting sequence of minimums of
the quadratics produced a sequence converging to the minimum of the
objective function
. Newton's search method extends this
process to functions of n independent variables:
. Starting at an initial point
, a sequence of second-degree
polynomials in n variables can be constructed recursively. If the
objective function is well-behaved and the initial point is near the
actual minimum, then the sequence of minimums of the quadratics will
converge to the minimum of the objective function. The process will
use both the first- and second-order partial derivatives of the objective
function. Recall that the gradient method used only the first partial
derivatives. It is to be expected that Newton's method will be more
efficient than the gradient method.
Background
Now we turn to the minimization of a function
of n variables,
where
and the partial derivatives of
are
accessible. Although the Newton search method will turn out to have
a familiar form. For illustration purposes we emphasize the two
dimensional case when
. The extension to n dimensions is
discussed in the hyperlink.
is a function of
and
. The gradient of
vector function
http://www.amaderforum.com
, denoted by
, is the
http://www.amaderforum.com
are
Lemma 1. For
the Hessian matrix
matrix for the two functions
, i. e.
is the Jacobian
are
http://www.amaderforum.com
and use the notation
and
, then
.
and
it looks like
.
centered at the
A minimum of
occurs where
http://www.amaderforum.com
http://www.amaderforum.com
Using the notation
and
symmetry of
, we write
The gradient
and the
can be written as
.
If
is close to the point
(where a minimum
of f occurs), then
is invertible the above equation can be
solved for
, and we have
.
This value of
can be used as the next approximation to
first step in Newton's method for finding a minimum
and is the
the equation
. For this problem the NewtonRaphson formula is known to be
,
http://www.amaderforum.com
http://www.amaderforum.com
where our previous work with Newton-Raphson method used column
vectors
and
. Here we use
and Lemma 1
.
(i)
(ii)
(iii)
http://www.amaderforum.com
http://www.amaderforum.com
http://www.amaderforum.com