MMS Convergence Rate Calculation

Category: V&V – Method of Manufactured Solutions | Revised 2026-10-01
CAE visualization for mms convergence rate theory - technical simulation diagram
Method for calculating MMS convergence rate

Theory: reading order from error ratios

Overview

🙋

After computing MMS errors, how is the order calculated? Is it just a division?

🎓

The formula is simple, but there are traps: mixing up the grid ratio, refining into the round-off floor, computing in single precision, non-smooth solutions, and lower-order formulas at boundaries — all push the order away from theory. To tell them apart from real bugs, know how each one looks. Let's check them one by one with second-order central differences for 1D Poisson.

Observed order

$$ p_{obs} = \frac{\ln(e_1/e_2)}{\ln r},\qquad r = \frac{h_1}{h_2} $$

$e_1, e_2$ are coarse- and fine-grid errors and $r$ the spacing ratio; only for $r = 2$ can it be written $\log_2(e_1/e_2)$.

The round-off floor

$$ e(h) \approx C h^p + \frac{\epsilon_{mach}\,\|u\|}{h^2}\quad\Rightarrow\quad h_{opt} \sim \left(\frac{\epsilon_{mach}}{C}\right)^{1/(p+2)} $$

Second-derivative differences divide by $h^2$, so round-off grows as $h$ shrinks. Beyond the grid where discretisation and round-off errors sum to a minimum, error rises again.

Coffee Break Trivia

Round-off and grid fineness

That shrinking the step in numerical differentiation eventually loses accuracy to round-off has been known since the earliest computers. Floating-point representation was standardised as IEEE 754 in 1985, giving about 16 significant digits in double and 7 in single precision. With GPUs, single and half precision are back in use, and the problem of refinement no longer improving accuracy is once again a practical concern.

Worked example: 1D Poisson

−u″ = f with manufactured u = sin(πx) + x³, second-order central differences, Dirichlet at both ends; max-norm error.

Double and single precision

CellsDouble-precision errorOrderCellsSingle-precision errorOrder
1008.23e-52.00309.14e-42.00
1,0008.22e-72.001008.27e-52.00
10,0008.24e-92.003003.03e-50.91
100,0003.26e-101.401,0004.01e-4−2.15
1,000,0006.85e-7−3.323,0002.90e-3−1.80

Other pitfalls

SituationObserved orderExpected
Solution x^1.5 (max norm, 512 cells)1.442 (for smooth solutions)
Solution x^1.5 (L2 norm, 512 cells)1.472
Ratio 1.5 computed with log₂1.172.00
Neumann end, one-sided (1st order)0.992
Neumann end, ghost node (2nd order)2.002
🙋

Even in double precision, error grows at a million cells. So finer isn't always better.

🎓

Second-derivative differences divide tiny differences of neighbouring values by h². As h shrinks, those differences approach round-off size and the division magnifies them. Double precision hits the floor around 100,000 cells; single precision breaks at just 300. When checking order with MMS, use only the range where orders line up at the theoretical value and discard points on the floor. Equally important is diagnosing a drop: a non-smooth solution settles at an in-between value like 1.44, a first-order boundary formula drops the order cleanly to 1, and round-off makes it collapse abruptly and go negative. These signatures help tell bugs from everything else.

Procedure for computing order

  1. Build four or more grids at a constant ratio and record r.
  2. Compute order for each adjacent pair with p = ln(e₁/e₂)/ln r and tabulate.
  3. Use the range where orders line up at theory as the asymptotic range.
  4. If error rises on fine grids, suspect the round-off floor and confirm with higher precision.
  5. Use smooth manufactured solutions and check boundary-condition order too.
Coffee Break Trivia

“Moving to GPU broke the order”

A team switched a heat-conduction code to single precision to speed it up on GPU, and MMS verification showed negative orders on fine grids. They spent days hunting a porting bug, but the cause was single-precision round-off; in double precision orders lined up at 2.00. Keeping the main computation in single precision but doing residuals and some summations in double kept the speed and delivered the needed accuracy.

Common mistakes

Mistakes and fixes

MistakeEffectFix
log₂ with ratio ≠ 2Wrong orderDivide by ln r
Over-refiningRound-off floorUse asymptotic range only
Verifying in single precisionEarly breakdownConfirm in double
Non-smooth manufactured solutionIn-between ordersSmooth functions
Ignoring boundary-formula orderOverall first orderMatch boundary order
🙋

I'd like to learn related topics.

Related fields

Structural AnalysisFluid AnalysisThermal Analysis
Rate this article
Thank you for your feedback!
Helpful
More details
Report error
Helpful
0
More details
0
Report error
0