cpp_exact, a C++ code which evaluates exact solutions to a few selected examples of ordinary differential equations (ODE) and partial differential equations (PDE).
These exact solutions can be used to test out the correctness of a solution algorithm.
The information on this web page is distributed under the MIT license.
cpp_exact is available in a C version and a C++ version and a Fortran77 version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.
biharmonic_exact, a C++ code which evaluates exact solutions w(x,y) to the biharmonic equation del^2 w = 0 or wxxxx + 2 wxxyy + wyyyy = 0
burgers_exact, a C++ code which evaluates several exact solutions u(x,t) of the time-dependent 1D viscous Burgers equation.
continuity_exact, a C++ code which returns a 2D velocity vector field (u,v)(x,y) which is an exact solution of the partial differential equation (PDE) sometimes called the continuity equation of fluid mechanics, which has the form ux + vy = 0.
fisher_exact, a C++ code which returns an exact solution u(x,t) of the Kolmogorov Petrovsky Piskonov Fisher partial differential equation (PDE): ut=uxx+u*(1-u).
flame_exact, a C++ code which returns the exact solution y(t) of an ordinary differential equation (ODE) which models the growth of a ball of flame in a combustion process. The exact solution is defined in terms of the Lambert W function.
helmholtz_exact, a C++ code which evaluates an exact solution z(x,y) for the Helmholtz equation, a sort of eigenvalue version of a partial differential equation (PDE) arising after separation of variables is a applied to the wave equation. This example considers a problem in which z(x,y) represents the vertical deflection of the surface of a vibrating circular membrane such as a drumhead. The Helmholtz equation has the form - del^2 Z = k^2 Z.
kdv_exact, a C++ code which evaluates an exact solution u(x,t) of the Korteweg-deVries (KdV) partial differential equation (PDE), representing the motion of a soliton. The equation has the form u' - 6 u ux + uxxx = 0.
laplace_radial_exact, a C++ code which evaluates exact solutions u(x,y) or u(x,y,z), with radial symmetry, to the Laplace partial differential equation (PDE): del^2 U = 0.
logistic_exact, a C++ code which evaluates an exact solution y(t) of the logistic equation, which models population growth in the face of a limited carrying capacity, an ordinary differential equation (ODE) of the y' = r * ( y - y^2 / k ).
minimal_surface_exact, a C++ code which evaluates exact solutions u(x,y) to the minimal surface equation: (1+Ux^2) Uyy - 2 Ux Uy Uxy + (1+Uy^2) Uxx = 0
navier_stokes_2d_exact, a C++ code which evaluates an exact solution to the incompressible time-dependent Navier-Stokes equations (NSE) over an arbitrary domain in 2D.
navier_stokes_3d_exact, a C++ code which evaluates an exact solution to the incompressible time-dependent Navier-Stokes equations (NSE) over an arbitrary domain in 3D.
porous_medium_exact, a C++ code which returns an exact solution u(x,t) of the porous medium equation (PME), related to the diffusion equation, and based on the Barenblatt solution. The partial differential equation (PDE) has the form dudt=Del^2(u^m). This system reduces to a diffusion equation if the exponent m is set to 1.
sine_gordon_exact, a C++ code which returns an exact solution of the Sine-Gordon equation, a partial differential equation (PDE) of the form uxy=sin(u).
standing_wave_exact, a C++ code which returns an exact standing wave solution u(x,t) of the partial differential equation (PDE): utt = c^2 uxx, describing a wave in a 1D spatial region with propagation speed c.
stokes_2d_exact, a C++ code which evaluates exact solutions (u,v,p)(x,y) to the incompressible steady Stokes equations in 2D, which are a system of partial differential equations (PDE) of the form: -uxx-uyy+px=f, -vxx-vyy+py=g, ux+vy=h.
traveling_wave_exact, a C++ code which returns an exact traveling wave solution u(x,t) of the partial differential equation (PDE): utt = c^2 uxx, describing a wave in a 1D spatial region with propagation speed c.