Numerical Analysis is concerned with the construction and analysis of algorithms to solve a mathematically posed problem on a computer so as to generate a numerical answer. This is necessary because most mathematical equations do not have closed form solutions that can be easily evaluated. Even in cases where a closed form solution exists, it may be necessary to resort to a computer to obtain a numerical answer. The mathematical problems that we want to solve numerically arise from science and engineering, where a physical system is modeled mathematically in terms of equations. These equations may be algebraic, ordinary or partial differential equations, or a combination of these. Their solutions are functions in one or many variables, e.g., space and/or time. We assume that space and time are a continuum and use real numbers to represent them. However, the real numbers form an infinite set and we cannot hope to represent them in a computer which has finite memory and resources. On a computer, real numbers are approximated by a finite set of floating point numbers.
Example: Approximation of functions¶
A general function has an infinite amount of information which we cannot represent on a computer. For most applications it is enough to obtain an approximation to the function.
Given a function we want to find a function where is finite dimensional, such that
The norm is usually maximum norm or norm, leading to uniform approximation and least squares approximation.
The above kind of approximation requires knowledge of the full function which may not be available. We can sample the function at a set of discrete points
and construct an approximation to , for example by interpolation
Usually is a polynomial of some specified degree since these are easy to evaluate on a computer. The approximation is something we can represent in a computer because it has finite amount of information, and we can evaluate it at some unknown and hope that . As we let , we hope that in some suitable norm.
Interpolation tries to exactly match the approximation to the true value, which may not be a good idea if the data contains noise. Instead of interpolation, we can perform a least squares fit
Some typical questions to ask:
- How to choose the spaces ? For interpolation this includes the choice of the nodes. Polynomials, rational polynomials and trigonometric functions are the most common choices for the function spaces.
- What is the error ?
Example: Differential equations¶
In many problems, the function that we seek may be unknown and it may be the solution of some differential equation: find such that
where is a differential operator and is some infinite dimensional function space. Such a problem is replaced by a finite dimensional problem: find such that
where is a finite dimensional space of functions and is an approximation of the differential operator . The space can be constructed by an interpolation process as in the previous example. We would like to show that as .
As an example consider
with boundary conditions
In the finite difference method, we divide the domain with grid points , , and replace derivatives with finite differences
This is a system of linear equations which can be put in matrix form
where is a tri-diagonal matrix. The numerical solution of differential equations can thus lead to matrix equations.
Example: Roots, matrix equations¶
Suppose we want to find the roots of a function , i.e., find such that . Or we may want to find the solution of where is a matrix and is an -vector. Usually such problems arise as a consequence trying to numerically solve a differential equation, e.g., for a linear PDE we may end up with
where is the set of function values at the distinct nodes. To solve such problems we construct algorithms which are iterative in nature, i.e., given an initial guess , the algorithm updates it in a series of steps,
and we hope that as we approach closer to the solution, i.e., . Note that the solution is a fixed point of .
For solving matrix equations, we can also employ direct methods like Gaussian elimination which give the answer in a finite number of steps. However such methods may be limited to small problem sizes.
Example: Integration¶
Given a function , we want to compute a numerical value of the integral
We will construct an approximation of the form
where is an integer, are some quadrature weights and are corresponding nodes. Typical questions to ask are:
- What is the error in the approximation ?
- Given , how to choose the weights and nodes to get the best possible approximation ?
Aims of Numerical Analysis¶
Numerical Analysis is concerned with constructing algorithms to solve such problems and further we would like to analyze these algorithms in terms of the following questions.
Accuracy: How well does the numerical solution approximate the exact solution ?
Convergence: As we refine the discretization, does the approximation converge to the true solution ? In case of iterative methods, do the iterations converge ?
Convergence rate, efficiency: How fast does it converge ? E.g., we may have
or better still
For iterative scheme, we would like
with α as small as possible, or better still
with as large as possible. Both of these properties will imply convergence of the iterations.
Stability: Is the numerical algorithm stable ? If we change the data by a small amount, we hope that the answer given by the algorithm changes by a small amount.
Backward stability: Show that the approximate solution to some problem, is the exact solution of a nearby problem. E.g., if is an approximate solution to , show that it is the exact solution to where is small.
Algorithms: Efficient implementation of numerical methods in a working code is very important. E.g., trigonometic interpolation would be costly if implemented in a naive way, while FFT provides a fast implementation.