Round-off error arises from representing numbers and carrying out arithmetic at finite precision: storing 1/3 or subtracting nearly equal numbers can lose information even when the mathematical algorithm is exact. Truncation error arises from replacing a continuous or infinite mathematical operation by a finite approximation, such as discarding higher Taylor series terms in a finite difference. Refining a grid usually reduces truncation error but may increase accumulated round-off error; the two have different origins.
Write h=Δx, k=Δt and δxxui=(ui+1−2ui+ui−1)/h2. Insert a smooth exact heat equation solution into the Crank-Nicolson method. Expanding about the midpoint (xi,tn+k/2) givesThus the residual, defined as left side minus right side, isSince ut=Duxx implies uttt=Duxxtt,This proves second-order numerical consistency in both space and time. About the old time level, uncombined Taylor remainders can include O(k3); the midpoint expression displays the symmetric leading errors most cleanly. Multiplying by k gives the one-step defect O(k3+kh2). Stable evolution with suitable initial and boundary data then gives global error O(k2+h2); consistency alone does not prove global convergence.
ku(t+k/2)−u(t−k/2)=ut+24k2uttt+O(k4),
2D[δxxu(t−k/2)+δxxu(t+k/2)]=D[uxx+12h2uxxxx+8k2uxxtt]+O(h4+k4+h2k2).
T=24k2uttt−8Dk2uxxtt−12Dh2uxxxx+O(h4+k4+h2k2).
T=−12k2uttt−12Dh2uxxxx+O(h4+k4+h2k2).
For balanced global error ε, a method second order in both variables can take h∼ε1/2 and k∼ε1/2. With O(1/h) work per time step in one spatial dimension, its cost scales as ε−1. A method second order in space but first order in time instead needs k∼ε, so its cost is O(ε−3/2) under the same per-step cost assumption. Equivalently at fixed h, using k∼h2 rather than k∼h needs about 1/h more steps. A restrictive stability condition or different linear-solver cost can dominate these accuracy-based estimates.
Use a smooth exact solution such as u(x,t)=e−Dq2tsin(qx) on a domain with matching boundary conditions, and compare numerical and exact values at a fixed physical time. To measure spatial order, halve h while making temporal error negligible; the error norm should fall by a factor of four. To measure temporal order, halve k on a sufficiently fine fixed spatial grid and again expect a factor of four. Report observed order p=log2(Eh/Eh/2) and use several refinements to identify the asymptotic regime.
Check more than one smooth mode, boundary implementation and expected conservation or decay properties. A manufactured solution with an added known source can test nontrivial boundaries and forcing. Repeat in maximum and root-mean-square norms, stop before finite-precision or solver tolerances dominate, and separate stability failures from errors in convergence order. A single small error or a single visually smooth solution does not establish accuracy.
Ancestors (10)
- S31
- 2019
- Past exam of the short options paper shared by Parts A and B of the physics course of the University of Oxford
- Short options paper shared by Parts A and B of the physics course of the University of Oxford
- Physics course of the University of Oxford
- Undergraduate course of the University of Oxford
- Course of the University of Oxford
- University of Oxford
- List of universities
- Home
Discussion (0)
New discussionThere are no discussions about this article yet.
Articles by others on the same topic (0)
There are currently no matching articles.