| exports | kernelspec | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
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.
+++
A general function
Given a function
The norm is usually maximum norm or
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
and construct an approximation
The approximation
Interpolation tries to exactly match the approximation to the given value, which may not be a good idea if the data contains noise. Instead of interpolation, we can perform a least squares fit
:::{note} Some typical questions to ask
- How to choose the spaces
$V_n$ ? 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
$| f - f_n |$ ? :::
+++
In many problems, the function that we seek may be unknown and it may be the solution of some differential equation: find
where
where
As an example consider
with boundary conditions
In the finite difference method, we divide the domain with grid points
$$ u_0 &= 0 \
- \frac{u_{i-1} - 2u_i + u_{i+1}}{h^2} &= f_i, \qquad 1 \le i \le n-2 \ u_{n-1} &= 0 $$
This is a system of linear equations which can be put in matrix form
where
:::{note} Some questions
- Does the discrete solution
$U$ exists ? - How to find it ?
- What is the error
$|U - U_{exact}|$ ? :::
+++
Suppose we want to
- find the roots of a function
$f : \re^n \to \re^n$ , i.e., find$r \in \re^n$ such that$f(r) = 0$ . - find the solution of
$Ax=b$ where$A$ is a$n \times n$ matrix and$b$ is an$n$ -vector.
Usually such problems arise as a consequence of trying to numerically solve a differential equation, e.g., for a linear PDE we may end up with
where
and we hope that as
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.
:::{note} Some questions
- Do the iterations converge ?
- How fast do they converge ? :::
Given a function
We will construct an approximation of the form
where
:::{note} Some questions
- What is the error in the approximation
$I(f) - I_n(f)$ ? - Given
$n$ , how to choose the weights and nodes to get the best possible approximation ? :::
+++
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
with
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
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.
:::{seealso}