Numerical analysis notes
Lorenzo Sostegni
Contents
- Foundations of numerical mathematics
- Polynomial approximation of functions and data
- Numerical linear algebra
- Ordinary differential equations
- Nonlinear equations
Foundations of numerical mathematics
1. Definition of mathematical problem
Let D be the set of input data for the model and let V be the set of solutions. Let D and V be vector spaces. The mathematical problem reads: given d ∈ D, find x ∈ V such that F(x, d) = 0. The mapping F defined as F: V × D → Y, (x, d) ↦ F(x, d), is referred to as the mathematical problem.
2. Well-posedness of the mathematical problem
The mathematical problem is said to be well-posed if:
- Existence: given any d ∈ D there exists x ∈ V such that F(x, d) = 0
- Uniqueness: given any d ∈ D, if there exist x, y ∈ V such that F(x, d) = 0 and F(y, d) = 0, then x = y
- Continuous dependence on data: given any d, d + δd and their corresponding unique solutions x, x + δx ∈ V such that F(x, d) = 0 and F(x + δx, d + δd) = 0, there exist two positive constants η and K, which may depend on d such that if ||δd|| ≤ K(d) ||δx|| ≤ η(d)||δd||, then d ∈ D.
3. Stability of the mathematical problem
The property of continuous dependence on data is also referred to as the property of stability. Indeed, the fact that the solution depends continuously on the data means that a small perturbation δd in the input data d for the model leads to a small perturbation δx in the solution x. In other words, if we change the input data only slightly, the solution will not change that much, meaning that the problem is stable.
4. Definition of numerical problem
Let Dh and Vh be finite-dimensional subspaces of D and V, respectively. The numerical problem reads: given dh ∈ Dh, find xh ∈ Vh such that Fh(xh, dh) = 0. The mapping Fh defined as Fh: Vh × Dh → Y, (xh, dh) ↦ Fh(xh, dh), is referred to as the numerical problem.
5. Well-posedness of the numerical problem
The numerical problem is said to be well-posed if:
- Existence: given any dh ∈ Dh, there exists xh ∈ Vh such that Fh(xh, dh) = 0
- Uniqueness: given any dh ∈ Dh, if there exist xh, yh ∈ Vh such that Fh(xh, dh) = 0 and Fh(yh, dh) = 0, then xh = yh
- Continuous dependence on data: given any dh, dh + δdh and their corresponding unique solutions xh, xh + δxh ∈ Vh such that Fh(xh, dh) = 0 and Fh(xh + δxh, dh + δdh) = 0, there exist two positive constants ηh and Kh, which may depend on dh such that if ||δdh|| ≤ Kh(dh) ||δxh|| ≤ ηh(dh)||δdh||, then dh ∈ Dh.
6. Residual
The residual associated with the numerical model is defined as: R(x, d) := F(x, d) - Fh(x, d).
7. Consistency of the numerical model
The numerical model is said to be consistent if limh→0 dh = d or equivalently limh→0 Rh(x, d) = 0. Moreover, the numerical model is said to be consistent of order p with respect to the discretization parameter h if there exists C > 0 independent of h and p > 0 such that ||Rh(x, d)|| ≤ C hp.
8. Definition of the discretization error
The error eh := x - xh is called the discretization error. Assume that there exists a positive constant C independent of h and a positive real number p such that ||eh|| ≤ C hp. In such a case, we say that xh converges to x with order p with respect to h. Using a bilogarithmic scale, we can see that log(||eh||)V = log(C) + p log(h): the slope of the line gives us the order of convergence.
9. Absolute and relative errors
Absolute error: Eabs(xh) := ||x - xh||V Relative error: Erel(xh) := ||x - xh||V / ||x||V
10. Equivalence theorem (Lax-Richtmyer)
The numerical problem is convergent with respect to the discretization parameter h if and only if it is stable and consistent. Stability + Consistency ⇔ Convergence.
11. Machine epsilon
The machine epsilon is the smallest floating point number such that 1 + εM > 1. In our computers β = 2 and t = 53, so we have: εM = β(1-t) = 2-53 ≈ 2.2204 × 10-16.
12. Forward, backward and centered finite differences
Forward difference: y'(t̄) ≈ (y(t̄ + h) - y(t̄)) / h Backward difference: y'(t̄) ≈ (y(t̄) - y(t̄ - h)) / h Centered difference: y'(t̄) ≈ (y(t̄ + h) - y(t̄ - h)) / (2h)
Polynomial approximation of functions and data
1. Global polynomial interpolation
In order to interpolate our function f(x): [a, b] → R, we need to select a polynomial y(x) ∈ Pn. The domain is divided in M subintervals, individuated by n + 1 distinct nodes. We need to satisfy:
a₀ + a₁x₀ + a₂x₀² + ... + anx₀n = y₀
a₀ + a₁x₁ + a₂x₁² + ... + anx₁n = y₁
...
a₀ + a₁xₙ + a₂xₙ² + ... + anxₙn = yₙ
This system can be also seen as:
X · a = y
Where the matrix X is called Vandermonde matrix, the vector a is the unknown datum and the vector y is the given datum. In order to solve this linear system, we need the Vandermonde matrix to be non-singular, and this always holds since we have n + 1 distinct nodes. We can collect the interpolating polynomial coefficients by simply computing a = X-1 y.
2. A priori interpolation error estimate
For any x ∈ [a, b] the interpolation error is defined as Enf(x) := f(x) - Πnf(x).
||Enf||C([a,b]) ≤ (||f(n+1)||C([a,b]) / (n + 1)!) * ||ωn+1||C([a,b])
Where ωn+1(x) = (x-x₀)(x-x₁)...(x-xn) is the nodal polynomial.
3. Convergence of the interpolation
We say that Πnf converges uniformly if limn→∞ Πnf(x) = f(x) ∀x ∈ [a, b], in other words, limn→∞ Enf(x) = 0.
limn→∞ ||Enf||C([a,b]) = 0 if ωn+1(x) = 0 for all x ∈ [a, b].
4. Chebyshev's nodes
In this particular case, the domain is divided into subdomains of different lengths and in particular every node abscissa is expressed as:
x(x̄) = A x̄ + B cos(πi/n)
In this way, we have very tiny intervals at the edges of the domain and we reduce the interpolation error.
5. Piecewise polynomial interpolation
To construct the method, we introduce a partition τh of [a, b] into M intervals. We denote by hi = xi+1 - xi the length of each interval and set h = max(hi). We associate with τh the following space of piecewise polynomials:
Xhr(τh) := {v ∈ C([a,b]) | v|Ki ∈ Pr(Ki) ∀Ki ∈ τh}
dim(Xhr) = rM + 1 is usually referred to as the finite element space of degree r associated with τh.
6. A priori piecewise interpolation error estimate
Let us assume that f ∈ Cr+1([a,b]), r ≥ 1. Then there exists a positive constant C independent of h such that:
||Ehf||C([a,b]) ≤ C ||f(r+1)||C([a,b]) hr+1
7. Lagrange polynomials
Lagrange polynomials are in the form:
Li(x) = Πj=0, j≠i^n (x - xj) / (xi - xj)
Using these particular polynomials, we can interpolate our function with the following formula:
Πn(x) = Σi=0^n yi Li(x)
8. Least-squares approximation
We want to find a polynomial p(x) such that:
Σi=0^m (yi - p(xi))2 = min
The polynomial is found in the following way for p(x) = c0 + c1x:
c0 + c1x0 = y0
c0 + c1x1 = y1
...
c0 + c1xm = ym
In algebraic terms:
XTX · c = XTy
To solve this system, we multiply both terms by XT and we obtain c = (XTX)-1XTy.
9. Quadrature rules
The error we make with quadrature rule is equal to:
|E(f)| ≤ Ck hr+1 ||f(r+1)||C([a,b])
Midpoint Quadrature Rule: Qi0,k(f) = f(x̄i)h E(f) = (h³/24)f''(ξi)
Trapezoidal Quadrature Rule: Qi1,k(f) = [f(xi) + f(xi+1)]h/2 E(f) = -(h³/12)f''(ηi)
Gauss-Legendre Quadrature Rule: xGL,1 = x̄i - √(3/2)h, xGL,2 = x̄i + √(3/2)h QGL,1,k(f) = (f(xGL,1) + f(xGL,2))h/2 |E(f)| = C(4)(x) h5 ||f||C(k)
Cavalieri-Simpson Quadrature Rule: Qi2,k(f) = (f(xi) + 4f(x̄i) + f(xi+1))h/6
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.
-
Numerical Analysis
-
Appunti di Numerical Analysis
-
Project 2, Numerical Analysis
-
Appunti di "Numerical Analysis for Partial Differential Equations"