# Finite difference method for linear equation

We want to introduce the basic idea of the FDM for the linear equation, including the concept, schemes, global error and convergence.

## Model problem

Consider the one-dimensional linear equation\begin{align*} u_t+ au_x & = 0,\quad -\infty < x<\infty , t\geq 0\\ u(x,0) &= u_0(x). \end{align*} \tag{1}Here, $$a\neq 0$$ is constant denoting the moving speed of the fluid. A fundamental result implies that the solution is $$u(x,t)=u_0(x-at),t>0$$. As time evolves, the initial data moves to the right ($$a>0$$) or to the left ($$a<0$$) without any change.

We discrete the space-time domain by $$(x_j,t_n)$$ with$x_j = jh, \quad t_n=nk.$The point-wise values of the exact solution will be denoted by $$u_j^n = u(x_j,t_n)$$, and the discrete values are represented by $$U_j^n$$.

## Finite difference scheme

For brevity, we only consider two-level methods.$(\text{Forward Euler})\quad \frac{U_j^{n+1}-U_j^{n}}{k} + a\frac{U_{j+1}^n-U_{j-1}^n}{2h} = 0. \tag{2a}$
$(\text{Backward Euler})\quad \frac{U_j^{n+1}-U_j^{n}}{k} + a\frac{U_{j+1}^{n+1}-U_{j-1}^{n+1}}{2h} = 0. \tag{2b}$
A classical method is the Lax-Friedrichs scheme, which is obtained by replacing $$U^n_j$$ by $$(U_{j-1}^{n}+U_{j+1}^{n})/2$$ and is stable provided $$k/h$$ is small enough, as we will see later.$(\text{Lax-Friedrichs})\quad \frac{U_j^{n+1}-(U_{j-1}^{n}+U_{j+1}^{n})/2}{k} + a\frac{U_{j+1}^{n}-U_{j-1}^{n}}{2h} = 0. \tag{2c}$
For brevity, we introduce the (linear) iteration operator for these methods:$U^{n+1} = \mathcal{H}_k(U^n). \tag{3}$For example, the iteration matrix of the Lax-Friedrichs scheme is $$\mathcal{H}_k(U^n,j) = \frac{1}{2}(U_{j-1}^{n}+U_{j+1}^{n}) – \frac{ak}{2h}\left( U_{j+1}^{n+1}-U_{j-1}^{n+1} \right)$$.

## Error and norms

Define point-wise error$E_j^n = U_j^n-u_j^n.$To measure the “distance” between the exact solution $$u$$ and the numerical solution, we define the following norms\begin{align*} \|U^n\|_{\infty} &= \sup_{j} |U_j^n|,\\ \|U^n\|_{1} &= \sum_{j} h|U_j^n|,\\ \|U^n\|_{2} &= \left( \sum_{j} h|U_j^n|^2 \right)^{1/2}. \end{align*}

In general, we approximate the continuous equation $$\mathcal{L}[u]=f$$ by discrete equation$\mathcal{L}U_{j}^{n} =f_j^n. \tag{4}$The error arises from the left, so it is natural to define the local truncation error (LTE) by substituting $$u$$ into (4)$\tau_{j}^n = \mathcal{L}u_j^n-f_j^n. \tag{5a}$For example, the forward Euler method has the LTE$\mathcal{L}u_j^n = \frac{1}{k}(k u_t(x_j,t_n)+O(k^2)) + \frac{a}{2h} (2hu_x(x_j,t_n)+O(h^3)) = O(k)+O(h^2)$

Note. For a fixed spatial mesh $$h$$ or fixed relation between $$k$$ and $$h$$ (f.e.,$$k/h=const$$), we only care the error behaviour with respect to time step $$k \to 0$$. In this case, we can define the LTE of an explicit method as$\tau_{j}^n = \frac{1}{k}\left[ u(x_j,t_n+k)-\mathcal{H}_k(u(x_j,t_n)) \right]. \tag{5b}$On the other hand, implicit method has a more complicated form$B_1 U^{n+1} = B_0 U^n+ k \tau^n \quad \Rightarrow \quad U^{n+1} = B_1^{-1}B_0 U^n+ k B_1^{-1} \tau^n,$where $$B_1^{-1}B_0$$ is the iteration operator $$\mathcal{H}_k$$ in (3). Implicit methods, in general, lead to a more difficult convergence analysis. For generality, we consider the LTE equation for iteration process (3):$u^{n+1} = \mathcal{H}_k(u^n) + k B_1^{-1}\tau^n. \tag{3b}$

Definition (Consistency). Given a refining path, the method is consistent if LTE satisfies$\|\tau^n\|\to 0 \quad \text{as}\quad k\to 0.$

For example, (2a) is consistent w.r.t. $$\|\cdot \|_{\infty}$$ with refining path $$k/ h^2=const$$.

## Stability

Now, we need to consider the key problem: convergence or error estimate. Intuitively, convergence means the difference between the exact and numerical solutions tends to zero w.r.t. some norm as $$k, h\to 0$$. We also want to know at what speed this difference tends to zero. In many textbooks, it says that convergence is not easy to show, but we can instead show stability, as the Lax equivalence theorem states, to obtain convergence. In fact, we have

Lax Equivalence Theorem. For a consistent linear method, stability is necessary and sufficient for convergence.

Now, we first turn to stability and after that, we come back to convergence. Combing (3) and (3b), we obtain error equation at time level $$n$$$E^{n+1} = \mathcal{H}_k(E^n) – k B_1^{-1}\tau^n, \tag{6}$which further implies by recursion$E^{n+1} = \mathcal{H}_k^n(E^0) – \sum_{j=0}^{n} k \mathcal{H}_k^j(B_1^{-1}\tau^{n-j}). \tag{6b}$

Definition (Stability). A method is said to be stable if for each time $$T$$ there is a constant $$C_s$$ and a value $$k_0>0$$ s.t.$\|\mathcal{H}_k^n\|\leq C_s \quad \forall nk\leq T,\ k < k_0.$

In particular, the method is stable if $$\|\mathcal{H}_k\|\leq 1$$. More generally, slight growth is allowed in the sense that $$\|\mathcal{H}_k\|\leq 1+\alpha k$$ for all $$k< k_0$$. In fact, $$\|\mathcal{H}_k^n\|\leq (1+\alpha k)^n \leq e^{\alpha nk}\leq e^{\alpha T}$$.

Assume now the method is stable, that we have the following error estimate from (6b)\begin{align*} \|E^{n+1}\| &\leq \|\mathcal{H}_k^{n}\| \|E^0\| + k\|B_1^{-1}\| \sum_{j=0}^{n} \|\mathcal{H}_k^j\| \|\tau^{n-j}\| \\ &\leq C_s \|E^0\| + k\|B_1^{-1}\| \cdot C_s \cdot O (k^p+h^p) \cdot n \\ &\leq C_s \left( \|E^0\| + T\|B_1^{-1}\| \cdot O (k^p+h^p) \right) .\end{align*}Clearly, error $$E^{n+1}$$ for all $$n$$ tends to zero as $$k,h\to 0$$. Hence, for a consistent (two-level) scheme, stability is sufficient for convergence.

Example 1. Prove Lax-Friedrichs shceme is convergent w.r.t. $$\|\|_{1}$$ provided$ak/h\leq 1. \tag{7}$Proof. It is clear that for (7)\begin{align*} \|U^{n+1}\|_1 &= h \sum_{j}|U^{n+1}_j| \\ &= h \sum_{j}|\frac{1}{2}(U_{j-1}^{n}+U_{j+1}^{n}) – \frac{ak}{2h}\left( U_{j+1}^{n+1}-U_{j-1}^{n+1} \right)| \\ &\leq \frac{h}{2} \sum_{j}\left\{ \left( 1+\frac{ak}{h} \right)|U_{j-1}^{n}| + \left( 1-\frac{ak}{h} \right) |U_{j+1}^{n+1}| \right\} \\ &= \frac{1}{2} \left\{ \left( 1+\frac{ak}{h} \right) \|U^n\| + \left( 1-\frac{ak}{h} \right) \|U^n\| \right\} \\ &= \|U^n\|, \end{align*}which implies the iteration matrix $$\|\mathcal{H}_k\|_1\leq 1$$ and thus the scheme is convergent. $$\heartsuit$$

## The CFL condition

In the last section, for the Lax-Friedrichs method we have seen that condition (7) is sufficient for stability. Now, we wonder what is a necessary condition for stability. As indicated in [1,2], a necessary stability condition for any numerical method is that the domain of dependence of the finite difference method should include the domain of dependence of the PDE, at least in the limit as $$k,h\to 0$$. This condition is known as the CFL condition after Courant, Friedrichs and Lewy.

In linear equation (1), the domain of dependence $$\mathcal{D}(\bar{x},\bar{t})$$ consists of point $$\bar{x}-a \bar{t}$$, because the wave moves from $$x-at$$ at time $$0$$ to $$x$$ at $$t$$. Now, consider Lax-Friedrichs method, we see $$\mathcal{D}_k(x_j,t_n)= \left\{ x:\ |x-x_j|\leq nh \right\}$$, precisely,$\mathcal{D}_k(\bar{x},\bar{t})= \left\{ x:\ |x-\bar{x}|\leq (\bar{t}/k)h \right\}. \tag{8}$Now, on what condition there is $$\bar{x}-a \bar{t} \in \mathcal{D}_k(\bar{x},\bar{t})$$? Substituting $$x=\bar{x}-a \bar{t}$$ in (8) leads to$|a \bar{t}|\leq \frac{\bar{t}}{k}h \quad \Rightarrow \quad \frac{ak}{h}\leq 1.$This is exactly (7), which is also necessary for stability.

0 0 投票数 0 评论