Math 2.0

Numerical analysis Definition

MacCormack method

Builds on Conservation lawFinite difference methodLax–Wendroff method

Definition

Let f ⁣:ℝm→ℝmf \colon \R^m \to \R^m be smooth, and consider the conservation law ut+f(u)x=0u_t + f(u)_x = 0. Fix Δx>0\Delta x > 0 and Δt>0\Delta t > 0, put λ=Δt/Δx\lambda = \Delta t / \Delta x, and let ujnu_j^n approximate u(jΔx,nΔt)u(j \Delta x, n \Delta t). The MacCormack method computes un+1u^{n+1} from unu^n in two steps.

  1. Predictor, with a forward difference: uj∗=ujn−λ(f(uj+1n)−f(ujn))u_j^{*} = u_j^n - \lambda \left( f(u_{j+1}^n) - f(u_j^n) \right).
  2. Corrector, with a backward difference: ujn+1=12(ujn+uj∗)−λ2(f(uj∗)−f(uj−1∗))u_j^{n+1} = \frac12 \left( u_j^n + u_j^{*} \right) - \frac{\lambda}{2} \left( f(u_j^{*}) - f(u_{j-1}^{*}) \right).

Remarks

Example: for f(u)=auf(u) = a u and ν=aλ\nu = a \lambda, the predictor gives uj∗−uj−1∗=(ujn−uj−1n)−ν(uj+1n−2ujn+uj−1n)u_j^* - u_{j-1}^* = (u_j^n - u_{j-1}^n) - \nu (u_{j+1}^n - 2u_j^n + u_{j-1}^n). Putting this into the corrector gives ujn+1=ujn−ν2(uj+1n−uj−1n)+ν22(uj+1n−2ujn+uj−1n),u_j^{n+1} = u_j^n - \frac{\nu}{2} (u_{j+1}^n - u_{j-1}^n) + \frac{\nu^2}{2} (u_{j+1}^n - 2u_j^n + u_{j-1}^n), which is the Lax–Wendroff method; so the method is second-order accurate and stable for ∣ν∣≤1\abs{\nu} \le 1 in this case. Non-example: using a forward difference in the corrector as well gives, for f(u)=auf(u) = a u, the scheme ujn+1=ujn−ν(uj+1n−ujn)+ν22(uj+2n−2uj+1n+ujn)u_j^{n+1} = u_j^n - \nu (u_{j+1}^n - u_j^n) + \frac{\nu^2}{2}(u_{j+2}^n - 2u_{j+1}^n + u_j^n), whose Taylor expansion leaves the error term −aΔx2uxx-\frac{a \Delta x}{2} u_{xx}, so it is only first order. The order of the one-sided differences may be reversed (backward in the predictor, forward in the corrector); alternating the two orders from step to step is common.

Reading path

To understand this page from the ground up, read these 4 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Conservation law concept
  2. Finite difference method concept
  3. Lax–Wendroff method concept
  4. MacCormack method definition

Further reading

  1. Web https://en.wikipedia.org/wiki/MacCormack_method
About this page
Tag5R9ZRK8YB5
URIm2://5R9ZRK8YB5
Kinddefinition
WritingW0 stub
MSC65M06, 35L65
DefinesMacCormack method
UsesConservation law, Finite difference method, Lax–Wendroff method

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.