Skip to content
Mehdi Hassanbeigi
Scientific Computing

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.

Author
Mehdi Hassanbeigi
Published
25 November 2026
Reading time
2 min read
Verifying numerical solvers: how do you know the answer is right?

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

  1. Test against known solutions. Simplified versions of the problem with analytical or manufactured solutions show whether the solver reproduces the exact answer.
  2. 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.
  3. Automate the checks. These tests run automatically after every change, so any loss of accuracy is seen immediately.
  4. Compare with reference results. Where possible, results are checked against published benchmarks or established tools such as COMSOL and Abaqus.
  5. Document the limits. Every model is delivered with its assumptions, valid range and expected accuracy.

Error of a second-order finite-difference solver against grid spacing, on a log-log scale

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
ShareTelegramWhatsAppX

Related articles

Artificial Intelligence

When is machine learning not the answer?

Not every problem needs a machine-learning model. How to choose between rules, statistics and AI, and how to keep an AI system trustworthy once it is live.

25 November 20261 min read

Data Science

From scattered data to better decisions

When data lives in spreadsheets, accounting software and chat messages, every report is late. How to build a reliable data pipeline and a dashboard people actually use.

25 November 20261 min read

Have a problem

Describe it in a few sentences. I will reply with questions, an approach, and an honest view of whether I am the right person for it.