= Manufactured solution
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 $0<x<1$, choose $u_*(x,t)=e^{-t}\sin(\pi x)$ and consider the forced <heat equation>
$$
u_t-u_{xx}=f(x,t),\qquad f=(\pi^2-1)e^{-t}\sin(\pi x).
$$
Use zero <Dirichlet boundary conditions> and initial data $u(x,0)=\sin(\pi x)$. Direct <differentiation> verifies that $u_*$ solves this problem. At a fixed final time, compute an <error norm> against $u_*$ 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.
Back to article page