Skip to article frontmatterSkip to article content

Introduction

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 f:[a,b]Rf : [a,b] \to \re 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 fVf \in V we want to find a function fnVnf_n \in V_n where VnV_n is finite dimensional, such that

ffn=infgVnfg\| f - f_n \| = \inf_{g \in V_n} \| f - g \|

The norm is usually maximum norm or L2L^2 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 nn discrete points

a=x0<x1<<xn1=ba=x_0 < x_1 < \ldots < x_{n-1} = b

and construct an approximation fn(x)f_n(x) to f(x)f(x), for example by interpolation

fn(xi)=f(xi),i=0,1,,n1f_n(x_i) = f(x_i), \qquad i=0,1,\ldots,n-1

Usually fnVnf_n \in V_n is a polynomial of some specified degree since these are easy to evaluate on a computer. The approximation fnf_n is something we can represent in a computer because it has finite amount of information, and we can evaluate it at some unknown xx and hope that fn(x)f(x)f_n(x) \approx f(x). As we let nn \to \infty, we hope that fnff_n \to f 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

ffnn=mingVnfgn,ffnn2=i=0n1[f(xi)fn(xi)]2\|f - f_n\|_n = \min_{g \in V_n} \| f - g \|_n, \quad \| f - f_n \|_n^2 = \sum_{i=0} ^{n-1}[ f(x_i) - f_n(x_i)]^2

Some typical questions to ask:

  1. How to choose the spaces VnV_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.
  2. What is the error ffn\| f - f_n \| ?

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 fVf \in V such that

L(f)=0L(f) = 0

where LL is a differential operator and VV is some infinite dimensional function space. Such a problem is replaced by a finite dimensional problem: find fnVnf_n \in V_n such that

Ln(fn)=0L_n(f_n) = 0

where VnV_n is a finite dimensional space of functions and LnL_n is an approximation of the differential operator LL. The space VnV_n can be constructed by an interpolation process as in the previous example. We would like to show that fnff_n \to f as nn \to \infty.

As an example consider

u(x)=f(x),x(0,1)-u''(x) = f(x), \qquad x \in (0,1)

with boundary conditions

u(0)=u(1)=0u(0) = u(1) = 0

In the finite difference method, we divide the domain with grid points xi=ihx_i = ih, i=0,1,,n1i=0,1,\ldots,n-1, h=1/(n1)h = 1/(n-1) and replace derivatives with finite differences

u0=0ui12ui+ui+1h2=fi,1in2un1=0\begin{align*} 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 \end{align*}

This is a system of linear equations which can be put in matrix form

AU=bAU = b

where AA 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 f:RnRnf : \re^n \to \re^n, i.e., find rRnr \in \re^n such that f(r)=0f(r) = 0. Or we may want to find the solution of Ax=bAx=b where AA is a n×nn \times n matrix and bb is an nn-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

Ln(fn)=AFb=0L_n(f_n) = A F - b = 0

where FRnF \in \re^n is the set of function values at the nn distinct nodes. To solve such problems we construct algorithms which are iterative in nature, i.e., given an initial guess F0F^0, the algorithm updates it in a series of steps,

Fk+1=H(Fk),k=0,1,2,F^{k+1} = H(F^k), \qquad k=0,1,2,\ldots

and we hope that as kk \to \infty we approach closer to the solution, i.e., FkF=A1bF^k \to F = A^{-1}b. Note that the solution is a fixed point of HH.

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 f:[a,b]Rf : [a,b] \to \re, we want to compute a numerical value of the integral

I(f)=abf(x)dxI(f) = \int_a^b f(x) dx

We will construct an approximation of the form

In(f)=j=0n1wjf(xj)I_n(f) = \sum_{j=0}^{n-1} w_j f(x_j)

where nn is an integer, wjw_j are some quadrature weights and xjx_j are corresponding nodes. Typical questions to ask are:

  1. What is the error in the approximation I(f)In(f)I(f) - I_n(f) ?
  2. Given nn, 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

fnfCnα,α>0\| f_n - f \| \le C n^{-\alpha}, \qquad \alpha > 0

or better still

fnfCexp(αn),α>0\| f_n - f \| \le C \exp(-\alpha n), \qquad \alpha > 0

For iterative scheme, we would like

Fk+1FαFkF,0<α<1\| F^{k+1} - F \| \le \alpha \| F^k - F \|, \qquad 0 < \alpha < 1

with α as small as possible, or better still

Fk+1FαFkFp,α>0,p>1\| F^{k+1} - F \| \le \alpha \| F^k - F \|^p, \qquad \alpha > 0, \quad p > 1

with pp 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 xx^* is an approximate solution to Ax=bAx=b, show that it is the exact solution to (A+E)x=b(A+E)x=b where EE 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.