Math 2.0

Numerical analysis Time-dependent partial differential equations Theorem

Crank–Nicolson method

Builds on Heat equationFinite difference methodMethod of linesLax equivalence theorem

Statement

Let κ>0\kappa > 0 and consider the heat equation ut=κuxxu_t = \kappa u_{xx} on 0<x<10 < x < 1, t>0t > 0, with u(0,t)=u(1,t)=0u(0, t) = u(1, t) = 0 and a given initial value u(x,0)u(x, 0). Let M≥1M \ge 1, Δx=1/(M+1)\Delta x = 1/(M + 1), xj=jΔxx_j = j \Delta x, Δt>0\Delta t > 0, tn=nΔtt_n = n \Delta t and r=κΔt/Δx2r = \kappa \Delta t / \Delta x^2. For a grid vector v=(v0,…,vM+1)v = (v_0, \ldots, v_{M+1}) with v0=vM+1=0v_0 = v_{M+1} = 0, put (δ2v)j=(vj+1−2vj+vj−1)/Δx2(\delta^2 v)_j = (v_{j+1} - 2 v_j + v_{j-1}) / \Delta x^2. The Crank–Nicolson method computes un+1u^{n+1} from unu^n by ujn+1−ujnΔt=κ2((δ2un+1)j+(δ2un)j),1≤j≤M.\frac{u_j^{n+1} - u_j^n}{\Delta t} = \frac{\kappa}{2} \left( (\delta^2 u^{n+1})_j + (\delta^2 u^n)_j \right), \qquad 1 \le j \le M.

  1. Each step has a unique solution un+1u^{n+1}, given by a tridiagonal linear system.
  2. The method is unconditionally stable: ∥un+1∥2≤∥un∥2\norm{u^{n+1}}_{2} \le \norm{u^n}_2 for every r>0r > 0, where ∥v∥22=Δx∑j=1Mvj2\norm{v}_2^2 = \Delta x \sum_{j=1}^M v_j^2.
  3. Assume the exact solution has bounded derivatives utttu_{ttt}, uxxttu_{xxtt} and uxxxxu_{xxxx}. Then the local truncation error is O(Δt2+Δx2)O(\Delta t^2 + \Delta x^2). On each interval [0,T][0, T] the error max⁡nΔt≤T∥u(⋅,tn)−un∥2\max_{n \Delta t \le T} \norm{u(\cdot, t_n) - u^n}_2 is also O(Δt2+Δx2)O(\Delta t^2 + \Delta x^2).

Remarks

The vectors sj(k)=sin⁡(kπxj)s^{(k)}_j = \sin(k \pi x_j), 1≤k≤M1 \le k \le M, are eigenvectors of δ2\delta^2 with eigenvalues −4Δx2sin⁡2kπΔx2-\frac{4}{\Delta x^2} \sin^2 \frac{k \pi \Delta x}{2}, and they are orthogonal. In this basis each step multiplies the kk-th component by gk=1−2rσk1+2rσkg_k = \frac{1 - 2 r \sigma_k}{1 + 2 r \sigma_k} with σk=sin⁡2kπΔx2∈(0,1)\sigma_k = \sin^2 \frac{k \pi \Delta x}{2} \in (0, 1), and ∣gk∣<1\abs{g_k} < 1 for all r>0r > 0; this gives clauses 1 and 2. Clause 3 follows from Taylor expansion about (xj,tn+Δt/2)(x_j, t_n + \Delta t/2) and from stability, as in the Lax equivalence theorem. The method is the trapezoidal rule applied to the method of lines semi-discretisation u′=κδ2uu' = \kappa \delta^2 u. For large rr, gkg_k is close to −1-1 for the high frequencies, so rough initial data produce slowly decaying oscillations: the method is A-stable but not L-stable.

Going deeper

For a student

It is the default second-order method for diffusion problems, including the Black–Scholes equation in finance. For non-smooth data it is often started with a few backward Euler steps (Rannacher smoothing) to damp the oscillating modes. In several space dimensions the systems are no longer tridiagonal, which motivates alternating-direction implicit methods.

Reading path

To understand this page from the ground up, read these 16 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. Banach space concept
  2. Differential equation concept
  3. Finite difference method concept
  4. Function concept
  5. Heat equation concept
  6. Interval concept
  7. Method of lines concept
  8. Operator norm concept
  9. Transport equation concept
  10. Well-posed problem concept
  11. Ordinary differential equation definition
  12. Courant–Friedrichs–Lewy condition statement
  13. Solution of an ordinary differential equation definition
  14. Initial value problem definition
  15. Lax equivalence theorem statement
  16. Crank–Nicolson method statement

Where this leads

1 page builds on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Crank%E2%80%93Nicolson_method
About this page
TagM92S0Y15N1
URIm2://M92S0Y15N1
Kindstatement, theorem
WritingW0 stub
MSC65M06, 65M12
StatusThis copy of the site has no build data. Run m2 status M92S0Y15N1.
AboutHeat equation
UsesHeat equation, Finite difference method, Method of lines, Lax equivalence theorem

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • 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

Used by