Explicit Finite Difference Algorithms
Explicit Algorithms
Forward Euler (FTFS)
n+1 --------|--------*--------|--------
n --------|------------------------ j-1 j j+1
<p id='katexcfc6f92425fa92c6a6db4ab5fe2555eb'>katexcfc6f92425fa92c6a6db4ab5fe2555eb</p>
The accuracy is <span id='katex29f550b1c52bbc78b4a8e647035b080d'>katex29f550b1c52bbc78b4a8e647035b080d</span>. Previously we saw that the von Neumann stability analysis shows
<p id='katex4638d6994b6c0e44942466ad0de921b4'>katex4638d6994b6c0e44942466ad0de921b4</p>
<p id='katexd6f481218a6ed30094fa82cc5b4ffeec'>katexd6f481218a6ed30094fa82cc5b4ffeec</p>
### Forward-Time Centered Space (FTCS)
<p id='katexcba1d121fcfc4c557b4f87d218f64845'>katexcba1d121fcfc4c557b4f87d218f64845</p>
We also found that this is unconditionally unstable.
### Leap-Frog
<p id='katex7e039042e49b9c3645edbb6eb231181f'>katex7e039042e49b9c3645edbb6eb231181f</p>
n+1 --------|--------*--------|--------
n --------*--------|--------*--------
n-1 --------|--------*--------|--------
j-1 j j+1
Accuracy:
Stability: It is marginally stable () if
It is also time-reversible, so we call it a symplectic integrator. This is a good thing! A time-reversible integrator will conserve energy.
One big problem with Leap-Frog is the starting problem. How do we compute the very first iteration to get when we don't have information about ? We need to "start" the algorithm by calculating the first step using a different method.
Lax Algorithm
Accuracy:
Stability:
It may not be consistent if faster than
We can re-write the Lax algorithm as
Check out the last term - it's a difference operator for the second derivative. So what PDE do we approximate?
So we've added a second-derivative term to the linear advection equation. A second-derivative term acts as an artificial viscosity term, with viscosity .
Lax-Wendroff Algorithm
As we just saw, adding an artificial viscosity term can help to stabilize an unstable algorithm. If we take a Taylor series expansion
and use our governing equation to replace some of the time derivatives with spatial derivatives
Then we get
Substitute into expansion using centered finite difference operators
Checking back up the page, we see the FTCS embedded directly in the algorithm, and we've got the same form of the second derivative but with a different multiplier. Instead of a we've got
What PDE are we approximating?
Again we've added artificial viscosity, but now the viscosity only depends directly on and goes to zero as .
We find that the Lax-Wendroff algorithm is
n+1 --------|--------*--------|--------
n ------------------------*-------- j-1 j j+1
Another advantage of Lax-Wendroff over the Leap-Frog algorithm is that it avoids the starting problem. We don't need any information from step <span id='katexa553465fa7dd567c5c4bb3947dff9249'>katexa553465fa7dd567c5c4bb3947dff9249</span>, so it doesn't need to be started. How can that happen?
Write Lax-Wendroff as a 2-step method (predictor-corrector). Say we're going to use a Lax algorithm to advance to a midpoint
n+1 --------|-----------------*-----------------|--------
n+1/2 -----------------*-----------------*-----------------
j-1/2 j+1/2
n --------|-----------------*-----------------|--------
j-1 j j+1
That's why Lax-Wendroff is the most popular explicit algorithm for linear PDEs.