8.8. The Lax-Wendroff 1-step approach from Taylor expansions#

The Lax-Wendroff 1-step approach start with the equation of interest (here, the linear advection equation) and the Taylor expansion for \(u_m^{n+1}\):

(8.26)#\[\frac{\partial u}{\partial t}=-a\frac{\partial u}{\partial x}\]
(8.27)#\[u_m^{n+1}=u_m^n+\Delta t\frac{\partial u}{\partial t}\mid_m^n+\frac{\Delta t^2}{2!}\frac{\partial^2 u}{\partial t^2}\mid_m^n+\frac{\Delta t^3}{3!}\frac{\partial^3 u}{\partial t^3}\mid_m^n+h.o.t\]

To get a higher order scheme, we can replace both the first and second derivatives of \(u\) by first expressing them in terms of spatial derivatives, which we can get from {eq} ´eq:LinAdv´.

To obtain an expression for the first derivative, we can simply use {eq} ´eq:LinAdv´ and insert a central space scheme for the spatial derivative:

(8.28)#\[\frac{\partial u}{\partial t}\mid_m^n=-a\frac{u_{m+1}^n-u_{m-1}^n}{2\Delta x}\]

To obtain an expression for the second derivative, we can differentiate {eq} ´eq:LinAdv´ once with respect to time and once with respect to space and then combine the two results:

(8.29)#\[\begin{split}\begin{aligned} \frac{\partial^2 u}{\partial t^2}&=-a{\color{salmon}{\frac{\partial^2 u}{\partial x\partial t}}}\\ {\color{salmon}{\frac{\partial^2 u}{\partial t\partial x}}}&=-a\frac{\partial^2 u}{\partial x^2} \end{aligned}\end{split}\]

The second equation of (8.29) gives us an expression of \({\color{salmon}{\frac{\partial^2 u}{\partial t\partial x}}}\) which we can insert into the forst equation of (8.29) to obtain:

(8.30)#\[\begin{split}\frac{\partial^2 u}{\partial t^2}=-a^2\frac{\partial^2 u}{\partial x^2}\\\end{split}\]

If we now insert a central in time scheme for the right hand side of eq:advection2diff, we obtain;

(8.31)#\[\frac{\partial^2 u}{\partial t^2}\mid_m^n \sim a^2\frac{u_{m+1}^n-2u_m^n+u_{m-1}^n}{\Delta x^2}\]

We can now insert (8.28) and (8.31) into (8.27) to get the 1-step scheme:

\[u_m^{n+1}=u_m^n-\frac{a \Delta t}{2\Delta x}\left( u_{m+1}^n-u_{m-1}^n\right)+\frac{a^2\Delta t^2}{2\Delta x^2}\left( u_{m+1}^n-2u_m^2+u_{m-1}^n \right)+h.o.t\]

By further massaging an incorporating the \(C=\frac{a\Delta t}{\Delta x}\), we get:

\[u_m^{n+1}=\frac{C}{2}(1+C)u_{m-1}^n+(1-C^2)u_m^n-\frac{C}{2}(1-C)u_{m+1}^n+h.o.t\]

8.8.1. Truncation error for the Lax-Wendroff scheme#

To find the order of the Lax-Wendroff scheme, we can look at the Taylor expansion and the order of the terms we have used. We can rewrite the Taylor expoansion to only show the terms we use and the truncation error:

\[\frac{u_m^{n+1}-u_m^n}{\Delta t}=\frac{\partial u}{\partial t}\mid_m^n+\frac{\Delta t}{2!}\frac{\partial^2 u}{\partial t^2}\mid_m^n+\frac{\Delta t^2}{3!}\frac{\partial^3 u}{\partial t^3}\mid_m^n\]

The last term is not included in the Lax-Wendroff scheme, and we see that the error is of second order (\(\Delta t^2\)). However, we also have approximations in the numerical schemes we insert for \(\frac{\partial u}{\partial t}\mid_m^n\) and \(\frac{\partial^2 u}{\partial t^2}\mid_m^n\) which leads to additional truncation error terms. We must check the error of these schemes to know the error/order of the complete Lax-Wendroff scheme.

  • We used a CS scheme for the first derivative, which is second order. This gives us a second order spatial error, \(\Delta x^2\)

  • We used a CS scheme for the second derivatie, which is second order. This also gives us a second order spatial error, \(\Delta x^2\)

The Lax-Wendroff scheme is, therefore, a second order scheme in both time (\(\Delta t^2\)) and space (\(\Delta x^2\)).

8.8.2. Consistency, stability and convergence for the Lax-Wendroff scheme#

To determine its stability we can express the scheme as:

\[ u_m^{n+1} = \alpha u_{m-1}^n + \beta u_m^n + \gamma u_{m+1}^n \]

with

(8.32)#\[\begin{split}\begin{aligned} \alpha &= \frac{\sigma}{2}(\sigma + 1),\\ \beta &= 1- \sigma^2, \\ \gamma &= \frac{\sigma}{2}(\sigma - 1) \end{aligned}\end{split}\]

Assuming a solution of the type \(B^n e^{ik_j m \Delta x}\), we can insert this into the Lax-Wendroff scheme:

(8.35)#\[B^{n+1}e^{ik_jm\Delta x}=B^{n}e^{ik_jm\Delta x}=B^n(\alpha e^{ik_j(m-1)\Delta x}+\beta e^{ik_jm\Delta x}+\gamma e^{ik_j(m+1)\Delta x})\]

Multiplying by \(\frac{e^{-ik_jm\Delta x}}{B^n}\) at either side gives:

\[ \frac{B^{n+1}}{B^n}=\alpha e^{-ik_j\Delta x} + \beta +\gamma e^{ik_j\Delta x} \]

Using the Euler identity, we can convert the exponential factors into sines and cosines:

\[ \frac{B^{n+1}}{B^n}=\alpha \cos(k_j\Delta x)-\alpha i \sin(k_j\Delta x) + \beta + \gamma \cos(k_j\Delta x) + \gamma i \sin(k_j\Delta x) \]

Factorizing sines and cosines gives:

\[ \frac{B^{n+1}}{B^n}=(\alpha+\gamma)\cos(k_j\Delta x) + \beta + i(\gamma-\alpha)\sin(k_j\Delta x) \]

We can use (8.32) to find that \(\alpha+\gamma=c^2\) and \(\gamma-\alpha=-c\) and also re-inserting \(\beta=1-c^2\), we obtain

\[ \frac{B^{n+1}}{B^n}=c^2\cos(k_j\Delta x)+(1-c^2)-i c\sin(k_j\Delta x), \]

which we can factorize into:

\[ \frac{B^{n+1}}{B^n}=\left[1+c^2(\cos(k_j\Delta x)-1)\right]-i c\sin(k_j\Delta x) \]

The next step is to include the norm, and square the expression to get rid of the complex part:

(8.34)#\[\left \lvert \frac{B^{n+1}}{B^n}\right \rvert^2=\left(1+c^2(\cos(k_j\Delta x)-1)\right)^2+c^2\sin^2(k_j\Delta x)\]

From here, you can open up the first term on the right hand side and use the trigonometric identity \(\sin^2(x)=1-\cos^2(x)\) to obtain

\[ \left| \frac{B^{n+1}}{B^n}\right |^2=1+2c^2\cos(k_j\Delta x)-2c^2+c^4(\cos(k_j\Delta x)-1)^2+c^2-c^2\cos^2(k_j\Delta x) \]

Factorizing the terms including \(c^2\) gives

\[ \left| \frac{B^{n+1}}{B^n}\right |^2=1-c^2[1-2\cos(k_j\Delta x)+\cos^2(k_j\Delta x)]+c^4(\cos(k_j\Delta x)-1)^2 \]

Factorizing the term in the square bracket gives:

\[ \left| \frac{B^{n+1}}{B^n}\right |^2=1-c^2[1-\cos(k_j\Delta x)]^2+c^4(\cos(k_j\Delta x)-1)^2, \]

which we can now factorize further into:

(8.35)#\[\left| \frac{B^{n+1}}{B^n}\right |^2=1+c^2(c^2-1)[1-\cos(k_j\Delta x)]^2\]

To ensure stability, we must have \(\left| \frac{B^{n+1}}{B^n}\right |\le 1\), which is equivalent to \(\left| \frac{B^{n+1}}{B^n}\right |^2\le1\)

Our amplification factor is

(8.36)#\[G=\left| \frac{B^{n+1}}{B^n}\right |^2=1+c^2(c^2-1)[1-\cos(k_j\Delta x)]^2\le 1\]

Subtracting the number \(1\) on either side of the inequality gives:

\[ c^2(c^2-1)[1-\cos(k_j\Delta x)]^2\le 0 \]

Since the first and the last terms are squared, and therefore always positive, this expression can only hold if the term \((c^2-1)\le 0\), which leads us to the CFL criteria \(c\le 1\)

After all this calculation, we end up with the same stability criteria as for the FTBS scheme! The Lax-Wendroff scheme is conditionally stable, with a stability criteria \(c=\frac{a\Delta t}{\Delta x}\le 1\).