PHYS 410 Finite Difference Methods Oct 19, 2000 Expected Behaviour of Finite-Difference Approximations (Convergence and Accuracy)

We have already seen that the basic “control parameter” of a typical FDA (finite-difference approximation) is the mesh-spacing, h. Fundamentally, for sensibly constructed FDA’s, we expect the error in the approximation to go to 0 as h goes to 0.

Notation and Definitions

Let

L u = f  (1)

denote a general differential system. For simplicity and concreteness, you can think of u = u(x) as a single function of one variable, but the following discussion also applies to cases in multiple independent variables (u(x, t), u(x, y, t), ⋯ etc.), as well as multiple dependent variables (u = u = [u_{1}, u_{2}, ⋯, u_{n}]). In (1), L is some differential operator (L = d^{2}/dx^{2} in the BVP example we’ve studied previously), and f is some specified function. We will generically denote an FDA of (1) by

L̂û = f̂  (2)

where û is the discrete solution, f̂ is the specified function evaluated on the finite-difference mesh, and L̂ is the finite-difference approximation to L.

Truncation Error: The truncation error, τ̂, of an FDA is defined by

τ̂ ≡ L̂u − f̂  (3)

where u satisfies the continuum system (1). We note that the form of the truncation error can always be computed (typically using Taylor series expansions) from the finite difference approximation and the differential equations—we will see an example shortly.

Order of a Finite-Difference Approximation: Assuming that the FDA is characterized by a single discretization scale, h, we say that the FDA is p-th order accurate or simply p-th order if

lim_{h→0} τ̂ = O(h^{p})  for some integer p  (4)

Solution Error: The solution error, ê, associated with an FDA is defined by

ê ≡ u − û  (5)

Relation Between Truncation Error and Solution Error

Is is common to tacitly assume that

τ̂ = O(h^{p})  implies  ê = O(h^{p})

This assumption is often warranted but it is extremely instructive to consider why it is warranted and to investigate in some detail the nature of the solution error, ê, for a simple yet representative example.

Example

Consider one of the simplest possible differential systems:

L u(x) ≡ (\frac{d}{dx} − 1) u(x) = 0 on 0 ≤ x ≤ 1 with u(0) = 1  (6)

Clearly, the unique solution of this DE is

u(x) = e^{x}.

We introduce a uniform finite-difference mesh, x_{j},

x_{j} = jh, j = 0, 1, ⋯ n − 1 where h = \frac{1}{n − 1}

and consider the following difference operators:

Δ_{+}^{x}u_{j} ≡ h^{−1} (u_{j+1} − u_{j})  (7)
μ_{+}^{x}u_{j} ≡ \frac{1}{2} (u_{j+1} + u_{j})  (8)

Now consider Taylor series expansions of u_{j} and u_{j+1} about

u_{j+ \frac{1}{2}} ≡ u(x_{j+ \frac{1}{2}} ) ≡ u (\frac{1}{2} (x_{j} + x_{j+1})) ≡ ū

We have

u_{j+1} = ū + (\frac{1}{2}h) ū′ + \frac{1}{2} (\frac{1}{2}h)^{2} ū′′ + \frac{1}{6} (\frac{1}{2}h)^{3} ū′′′ + \frac{1}{24} (\frac{1}{2}h)^{4} ū′′′′ + O(h^{5})
u_{j} = ū − (\frac{1}{2}h) ū′ + \frac{1}{2} (\frac{1}{2}h)^{2} ū′′ − \frac{1}{6} (\frac{1}{2}h)^{3} ū′′′ + \frac{1}{24} (\frac{1}{2}h)^{4} ū′′′′ + O(h^{5})

so

Δ_{+}^{x}u_{j} ≡ h^{−1} (u_{j+1} − u_{j}) = ū′ + \frac{1}{24}h^{2}ū′′′ + O(h^{4})  (9)
μ_{+}^{x}u_{j} ≡ \frac{1}{2} (u_{j+1} + u_{j}) = ū + \frac{1}{8}h^{2}ū′′ + O(h^{4})  (10)

Thus, we can identify the difference operators, Δ_{+}^{x} and μ_{+}^{x}, with (formal) power series (in h) of differential operators:

Δ_{+}^{x} ≡ \frac{d}{dx} + \frac{1}{24}h^{2} \frac{d^{3}}{dx^{3}} + O(h^{4})  (11)
μ_{+}^{x} ≡ 1 + \frac{1}{8}h^{2} \frac{d^{2}}{dx^{2}} + O(h^{4})  (12)

We now write down our FDA of (6):

(\frac{d}{dx} − 1) u(x) = 0 ⟶ (Δ_{+}^{x} − μ_{+}^{x}) u_{j} = 0  (13)

(i.e. L̂ = Δ_{+}^{x} − μ_{+}^{x}). Explicitly, we have

\frac{u_{j+1} − u_{j}}{h} = \frac{u_{j+1} + u_{j}}{2}  j = 0, 1, ⋯ n − 2  with u_{0} = u(0) = 1  (14)

Let us first consider the truncation error associated with (13,14):

τ̂ ≡ L̂u − f̂ = L̂u = (Δ_{+}^{x} − μ_{+}^{x}) u
= (\frac{d}{dx} + \frac{1}{24}h^{2} \frac{d^{3}}{dx^{3}} − 1 − \frac{1}{8}h^{2} \frac{d^{2}}{dx^{2}} + O(h^{4})) ū

= (\frac{d}{dx} − 1) ū + h^{2} (\frac{1}{24} \frac{d^{3}}{dx^{3}} − \frac{1}{8} \frac{d^{2}}{dx^{2}} ) ū + O(h^{4}) = O(h^{2})

where we have used the original differential equation (6) in the form

(\frac{d}{dx} − 1) ū = 0.

Thus, since τ̂ = O(h^{2}), our FDA is second order. Note, however, that we had to be careful about choosing the x value about which we performed our Taylor series expansions—in general we must choose the expansion point which gives the highest-order truncation error or, intuitively, the point about which the scheme is naturally “centred”. The FDA (14) is sufficiently simple (and linear) that we can solve it explicitly:

\frac{u_{j+1} − u_{j}}{h} = \frac{u_{j+1} + u_{j}}{2} ⟶ u_{j+1} = (\frac{h^{−1} + \frac{1}{2}}{h^{−1} − \frac{1}{2}} ) u_{j} = (\frac{1 + \frac{h}{2}}{1 − \frac{h}{2}} ) u_{j} ≡ ρ u_{j} where ρ ≡ \frac{1 + \frac{h}{2}}{1 − \frac{h}{2}}

Thus we have

u_{j} = ρ^{j} u_{0} = ρ^{j}  (15)

where ρ^{j} denotes the j-th power of ρ and we have used the initial condition u_{0} = 1. Now, we can write ρ^{j} as follows:

ρ^{j} = exp (j ln ρ) = exp (j (ln (1 + \frac{h}{2}) − ln (1 − \frac{h}{2}))) .

Then, using the Taylor series expansion

ln(1 + x) = x − \frac{1}{2}x^{2} + \frac{1}{3}x^{3} + O(x^{4})

we have

ln (1 + \frac{h}{2}) − ln (1 − \frac{h}{2}) = h + \frac{1}{12}h^{3} + O(h^{5})

so that

ρ^{j} = exp (jh + (jh) \frac{1}{12}h^{2} + O(h^{4})) = exp (jh) exp (jh\frac{h^{2}}{12} + O(h^{4})) = e^{x_{j}} (1 + \frac{h^{2}}{12} x_{j} + O(h^{4}))
= e^{x_{j}} + \frac{1}{12}h^{2} x_{j} e^{x_{j}} + O(h^{4})

Thus, the solution error, ê is given by

ê = u − û = −\frac{1}{12}h^{2}xe^{x} + O(h^{4}) = O(h^{2})  (16)

Note in particular, the form of the solution error; to leading order it is

h^{2} × −\frac{1}{12}xe^{x} = −h^{2} × e_{2}(x)

where e_{2}(x) is a function (\frac{1}{12}xe^{x}) with smoothness (i.e. magnitude of derivatives) comparable to the continuum solution, u(x) = e^{x}. There is another way to derive (16) which clearly illustrates the fundamental lesson concerning the errors in finite difference approximations. Let us assume that u and û are related by the asymptotic (h → 0) expansion,

û = u + h^{2} e_{2} + h^{4} e_{4} + ⋯  (17)

which we call a Richardson expansion (after L.F. Richardson, who studied such matters in the early part of this century). We start with the FDA

L̂ û = 0 ⟶ (Δ_{+}^{x} − μ_{+}^{x}) û = 0

and replace both L̂ and û by their “continuum expansions” (11,12,17):

(\frac{d}{dx} − 1 + h^{2} (\frac{1}{24} \frac{d^{3}}{dx^{3}} − \frac{1}{8} \frac{d^{2}}{dx^{2}} ) + O(h^{4})) (u + h^{2} e_{2} + O(h^{4})) = 0

We now demand that this equation vanish, order by order, in h. For the O(1) and O(h^{2}) cases we have

O(1) :  (\frac{d}{dx} − 1) u = 0 ⟶ u = e^{x}  (consistency of FDA)
O(h^{2}) :  (\frac{d}{dx} − 1) e_{2} = (\frac{1}{8} \frac{d^{2}}{dx^{2}} − \frac{1}{24} \frac{d^{3}}{dx^{3}} ) u

Thus, we see that the error function, e_{2}, itself satisfies a differential equation which is very similar in form to the original DE. Moreover, given that we know u(x) = e^{x}, we can solve this DE for e_{2}. Specifically, we have

(\frac{d}{dx} − 1) e_{2} = \frac{1}{12} e^{x} ⟶ e_{2} = \frac{1}{12}xe^{x}  (18)

and since our original assumption (17) was

û = u + h^{2} e_{2} + O(h^{4}) = u + \frac{1}{12}h^{2}xe^{x} + O(h^{4})

we get

ê ≡ u − û = −\frac{1}{12}h^{2}xe^{x} + O(h^{4})

as previously.

Comments

Even in cases where we don’t know the continuum solution (this clearly includes most of the interesting instances where we are likely to apply finite-difference techniques), it is still very useful to think of difference operators and difference solutions in terms of asymptotic expansions in powers of the mesh spacing, h:

L̂ = L + h^{2} L_{2} + h^{4} L_{4} + O(h^{6})
û = u + h^{2} e_{2} + h^{4} e_{4} + O(h^{6})

so that

L̂ û = f̂

actually represents an (infinite) hierarchy of differential systems

L u = f
L e_{2} = −L_{2} u
·
·
·

In other words, in FDA’s of continuum systems, the error is not “random”—rather, in principle, it is no less computable than the fundamental solution itself.