Verifying numerical solvers: how do you know the answer is right?
A simulation that runs without errors is not necessarily correct. How analytical solutions, convergence studies and automated tests make numerical results trustworthy.
- Mehdi Hassanbeigi
- 25 November 2026
- 2 min read

Scientific Computing, the combination of applied mathematics and computer science, solves problems that have no simple closed-form answer: heat transfer and stress in structures, fluid flow, batteries and chemical reactions. Its most dangerous failure is silent: a simulation that runs without a single error message and produces a smooth, plausible result that is still wrong.
The challenges
- Plausible but wrong. A sign error or a wrong boundary condition can produce a result that looks perfectly reasonable.
- Tangled sources of error. Discretisation error, modelling error and software bugs are easily mistaken for one another.
- No exact answer for the real problem. Real geometries and materials rarely have an analytical solution to compare against.
- Silent regressions. A small code change can reduce accuracy without anyone noticing.
How we solve it
- Test against known solutions. Simplified versions of the problem with analytical or manufactured solutions show whether the solver reproduces the exact answer.
- Run a convergence study. As the mesh is refined, the error must fall at the theoretical rate; for a second-order method, halving the grid spacing should divide the error by about four.
- Automate the checks. These tests run automatically after every change, so any loss of accuracy is seen immediately.
- Compare with reference results. Where possible, results are checked against published benchmarks or established tools such as COMSOL and Abaqus.
- Document the limits. Every model is delivered with its assumptions, valid range and expected accuracy.

The chart above comes from a real run: a second-order finite-difference solver for a one-dimensional Poisson equation whose exact solution is sin(πx). Each time the grid spacing h is halved, the maximum error falls by about a factor of four, exactly the slope-two line the theory predicts.
- Scientific computing
- Numerical methods
- Simulation



