Semidiscretization (source code)

= Semidiscretization

<Semidiscretization> discretizes some variables of a differential equation while leaving others continuous. A spatial discretization of the heat equation $u_t=\kappa u_{xx}$ gives interior grid values satisfying
$$
\dot U_i=\kappa\frac{U_{i-1}-2U_i+U_{i+1}}{\Delta x^2}.
$$
Boundary values complete this <ordinary differential equation> system; time has not yet been replaced by a sequence of steps.

Applying explicit Euler later gives a fully discrete method with stability restriction $\kappa\Delta t/\Delta x^2\leq1/2$ for the standard uniform-grid diffusion model. Keeping the two stages separate makes spatial approximation error distinct from time-integration error and allows a different time solver to be used with the same spatial operator.<Finite Difference Computing with PDEs by Hans Petter Langtangen and Svein Linge>[Chapter 3, spatial second differences and time-stepping diffusion]{ref}