NumMeth-22: CFL

This commit is contained in:
2022-11-24 12:25:47 +01:00
parent 0e4c1cc532
commit 8914419bba
2 changed files with 147 additions and 2 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

+147 -2
View File
@@ -3237,7 +3237,7 @@ PDE is only an approximate solution of the difference equations, and how well it
the difference equations gives an indication of how well the exact solution of the difference
equations satisfies the differential equation.
As an example, consider the Lax-Priedrichs method. This method is similar to the unstable method \eqref{eq:leveque10.7} but replaces $U_j^n$ by $1/2(U_{j-1}^n+U_{j+1}^n)$ and is stable
As an example, consider the Lax-Friedrichs method. This method is similar to the unstable method \eqref{eq:leveque10.7} but replaces $U_j^n$ by $1/2(U_{j-1}^n+U_{j+1}^n)$ and is stable
provided $k/h$ is sufficiently small, as we will see later.
We first write this method in the form
@@ -3257,14 +3257,159 @@ Doing this and collecting terms gives (with $u=u(x,t)$):
L_k(x,t) &= \frac{1}{k}\left( (u+k\partial_t u +\frac{1}{2} k^2 \partial_t^2 u+\dots) - (u +\frac{1}{2}h^2 \partial_x^2 u+\dots)\right) +\frac{1}{2h} A (2 h \partial_x u +\frac{1}{3}\partial_x^3 u+\dots)\\
&= \partial_t u + A\partial_x u +\frac{1}{2}\left(k\partial_t^2 u -\frac{h^2}{k} \partial_x^2 u \right) + \mathcal{O}(h^2)
\end{align}
Since we assume that $u(x,t)$ is the exact solution $\partial_t u +A\partial_x u =0i$ we find that
Since we assume that $u(x,t)$ is the exact solution $\partial_t u +A\partial_x u =0$ we find that
\begin{align}
L_k(x,t) &= \frac{1}{2} k \left( A^2 - \frac{h^2}{k^2}I\right) \partial_x^2 u(x,t) + \mathcal{O}(k^2)\\
&= \mathcal{O}(k) \ \text{as} \ k\to 0
\end{align}
Recall that we assume a fixed relation between $k$ and $h$, $k/h=\text{constant}$, so that $h^2/k^2$ is constant as the mesh is refined. (This also justifies indexing $L_k$ by $k$ alone rather than by both $k$ and $h$.)
By being more careful in this analysis, using Taylor's theorem with remainder and
assuming uniform bounds on the appropriate derivatives of $u(x,t)$, we can in fact show a
sharp bound of the form
\begin{align}
\vert L_k(x,t) \vert \leq C k \quad \text {for all~} k<k_0
\end{align}
The constant $C$ depends only on the initial data $u_0$, since for the linear system we consider
here we can easily bound derivatives of $u(x,t)$ in terms of derivatives of the initial data.
If we assume more over that $u_0$ has compact support, then $L_k(x,t)$ will have finite 1-norm
at each time $t$ and we can obtain a bound of the form
\begin{align}
\Vert L_k(\cdot,t) \leq C_L k \quad \text {for all~} k<k_0
\end{align}
for some constant $C_L$ again depending on $u_0$.
The Lax-Friedrichs method is said to be first order since the local error depends linearly on $k$
We now extend these notions to arbitrary 2-level methods: For a general 2-level method, we define the local truncation error by
\begin{align}
L_k(x,t) = \frac{1}{k}\left( u(x,t+k) - \mathcal{H}(u(\cdot,t);x) \right) \label{eq:leveque10.33}
\end{align}
The method is consistent if
\begin{align}
\Vert L_k(\cdot,t)\Vert \to 0 \ \text{as} \ k \to 0
\end{align}
The method is of order $p$ if for all sufficiently smooth initial data
with compact support, there is some constant$C_L$ such that
\begin{align}
\Vert L_k(\cdot,t)\Vert < C_L k^p\ \text{for all} \ k < k_0,\ t \leq T
\end{align}
This is the local order of the method, but it turns out that for smooth solutions,the
global error will be of the same order provided the method is stable.
\subsection{Stability}
Note that we can rewrite Eq \eqref{eq:leveque10.33} in the form
\begin{align}
u(x,t+k) = \mathcal{H}_k(u(\cdot,t);x) + k L_k(x,t)
\end{align}
Since the numerical solution satisfies
\begin{align}
U(x,t+k) = \mathcal{H}_k(U_k(\cdot,t);x)
\end{align}
we can obtain a simple recurrence relation for the error in a linear method by subtracting these two expressions, obtaining
\begin{align}
E_k(x,t+k) = \mathcal{H}_k(E_k(\cdot,t);x)-k L_k(x,t)
\end{align}
Note that linearity is strongly required here. Since the method is linear, we can rewrite the last equation in the functional form
\begin{align}
E_k(\cdot,t+k) = \mathcal{H}_k E_k(\cdot,t) - k L_k(\cdot,t)
\end{align}
The error at time $t+k$ is seen to consist of two parts. One is the new local
error $-k L_k$ introduced in this timestep. The other part is the cumulative error from
previous timesteps. By applying this relation recursively we obtain an expression for the
error at time $t_n$:
\begin{align}
E_k(\cdot, t_n) = \mathcal{H}_k^n E_k(\cdot,0) - k \sum_{i=1}^n \mathcal{H}_k^{n-i} L_k(\cdot, t_{i-1})
\end{align}
Here superscripts on $\mathcal{H}_k$ represents powers of the matrix (or linear operator) obtained by repeated applications.
In order to obtain a bound on the global error, we must insure that the local error $L_k(\cdot, t_{i-1}$ is not unduly amplified by applying $n-i$ steps of the method. This requires stability of the metho, and we use a form that is often referred to as Lax-Richtmyer stability.
The method is stable if for each time $T$ there is a constant $C_S$ and a value $k_0>0$ such that
\begin{align}
\Vert \mathcal{H}_k^n\Vert \leq C_S \ \text{for all} \ k < k_0,\ n k \leq T
\end{align}
Note in particular that the method is stable if $\Vert \mathcal{H}_k \vert \leq 1$, for then $\Vert \mathcal{H}_k^n\Vert \leq \Vert \mathcal{H}_k\Vert^n \leq 1$ for all $n,k$. More generally, some growth is allowed.
\subsection{Lax Equivalence Theorem}
This is the fundamental convergence theorem for linear difference methods, and says that
for a \emph{consistent}, linear method, \emph{stability} is necessary and sufficient for convergence.
The proof is lengthy and unnecessary for this specific lecture\dots
\subsection{The CFL condition}
One of the first papers on finite difference methods for PDEs was written in 1928 by
Courant, Friedrichs, and Lewy. They use finite difference methods as an analytic tool for proving existence of solutions of certain PDEs. The idea is to define a sequence of approximate solutions (via finite difference equations), prove that they converge as the grid is refined, and then show that the limit function must satisfy the PDE, giving existence of a solution.
In the course of proving convergence of this sequence (which is precisely what we
are interested in), they recognized that 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.
The domain of dependence $\mathcal{D}_k(\bar x, \bar t)$ for the PDE has already been described. Recall that for the linear system, the set $\mathcal{D}_k(\bar x, \bar t)$ consists of the points
$\bar x- \lambda_p \bar t$, $p=1,2,\dots,m$ since only initial data at these points can affect the solution at $(\bar x, \bar t)$.
The numerical domain of dependence $\mathcal{D}_k(\bar x, \bar t)$, for a particular method is similarly defined. It is the set of points $\bar x$ for which initial data $u_0(x)$ could possibly affect the numericalsolution at $(\bar x, \bar t)$.
\textbf{Example:} Consider a three-point scheme with a stencil as for \eqref{eq:leveque10.7}. The value of $U_k(x_j,t^n)$ depends on values of $U_k$ at time $t_{n-1}$ the three
points $x_{j+q}, q=-1,0,1$. These values in turn depend on $U_k$ at time $t_{n-2}$ at the points
$x_{j+q}$ for $q=-2,-1,0,1,2$. Continuing back to $t=0$ we see that the solution at $t_n$
depends only on initial data at the points $_{j+q}$ for $q=-n,\dots,n$, and so the numerical
domain of dependence satisfies
\begin{align}
\mathcal{D}_k(x_j;t^n) \subset \{x: \vert x-x_k\vert \leq n h \}
\end{align}
or in terms of a fixed point $(\bar x,\bar t)$,
\begin{align}
\mathcal{D}_k(\bar x;\bar t) \subset \{x: \vert x- \bar x\vert \leq (\bar t/k)h \}
\end{align}
If we now refine the mesh with $k/h$ fixed, say $k/h=r$, then in the limit this domain of
dependence fills out the entire set,
\begin{align}
\mathcal{D}_0(\bar x;\bar t) = \{x: \vert x- \bar x\vert \leq \bar t/r \}
\end{align}
The CFL condition requires that
\begin{align}
\mathcal{D}_(\bar x;\bar t) \subset \mathcal{D}_0(\bar x;\bar t)
\label{eq:leveque10.54}
\end{align}
For a three-point scheme applied to a linear system this requires that
\begin{align}
\vert (\bar x - \lambda_p \bar t)-\bar x\vert \leq \bar t/r
\end{align}
i.e., that
\begin{align}
\left\vert \frac{\lambda_p k}{h} \right\vert \leq 1
\label{eq:leveque10.55}
\end{align}
for each eigenvalue $\lambda_p$ of A. This guarantees that the characteristics of the system lie within the computational triangle shown in Fig. \ref{fig:leveque_10.2}.
\begin{figure}
\begin{center}
\pgfimage[width=.6\textwidth]{fig_chapter5/leveque_10.2.png}
\end{center}
\caption{Computational triangle for a three-point scheme. The CFL condition requires
that characteristics lie within this triangle.}
\label{fig:leveque_10.2}
\end{figure}
The CFL condition is only a necessary condition for stability, not sufficient. The fact that it is necessary stems from the observation that \eqref{eq:leveque10.54} is violated then there are points $\zeta$ in the true domain of dependence that are not in the numerical domain of dependence. Changing the value of the initial data at $\zeta$ would thus effect the true solution but not the numerical solution, and hence the numerical solution cannot possibly converge to the true solution for all initial data.
For the Lax-Friedrichs method we have already seen that \eqref{eq:leveque10.55} is also a sufficient condition for stability, hence it is necessary and sufficient.
There are examples, however, when the CFL condition is not sufficient for stability. For example, the three-point centered method has the usual domain of dependence for a three-point method, and hence satisfies the CFL condition if \eqref{eq:leveque10.55} holds, but turns out to be unstable for any mesh ratio as is easily shown by von Neumann analysis.
\subsection{Upwind methods}
%- Finite Differenzen
%- Finite Volumina
%- Flux-Limiter