Manufactured solution Created 2026-10-24 Updated 2026-11-05
A manufactured solution is a deliberately chosen smooth function used to construct a differential equation problem with a known exact answer. Substituting it into the differential equation determines the forcing, while its boundary and initial values determine matching data. The resulting computation tests a numerical implementation against that answer.
For example, on , choose and consider the forced heat equation
Use zero Dirichlet boundary conditions and initial data . Direct differentiation verifies that solves this problem. At a fixed final time, compute an error norm against on successively refined grids. A second-order spatial scheme should show a factor near four when the spatial step is halved, once time, solver and roundoff errors are smaller than the spatial error. This checks the implemented equations and their order of a numerical method; it does not establish that those equations model a particular physical system correctly.
Use a smooth exact solution such as on a domain with matching boundary conditions, and compare numerical and exact values at a fixed physical time. To measure spatial order, halve while making temporal error negligible; the error norm should fall by a factor of four. To measure temporal order, halve on a sufficiently fine fixed spatial grid and again expect a factor of four. Report observed order 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.