numerical analysis babylonian clay tablet ybc 7289 c 18001600 bc with annotations the approximation of the square root of 2 is four sexagesimal figures which is about six decimal figures 1 2460 51602 10603 141421296 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 numerical analysis naturally finds application in all fields of engineering and the physical sciences but in the 21stcentury also the life sciences social sciences medicine business and even the arts have adopted elements of scientific computations as an aspect of mathematics and computer science that generates analyzes and implements algorithms the growth in power and the revolution in computing has raised the use of realistic mathematical models in science and engineering and complex numerical analysis is required to provide solutions to these more involved models of the world ordinary differential equations appear in celestial mechanics planets stars and galaxies numerical linear algebra is important for data analysis stochastic differential equations and markov chains are essential in simulating living cells for medicine and biology 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 differential equations one of the earliest mathematical writings is a babylonian tablet from the yale babylonian collection ybc 7289 which gives a sexagesimal numerical approximation of the square root 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 numerical analysis continues this long tradition of practical mathematical calculations much like the babylonian approximation of the square root 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 general introduction the overall goal of the field 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 computing the trajectory of a spacecraft requires the accurate numerical solution of a system of ordinary differential equations car companies can improve the crash safety of their vehicles by using computer simulations of car crashes such simulations essentially consist of solving partial differential equations numerically hedge funds private investment funds use tools from all fields 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 field of operations research insurance companies use numerical programs for actuarial analysis the rest of this section outlines several important themes of numerical analysis history the field of numerical analysis predates the invention of modern computers by many centuries linear interpolation was already in use more than 2000 years ago many great mathematicians of the past were preoccupied by numerical analysis as is obvious from the names of important algorithms like newtons method lagrange interpolation polynomial gaussian elimination or eulers method to facilitate computations by hand large books were produced with formulas and tables of data such as interpolation points and function coefficients using these tables often calculated out to 16 decimal places or more for some functions one could look up values to plug into the formulas given and achieve very good numerical estimates of some functions the canonical work in the field is the nist publication edited by abramowitz and stegun a 1000plus 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 useful when a computer is available but the large listing 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 influenced the field of numerical analysis since now longer and more complicated calculations could be done direct and iterative methods direct vs iterative methods consider the problem of solving 3x3 4 28 for the unknown quantity x direct method 3x3 4 28 subtract 4 3x3 24 divide by 3 x3 8 take cube roots x 2 for the iterative method apply the bisection method to fx 3x3 24 the initial values are a 0 b 3 fa 24 fb 57 iterative method a b mid fmid 0 3 15 13875 15 3 225 1017 15 225 1875 422 1875 225 20625 232 we conclude from this table that the solution is between 1875 and 20625 the algorithm might return any number in that range with an error less than 02 discretization and numerical integration in a twohour race we have measured the speed of the car at three instants and recorded them in the following table time 020 100 140 kmh 140 150 180 a discretization would be to say that the speed of the car was constant from 000 to 040 then from 040 to 120 and finally from 120 to 200 for instance the total distance traveled in the first 40 minutes is approximately 700372000000000000023h7001388888888888888140kmh7004933000000000000933km this would allow us to estimate the total distance traveled as 7004933000000000000933km 7005100000000000000100km 7005120000000000000120km 70053133000000000003133km which is an example of numerical integration see below using a riemann sum because displacement is the integral of velocity illconditioned problem take the function fx 1x1 note that f11 10 and f1001 1000 a change in x of less than 01 turns into a change in fx of nearly 1000 evaluating fx near x 1 is an illconditioned problem wellconditioned problem by contrast evaluating the same function fx 1x1 near x 10 is a wellconditioned problem for instance f10 19 0111 and f11 01 a modest change in x leads to a modest change in fx direct methods compute the solution to a problem in a finite number of steps these methods would give the precise answer if they were performed in infinite 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 finite 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 finite 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 specified in order to decide when a sufficiently accurate solution has hopefully been found even using infinite precision arithmetic these methods would not reach the solution within a finite 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 eg 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 same manner as for an iterative method discretization furthermore continuous problems must sometimes be replaced by a discrete problem whose solution is known to approximate that of the continuous problem this process is called discretization for example the solution of a differential equation is a function this function must be represented by a finite amount of data for instance by its value at a finite number of points at its domain even though this domain is a continuum generation and propagation of errors 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 roundoff roundoff errors arise because it is impossible to represent all real numbers exactly on a machine with finite memory which is what all practical digital computers are truncation and discretization error truncation errors are committed when an iterative method is terminated or a mathematical procedure is approximated and the approximate solution differs 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 3 x 3 4 28 displaystyle 3x3428 after 10 or so iterations we conclude that the root is roughly 199 for example we therefore have a truncation error of 001 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 a b c d e displaystyle abcde 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 find the sum of infinite trapezoids but numerically one can find the sum of only finite trapezoids and hence the approximation of the mathematical procedure similarly to differentiate a function the differential element approaches zero but numerically we can only choose a finite value of the differential element numerical stability and wellposed 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 wellconditioned 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 wellconditioned andor illconditioned and any combination is possible so an algorithm that solves a wellconditioned problem may be either numerically stable or numerically unstable an art of numerical analysis is to find a stable algorithm for solving a wellposed mathematical problem for instance computing the square root of 2 which is roughly 141421 is a wellposed problem many algorithms solve this problem by starting with an initial approximation x0 to 2 displaystyle sqrt 2 for instance x0 14 and then computing improved guesses x1 x2 etc one such method is the famous babylonian method which is given by xk1 xk2 1xk another method which we will call method x is given by xk1 xk2 22 xk we have calculated a few iterations of each scheme in table form below with initial guesses x0 14 and x0 142 babylonian babylonian method x method x x0 14 x0 142 x0 14 x0 142 x1 14142857 x1 141422535 x1 14016 x1 142026896 x2 1414213564 x2 141421356242 x2 14028614 x2 142056 x1000000 141421 x27 72802284 observe that the babylonian method converges quickly regardless of the initial guess whereas method x converges extremely slowly with initial guess x0 14 and diverges for initial guess x0 142 hence the babylonian method is numerically stable while method x is numerically unstable numerical stability is affected by the number of the significant digits the machine keeps on if we use a machine that keeps only the four most significant decimal digits a good example on loss of significance is given by these two equivalent functions f x x x 1 x and g x x x 1 x displaystyle fxxleftsqrt x1sqrt xrighttext and gxfrac xsqrt x1sqrt x if we compare the results of f 500 500 501 500 500 2238 2236 500 002 10 displaystyle f500500leftsqrt 501sqrt 500right500left22382236right50000210 and g 500 500 501 500 500 2238 2236 500 4474 1117 displaystyle beginalignedat3g500frac 500sqrt 501sqrt 500frac 50022382236frac 50044741117endalignedat by looking to the two results above we realize that loss of significance caused here by catastrophic cancelation has a huge effect on the results even though both functions are equivalent as shown below f x x x 1 x x x 1 x x 1 x x 1 x x x 1 2 x 2 x 1 x x x 1 x x 1 x x 1 x 1 x x x 1 x g x displaystyle beginalignedat4fxxleftsqrt x1sqrt xrightxleftsqrt x1sqrt xrightfrac sqrt x1sqrt xsqrt x1sqrt xxfrac sqrt x12sqrt x2sqrt x1sqrt xxfrac x1xsqrt x1sqrt xxfrac 1sqrt x1sqrt xfrac xsqrt x1sqrt xgxendalignedat the desired value computed using infinite precision is 11174755 the example is a modification of one taken from mathew numerical methods using matlab 3rd ed areas of study the field of numerical analysis includes many subdisciplines some of the major ones are computing values of functions interpolation we have observed the temperature to vary from 20 degrees celsius at 100 to 14 degrees at 300 a linear interpolation of this data would conclude that it was 17 degrees at 200 and 185 degrees at 130pm extrapolation if the gross domestic product of a country has been growing an average of 5 per year and was 100 billion dollars last year we might extrapolate that it will be 105 billion dollars this year regression in linear regression given n points we compute a line that passes as close as possible to those n points optimization say you sell lemonade at a lemonade stand and notice that at 1 you can sell 197 glasses of lemonade per day and that for each increase of 001 you will sell one glass of lemonade less per day if you could charge 1485 you would maximize your profit but due to the constraint of having to charge a whole cent amount charging 148 or 149 per glass will both yield the maximum income of 22052 per day differential equation if you set up 100 fans to blow air from one end of the room to the other and then you drop a feather into the wind what happens the feather will follow the air currents which may be very complex one approximation is to measure the speed at which the air is blowing near the feather every second and advance the simulated feather as if it were moving in a straight line at that same speed for one second before measuring the wind speed again this is called the euler method for solving an ordinary differential equation one of the simplest problems is the evaluation of a function at a given point the most straightforward approach of just plugging in the number in the formula is sometimes not very efficient 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 roundoff errors arising from the use of floating point arithmetic interpolation extrapolation and regression interpolation solves the following problem given the value of some unknown function at a number of points what value does that function have at some other point between the given points extrapolation is very similar to interpolation except that now we want to find the value of the unknown function at a point which is outside the given points regression is also similar but it takes into account that the data is imprecise given some points and a measurement of the value of some function at these points with an error we want to determine the unknown function the least squaresmethod is one popular way to achieve this solving equations and systems of equations 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 2 x 5 3 displaystyle 2x53 is linear while 2 x 2 5 3 displaystyle 2x253 is not much effort has been put in the development of methods for solving systems of linear equations standard direct methods ie methods that use some matrix decomposition are gaussian elimination lu decomposition cholesky decomposition for symmetric or hermitian and positivedefinite matrix and qr decomposition for nonsquare 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 developed using a matrix splitting rootfinding 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 differentiable and the derivative is known then newtons method is a popular choice linearization is another technique for solving nonlinear equations solving eigenvalue or singular value problems several important problems can be phrased in terms of eigenvalue decompositions or singular value decompositions for instance the spectral image compression algorithm is based on the singular value decomposition the corresponding tool in statistics is called principal component analysis optimization mathematical optimization optimization problems ask for the point at which a given function is maximized or minimized often the point also has to satisfy some constraints the field of optimization is further split in several subfields depending on the form of the objective function and the constraint for instance linear programming deals with the case that both the objective function and the constraints are linear a famous method in linear programming is the simplex method the method of lagrange multipliers can be used to reduce optimization problems with constraints to unconstrained optimization problems evaluating integrals numerical integration numerical integration in some instances also known as numerical quadrature asks for the value of a definite 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 effort one may use monte carlo or quasimonte carlo methods see monte carlo integration or in modestly large dimensions the method of sparse grids differential equations numerical ordinary differential equations and numerical partial differential equations numerical analysis is also concerned with computing in an approximate way the solution of differential equations both ordinary differential equations and partial differential equations partial differential equations are solved by first discretizing the equation bringing it into a finitedimensional subspace this can be done by a finite element method a finite difference method or particularly in engineering a finite volume method the theoretical justification of these methods often involves theorems from functional analysis this reduces the problem to the solution of an algebraic equation software list of numerical analysis software and comparison of numerical analysis software since the late twentieth century most algorithms are implemented in a variety of programming languages the netlib repository contains various collections of software routines for numerical problems mostly in fortran and c commercial products implementing many different numerical algorithms include the imsl and nag libraries a freesoftware alternative is the gnu scientific library there are several popular numerical computing applications such as matlab tk solver splus and idl as well as free and open source alternatives such as freemat scilab gnu octave similar to matlab and it a c library there are also programming languages such as r similar to splus and python with libraries such as numpy scipy and sympy performance varies widely while vector and matrix operations are usually fast scalar loops may vary in speed by more than an order of magnitude many computer algebra systems such as mathematica also benefit from the availability of arbitrary precision arithmetic which can provide more accurate results also any spreadsheet software can be used to solve simple problems relating to numerical analysis analysis of algorithms computational science interval arithmetic list of numerical analysis topics numerical differentiation numerical recipes symbolicnumeric computation notes golub gene h and charles f van loan 1986 matrix computations third ed johns hopkins university press isbn080185413x higham nicholas j 1996 accuracy and stability of numerical algorithms society for industrial and applied mathematics isbn0898713552 hildebrand f b 1974 introduction to numerical analysis 2nd ed mcgrawhill isbn0070287619 leader jeffery j 2004 numerical analysis and scientific computation addison wesley isbn0201734990 wilkinson jh 1965 the algebraic eigenvalue problem clarendon press kahan w 1972 a survey of erroranalysis in info processing 71 proc ifip congress 71 in ljubljana vol 2 pp 121439 northholland 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 numerical analysisat wikipedias sister projects media from wikimedia commons quotations from wikiquote textbooks from wikibooks journals numerische mathematik volumes 166 springer 19591994 searchable pages are images in english in german numerische mathematik at springerlink volumes 1112 springer 19592009 siam journal on numerical analysis volumes 147 siam 19642009 online texts hazewinkel michiel ed 2001 numerical analysis encyclopedia of mathematics springer sciencebusiness media bv kluwer academic publishers isbn9781556080104 numerical recipes william h press free downloadable previous editions first steps in numerical analysis archived rjhosking sjoe dcjoyce and jcturner csep computational science education project us department of energy online course material numerical methods stuart dalziel university of cambridge lectures on numerical analysis dennis deturck and herbert s wilf university of pennsylvania numerical methods john d fenton university of karlsruhe 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 analysis for engineering d w harder university of waterloo vteareas of mathematics outline topic lists branchesalgebra linear multilinear abstract elementary arithmetic number theory calculus analysis differential equations dynamical systems numerical analysis optimization functional analysis geometry discrete algebraic analytic differential finite topology trigonometry foundations philosophy of mathematics mathematical logic set theory category theory applied mathematical physics probability mathematical statistics statistics game theory information theory computer science computation control theory others history of mathematics recreational mathematics mathematics and art mathematics education order theory graph theory divisions pure applied discrete computational category portal commons wikiproject vtebranches of physicsdivisions theoretical phenomenology computational experimental applied classicalclassical mechanics acoustics ballistics continuum fluid solid hamiltonian lagrangian electrodynamics electrostatics magnetostatics plasma physics statistical mechanics thermodynamics condensed matter materials mesoscopic polymers soft solidstate moderncosmology astrophysics nuclear celestial mechanics solar heliophysics space physics relativity general special particle physics accelerator astroparticle nuclear quantum chromodynamics quantum mechanics quantum electrodynamics quantum field theory quantum gravity atomic molecularand optical physics atomic physics molecular physics optics photonics quantum optics interdisciplinary agrophysics biophysics medical neurophysics engineering geophysics atmospheric cloud mathematical physical chemistry chemical physics quantum computing social physics econophysics see also history of physics nobel prize in physics timeline of physics discoveries theory of everything vtemajor fields of computer sciencenote this template roughly follows the 2012 acm computing classification systemhardware printed circuit board peripheral integrated circuit very large scale integration systems on chip socs energy consumption green computing electronic design automation hardware acceleration computer systemsorganization computer architecture embedded system realtime computing dependability networks network architecture network protocol network components network scheduler network performance evaluation network service software organization interpreter middleware virtual machine operating system software quality software notationsand tools programming paradigm programming language compiler domainspecific language modeling language software framework integrated development environment software configuration management software library software repository software development software development process requirements analysis software design software construction software deployment software maintenance programming team opensource model theory of computation model of computation formal language automata theory computational complexity theory logic semantics algorithms algorithm design analysis of algorithms algorithmic efficiency randomized algorithm computational geometry mathematicsof computing discrete mathematics probability statistics mathematical software information theory mathematical analysis numerical analysis informationsystems database management system information storage systems enterprise information system social information systems geographic information system decision support system process control system multimedia information system data mining digital library computing platform digital marketing world wide web information retrieval security cryptography formal methods security services intrusion detection system hardware security network security information security application security humancomputerinteraction interaction design social computing ubiquitous computing visualization accessibility concurrency concurrent computing parallel computing distributed computing multithreading multiprocessing artificialintelligence natural language processing knowledge representation and reasoning computer vision automated planning and scheduling search methodology control method philosophy of artificial intelligence distributed artificial intelligence machine learning supervised learning unsupervised learning reinforcement learning multitask learning crossvalidation graphics animation rendering image manipulation graphics processing unit mixed reality virtual reality image compression solid modeling appliedcomputing ecommerce enterprise software computational mathematics computational physics computational chemistry computational biology computational social science computational engineering computational healthcare digital art electronic publishing cyberwarfare electronic voting video games word processing operations research educational technology document management book category portal wikiproject commons authority control gnd 40428059 