Numerical Analysis

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Numerical analysis

Before the advent of modern computers numerical methods often depended on hand interpolation in large printed
tables. Since the mid 20th century, computers calculate
the required functions instead. These same interpolation
formulas nevertheless continue to be used as part of the
software algorithms for solving dierential equations.

1 General introduction
The overall goal of the eld of numerical analysis is the
design and analysis of techniques to give approximate but
accurate solutions to hard problems, the variety of which
is suggested by the following:
Advanced numerical methods are essential in making numerical weather prediction feasible.

Babylonian clay tablet YBC 7289 (c. 18001600 BC) with annotations. The approximation of the square root of 2 is four
sexagesimal gures, which is about six decimal gures. 1 +
24/60 + 51/602 + 10/603 = 1.41421296...[1]

Computing the trajectory of a spacecraft requires


the accurate numerical solution of a system of
ordinary dierential equations.

Numerical analysis is the study of algorithms that use


numerical approximation (as opposed to general symbolic
manipulations) for the problems of mathematical analysis
(as distinguished from discrete mathematics).

Car companies can improve the crash safety of


their vehicles by using computer simulations of car
crashes. Such simulations essentially consist of solving partial dierential equations numerically.

One of the earliest mathematical writings is a Babylonian


tablet from the Yale Babylonian Collection (YBC 7289),
which
gives a sexagesimal numerical approximation of

2 , the length of the diagonal in a unit square. Being


able to compute the sides of a triangle (and hence, being
able to compute square roots) is extremely important, for
instance, in astronomy, carpentry and construction.[2]

Hedge funds (private investment funds) use tools


from all elds of numerical analysis to attempt to
calculate the value of stocks and derivatives more
precisely than other market participants.
Airlines use sophisticated optimization algorithms
to decide ticket prices, airplane and crew assignments and fuel needs. Historically, such algorithms were developed within the overlapping eld
of operations research.

Numerical analysis continues this long tradition of practical mathematical calculations.


Much like the Babylonian

approximation of 2 , modern numerical analysis does


not seek exact answers, because exact answers are often
impossible to obtain in practice. Instead, much of numerical analysis is concerned with obtaining approximate
solutions while maintaining reasonable bounds on errors.

Insurance companies use numerical programs for


actuarial analysis.

Numerical analysis naturally nds applications in all elds


of engineering and the physical sciences, but in the 21st
century also the life sciences and even the arts have
adopted elements of scientic computations. Ordinary
dierential equations appear in celestial mechanics (planets, stars and galaxies); numerical linear algebra is important for data analysis; stochastic dierential equations and
Markov chains are essential in simulating living cells for
medicine and biology.

The rest of this section outlines several important themes


of numerical analysis.

1.1 History
The eld of numerical analysis predates the invention of
modern computers by many centuries. Linear interpolation was already in use more than 2000 years ago. Many
1

GENERATION AND PROPAGATION OF ERRORS

great mathematicians of the past were preoccupied by nu- the same manner as for an iterative method.
merical analysis, as is obvious from the names of important algorithms like Newtons method, Lagrange interpolation polynomial, Gaussian elimination, or Eulers 1.3 Discretization
method.
Furthermore, continuous problems must sometimes be
To facilitate computations by hand, large books were proreplaced by a discrete problem whose solution is known
duced with formulas and tables of data such as interpoto approximate that of the continuous problem; this prolation points and function coecients. Using these tacess is called discretization. For example, the solution of
bles, often calculated out to 16 decimal places or more
a dierential equation is a function. This function must
for some functions, one could look up values to plug into
be represented by a nite amount of data, for instance by
the formulas given and achieve very good numerical estiits value at a nite number of points at its domain, even
mates of some functions. The canonical work in the eld
though this domain is a continuum.
is the NIST publication edited by Abramowitz and Stegun, a 1000-plus page book of a very large number of
commonly used formulas and functions and their values
at many points. The function values are no longer very 2 Generation and propagation of
useful when a computer is available, but the large listing
errors
of formulas can still be very handy.
The mechanical calculator was also developed as a tool
for hand computation. These calculators evolved into
electronic computers in the 1940s, and it was then found
that these computers were also useful for administrative
purposes. But the invention of the computer also inuenced the eld of numerical analysis, since now longer
and more complicated calculations could be done.

1.2

Direct and iterative methods

Direct methods compute the solution to a problem in a


nite number of steps. These methods would give the
precise answer if they were performed in innite precision arithmetic. Examples include Gaussian elimination, the QR factorization method for solving systems of
linear equations, and the simplex method of linear programming. In practice, nite precision is used and the
result is an approximation of the true solution (assuming
stability).
In contrast to direct methods, iterative methods are not
expected to terminate in a nite number of steps. Starting from an initial guess, iterative methods form successive approximations that converge to the exact solution
only in the limit. A convergence test, often involving the
residual, is specied in order to decide when a suciently
accurate solution has (hopefully) been found. Even using innite precision arithmetic these methods would not
reach the solution within a nite number of steps (in general). Examples include Newtons method, the bisection
method, and Jacobi iteration. In computational matrix
algebra, iterative methods are generally needed for large
problems.
Iterative methods are more common than direct methods
in numerical analysis. Some methods are direct in principle but are usually used as though they were not, e.g.
GMRES and the conjugate gradient method. For these
methods the number of steps needed to obtain the exact
solution is so large that an approximation is accepted in

The study of errors forms an important part of numerical


analysis. There are several ways in which error can be
introduced in the solution of the problem.

2.1 Round-o
Round-o errors arise because it is impossible to represent all real numbers exactly on a machine with nite
memory (which is what all practical digital computers
are).

2.2 Truncation and discretization error


Truncation errors are committed when an iterative
method is terminated or a mathematical procedure is approximated, and the approximate solution diers from
the exact solution. Similarly, discretization induces a
discretization error because the solution of the discrete
problem does not coincide with the solution of the continuous problem. For instance, in the iteration in the sidebar
to compute the solution of 3x3 + 4 = 28 , after 10 or so
iterations, we conclude that the root is roughly 1.99 (for
example). We therefore have a truncation error of 0.01.
Once an error is generated, it will generally propagate
through the calculation. For instance, we have already
noted that the operation + on a calculator (or a computer)
is inexact. It follows that a calculation of the type is even
more inexact.
What does it mean when we say that the truncation error is
created when we approximate a mathematical procedure?
We know that to integrate a function exactly requires one
to nd the sum of innite trapezoids. But numerically
one can nd the sum of only nite trapezoids, and hence
the approximation of the mathematical procedure. Similarly, to dierentiate a function, the dierential element
approaches zero but numerically we can only choose a nite value of the dierential element.

2.3

Numerical stability and well-posed


problems

Numerical stability is an important notion in numerical


analysis. An algorithm is called numerically stable if an
error, whatever its cause, does not grow to be much larger
during the calculation. This happens if the problem is
well-conditioned, meaning that the solution changes by
only a small amount if the problem data are changed by
a small amount. To the contrary, if a problem is illconditioned, then any small error in the data will grow
to be a large error.
Both the original problem and the algorithm used to
solve that problem can be well-conditioned and/or illconditioned, and any combination is possible.

catastrophic cancelation) has a huge eect


on the results, even though both functions are
equivalent, as shown below
(
)
f (x) = x x + 1 x

(
) x+1+ x
=x x+1 x

x+1+ x

( x + 1)2 ( x)2
=x

x+1+ x
x+1x
= x

x+1+ x
1
= x

x+1+ x
x
=

x+1+ x
= g(x)

So an algorithm that solves a well-conditioned problem


may be either numerically stable or numerically unstable.
An art of numerical analysis is to nd a stable algorithm
The desired value, computed using innite prefor solving a well-posed mathematical problem. For incision, is 11.174755...
stance, computing the square root of 2 (which is roughly
1.41421) is a well-posed problem. Many algorithms solve
thisproblem by starting with an initial approximation x1
The example is a modication of one taken from
to 2 , for instance x1 =1.4, and then computing imMathew; Numerical methods using Matlab, 3rd ed.
proved guesses x2 , x3 , etc.. One such method is the famous Babylonian method, which is given by xk = xk/2
+ 1/xk. Another iteration, which we will call Method X,
3 Areas of study
is given by xk = (xk2 2)2 + xk.[3] We have calculated
a few iterations of each scheme in table form below, with
The eld of numerical analysis includes many subinitial guesses x1 = 1.4 and x1 = 1.42.
disciplines. Some of the major ones are:
Observe that the Babylonian method converges quickly
regardless of the initial guess, whereas Method X converges extremely slowly with initial guess 1.4 and diverges 3.1 Computing values of functions
for initial guess 1.42. Hence, the Babylonian method is
numerically stable, while Method X is numerically unsta- One of the simplest problems is the evaluation of a funcble.
tion at a given point. The most straightforward approach,
Numerical stability is aected by the number
of the signicant digits the machine keeps on,
if we use a machine that keeps only the four
most signicant decimal digits, a good example on loss of signicance is given by these two
equivalent functions
(
)
f (x) = x x + 1 x and g(x) =
x .
x+1+ x

of just plugging in the number in the formula is sometimes not very ecient. For polynomials, a better approach is using the Horner scheme, since it reduces the
necessary number of multiplications and additions. Generally, it is important to estimate and control round-o
errors arising from the use of oating point arithmetic.

3.2 Interpolation, extrapolation, and regression

If we compare the results of


)
(

501 500 = 500 (22.38 22.36) =Interpolation


500(0.02) =solves
10 the following problem: given the
f (500) = 500
value of some unknown function at a number of points,
and
what value does that function have at some other point
500
between the given points?

g(500) =
501 + 500
Extrapolation is very similar to interpolation, except that
500
=
now we want to nd the value of the unknown function at
22.38 + 22.36
a point which is outside the given points.
500
= 11.17
=
Regression is also similar, but it takes into account that
44.74
by looking to the two results above, we realthe data is imprecise. Given some points, and a measureize that loss of signicance (caused here by
ment of the value of some function at these points (with

SOFTWARE

an error), we want to determine the unknown function. The method of Lagrange multipliers can be used to reThe least squares-method is one popular way to achieve duce optimization problems with constraints to unconthis.
strained optimization problems.

3.3

Solving equations and systems of equa- 3.6 Evaluating integrals


tions

Main article: Numerical integration

Another fundamental problem is computing the solution


of some given equation. Two cases are commonly distinguished, depending on whether the equation is linear or
not. For instance, the equation 2x + 5 = 3 is linear while
2x2 + 5 = 3 is not.

Numerical integration, in some instances also known as


numerical quadrature, asks for the value of a denite
integral. Popular methods use one of the NewtonCotes
formulas (like the midpoint rule or Simpsons rule) or
Gaussian quadrature. These methods rely on a divide
and conquer strategy, whereby an integral on a relatively
large set is broken down into integrals on smaller sets.
In higher dimensions, where these methods become prohibitively expensive in terms of computational eort, one
may use Monte Carlo or quasi-Monte Carlo methods (see
Monte Carlo integration), or, in modestly large dimensions, the method of sparse grids.

Much eort has been put in the development of methods for solving systems of linear equations. Standard direct methods, i.e., methods that use some matrix decomposition are Gaussian elimination, LU decomposition,
Cholesky decomposition for symmetric (or hermitian)
and positive-denite matrix, and QR decomposition for
non-square matrices. Iterative methods such as the
Jacobi method, GaussSeidel method, successive overrelaxation and conjugate gradient method are usually preferred for large systems. General iterative methods can be
3.7
developed using a matrix splitting.
Root-nding algorithms are used to solve nonlinear equations (they are so named since a root of a function is an
argument for which the function yields zero). If the function is dierentiable and the derivative is known, then
Newtons method is a popular choice. Linearization is
another technique for solving nonlinear equations.

3.4

Dierential equations

Main articles: Numerical ordinary dierential equations


and Numerical partial dierential equations
Numerical analysis is also concerned with computing (in
an approximate way) the solution of dierential equations, both ordinary dierential equations and partial differential equations.

Solving eigenvalue or singular value Partial dierential equations are solved by rst discretizing the equation, bringing it into a nite-dimensional subproblems

Several important problems can be phrased in terms of


eigenvalue decompositions or singular value decompositions. For instance, the spectral image compression
algorithm[4] is based on the singular value decomposition.
The corresponding tool in statistics is called principal
component analysis.

space. This can be done by a nite element method, a


nite dierence method, or (particularly in engineering)
a nite volume method. The theoretical justication of
these methods often involves theorems from functional
analysis. This reduces the problem to the solution of an
algebraic equation.

4 Software
3.5

Optimization

Main article: Mathematical optimization

Main articles: List of numerical analysis software and


Comparison of numerical analysis software

Optimization problems ask for the point at which a given Since the late twentieth century, most algorithms are imfunction is maximized (or minimized). Often, the point plemented in a variety of programming languages. The
Netlib repository contains various collections of software
also has to satisfy some constraints.
The eld of optimization is further split in several sub- routines for numerical problems, mostly in Fortran and C.
elds, depending on the form of the objective function Commercial products implementing many dierent nuand the constraint. For instance, linear programming merical algorithms include the IMSL and NAG libraries;
deals with the case that both the objective function and a free alternative is the GNU Scientic Library.
the constraints are linear. A famous method in linear pro- There are several popular numerical computing applications such as MATLAB, TK Solver, S-PLUS, LabVIEW,
gramming is the simplex method.

5
and IDL as well as free and open source alternatives
such as FreeMat, Scilab, GNU Octave (similar to Matlab), IT++ (a C++ library), R (similar to S-PLUS) and
certain variants of Python. Performance varies widely:
while vector and matrix operations are usually fast, scalar
loops may vary in speed by more than an order of
magnitude.[5][6]

Higham, Nicholas J. (1996). Accuracy and Stability


of Numerical Algorithms (Society for Industrial and
Applied Mathematics, ISBN 0-89871-355-2).

Many computer algebra systems such as Mathematica


also benet from the availability of arbitrary precision
arithmetic which can provide more accurate results.

Leader, Jeery J. (2004). Numerical Analysis and


Scientic Computation. Addison Wesley. ISBN 0201-73499-0.

Also, any spreadsheet software can be used to solve simple problems relating to numerical analysis.

Wilkinson, J.H. (1965). The Algebraic Eigenvalue


Problem (Clarendon Press).

See also
Analysis of algorithms
Computational science
List of numerical analysis topics
Numerical dierentiation
Numerical Recipes
Symbolic-numeric computation

Hildebrand, F. B. (1974). Introduction to Numerical Analysis (2nd ed.). McGraw-Hill. ISBN 0-07028761-9.

Kahan, W. (1972). ""A survey of error-analysis,


in Info. Processing 71 (Proc. IFIP Congress 71
in Ljubljana), vol. 2, pp. 121439, North-Holland
Publishing, Amsterdam. (examples of the importance of accurate arithmetic).
Trefethen, Lloyd N. (2006). Numerical analysis,
20 pages. In: Timothy Gowers and June BarrowGreen (editors), Princeton Companion of Mathematics, Princeton University Press.

8 External links
Journals

Notes

[1] Photograph, illustration, and description of the root(2)


tablet from the Yale Babylonian Collection
[2] The New Zealand Qualication authority specically
mentions this skill in document 13004 version 2, dated 17
October 2003 titled CARPENTRY THEORY: Demonstrate knowledge of setting out a building
[3] This is a xed point iteration for the equationx = (x2
2)2 + x = f (x) , whose solutions include 2 . The iterates always move
Hence
to the right since f (x) x .
x1 = 1.4 < 2 converges and x1 = 1.42 > 2 diverges.
[4] The Singular Value Decomposition and Its Applications
in Image Compression
[5] Speed comparison of various number crunching packages
[6] Comparison of mathematical programs for data analysis
Stefan Steinhaus, ScienticWeb.com

Numerische Mathematik, volumes 1-66, Springer,


1959-1994 (searchable; pages are images). (English) (German)
Numerische Mathematik at SpringerLink, volumes
1-112, Springer, 19592009
SIAM Journal on Numerical Analysis, volumes 147, SIAM, 19642009
Online texts
Hazewinkel, Michiel, ed. (2001), Numerical analysis, Encyclopedia of Mathematics, Springer, ISBN
978-1-55608-010-4
Numerical Recipes, William H. Press (free, downloadable previous editions)
First Steps in Numerical Analysis (archived),
R.J.Hosking, S.Joe, D.C.Joyce, and J.C.Turner
CSEP (Computational Science Education Project),
U.S. Department of Energy

References
Online course material
Golub, Gene H. and Charles F. Van Loan (1986).
Matrix Computations, Third Edition (Johns Hopkins
University Press, ISBN 0-8018-5413-X).

Numerical Methods, Stuart Dalziel University of


Cambridge

8
Lectures on Numerical Analysis, Dennis Deturck
and Herbert S. Wilf University of Pennsylvania
Numerical methods, John D. Fenton University of
Karlsruhe
Numerical Methods for Science, Technology, Engineering and Mathematics, Autar Kaw University of
South Florida
Numerical Analysis Project, John H. Mathews
California State University, Fullerton
Numerical Methods Online Course, Aaron
Naiman Jerusalem College of Technology
Numerical Methods for Physicists, Anthony OHare
Oxford University
Lectures in Numerical Analysis (archived), R.
Radok Mahidol University
Introduction to Numerical Analysis for Engineering,
Henrik Schmidt Massachusetts Institute of Technology
Numerical Methods for time-dependent Partial Differential Equations, J.W. Haverkort, based on a
course by P.A. Zegeling Utrecht University
Numerical Analysis for Engineering, D. W. Harder
University of Waterloo

EXTERNAL LINKS

Text and image sources, contributors, and licenses

9.1

Text

Numerical analysis Source: https://en.wikipedia.org/wiki/Numerical_analysis?oldid=742265141 Contributors: Tobias Hoevekamp, The


Anome, Tarquin, Taw, Eijkhout, Michael Hardy, Dominus, Nixdorf, Zeno Gantner, Loisel, Stevan White, Jurgen~enwiki, Charles
Matthews, Dysprosia, Jitse Niesen, Taxman, Topbanana, Ldo, Rogper~enwiki, Robbot, Jaredwf, Troworld, PedroPVZ, Blainster, Bkell,
JesseW, Saforrest, Rege~enwiki, Robinh, Peter L, Tea2min, Decrypt3, Giftlite, BenFrantzDale, Lethe, Tom harrison, Fleminra, Guanaco, Matt Crypto, Gadum, APH, Bumm13, AmadeusKlocker, Fintor, Kate, PhotoBox, Zowie, Rich Farmbrough, Yuval madar, Elwikipedista~enwiki, MisterSheik, Oyz, Dungodung, Greenleaf~enwiki, Nk, Crust, Msh210, Alansohn, Arthena, Sligocki, Bugg, Aitter,
Gene Nygaard, Bookandcoee, Beliavsky, Oleg Alexandrov, Linas, David Haslam, Decrease789, KymFarnik, Graham87, Xask Linus,
Koavf, Salix alba, TeemuN, Hlangeveld, Bubba73, Arnero, Mathbot, Nihiltres, RexNL, Carrionluggage, Windharp, NevilleDNZ, Chobot,
Turidoth, Wavelength, RussBot, Hede2000, KSmrq, Chaos, Yahya Abdal-Aziz, Cat2020, Boivie, Zzuuzz, Ninly, Closedmouth, Cedar101,
Josh3580, Dontaskme, Willtron, JLaTondre, Pred, Gesslein, Xiaojeng~enwiki, Lunch, Yvwv, Sardanaphalus, A bit iy, JJL, SmackBot,
Tomchen~enwiki, Adam majewski, Jagged 85, Wygk, Hongooi, Timothy Clemans, Berland, Brianboonstra, Mlpkr, Drunken Pirate, The
undertow, Lambiam, Sina2, ExamplePuzzle, IronGargoyle, Asyndeton, Stephen B Streater, Ginkgo100, MystRivenExile, FatBastardInk,
Audiosmurf, Paul Matthews, Didimos, CRGreathouse, CBM, Vitolis, Requestion, Bocianski, Ntsimp, Mattisse, Thijs!bot, Oliver202,
Quantunity, HussainAbbas, Urdutext, BigJohnHenry, Darklilac, VictorAnyakin, Nikolas Karalis, MER-C, The Transhumanist, EagleFan, Systemlover, Khalid Mahmood, SamShearman, Gwern, Jtir, Leyo, Kawautar, Salih, Gombang, Nonphixion, JonMcLoone, Policron,
Robertgreer, CMaes, Sheliak, JohnBlackburne, Redgecko, Stephenkirkup, Antoni Barau, Jmath666, Aither~enwiki, Wolfrock, SieBot,
Un4v41l48l3, Lightmouse, Svick, Amahoney, WikipedianMarlith, SlackerMom, Justin W Smith, EXTER7, Wikijens, Tomtzigt,
,
Nostraticispeak, Unmerklich, XLinkBot, Chrismacgr, JinJian, Addbot, Wordsoup, Manuel Trujillo Berges, Fgnievinski, Ekojekoj, Metsavend, Tide rolls, Loupeter, Legobot, Yobot, KamikazeBot, 1exec1, Kingpin13, Citation bot, Happyrabbit, Isheden, Rsmn, Charvest, Gtpjg, Bekus, CES1596, FrescoBot, Steve Quinn, Gaba p, Boulaur, RedBot, Meaghan, Jauhienij, David Binner, TjBot, DSP-user, EmausBot,
Jmencisom, Bethnim, Miricium, Google Child, Christina Silverman, Darthhappyface, Shootji, Tot12, Ramiamro, Anita5192, ClueBot
NG, Satellizer, Vacation9, Snotbot, GiantReliant, 3rdiw, Widr, Helpful Pixie Bot, Enneth with a k, Ogoorcs, Solomon7968, Brad7777, BattyBot, ChrisGualtieri, Chunliang Lyu, JYBot, Shtamy, Nm160111, Drajay1976, Purnendu Karmakar, Zhangzk, LaguerreLegendre, Jarash,
Brtietz, Stormmeteo, Msalimi122, Msalimi1222, Linnet1979, Sasadd, Mateusz Konieczny, KasparBot, Herobeaner and Anonymous: 196

9.2

Images

File:Folder_Hexagonal_Icon.svg Source: https://upload.wikimedia.org/wikipedia/en/4/48/Folder_Hexagonal_Icon.svg License: Cc-bysa-3.0 Contributors: ? Original artist: ?


File:Internet_map_1024.jpg Source: https://upload.wikimedia.org/wikipedia/commons/d/d2/Internet_map_1024.jpg License: CC BY
2.5 Contributors: Originally from the English Wikipedia; description page is/was here. Original artist: The Opte Project
File:LemonadeJuly2006.JPG Source: https://upload.wikimedia.org/wikipedia/commons/2/28/LemonadeJuly2006.JPG License: CCBY-SA-3.0 Contributors: ? Original artist: ?
File:Linear-regression.svg Source: https://upload.wikimedia.org/wikipedia/commons/1/12/Linear-regression.svg License: Public domain Contributors: Own work Original artist: Qef
File:Portal-puzzle.svg Source: https://upload.wikimedia.org/wikipedia/en/f/fd/Portal-puzzle.svg License: Public domain Contributors: ?
Original artist: ?
File:Schumacher_(Ferrari)_in_practice_at_USGP_2005.jpg Source:
https://upload.wikimedia.org/wikipedia/commons/9/9d/
Schumacher_%28Ferrari%29_in_practice_at_USGP_2005.jpg License: CC BY-SA 2.0 Contributors: ? Original artist: ?
File:Text_document_with_red_question_mark.svg Source: https://upload.wikimedia.org/wikipedia/commons/a/a4/Text_document_
with_red_question_mark.svg License: Public domain Contributors: Created by bdesham with Inkscape; based upon Text-x-generic.svg
from the Tango project. Original artist: Benjamin D. Esham (bdesham)
File:Wikibooks-logo.svg Source: https://upload.wikimedia.org/wikipedia/commons/f/fa/Wikibooks-logo.svg License: CC BY-SA 3.0
Contributors: Own work Original artist: User:Bastique, User:Ramac et al.
File:Wikiquote-logo.svg Source: https://upload.wikimedia.org/wikipedia/commons/f/fa/Wikiquote-logo.svg License: Public domain
Contributors: Own work Original artist: Rei-artur
File:Wind-particle.png Source: https://upload.wikimedia.org/wikipedia/commons/e/ef/Wind-particle.png License: Public domain Contributors: http://en.wikipedia.org/wiki/File:Wind-particle.png Original artist: Loisel
File:Ybc7289-bw.jpg Source: https://upload.wikimedia.org/wikipedia/commons/0/0b/Ybc7289-bw.jpg License: CC BY 2.5 Contributors: Own work Original artist: Bill Casselman

9.3

Content license

Creative Commons Attribution-Share Alike 3.0

You might also like