PyModPDE
Initialising Python runtime…
PyModPDE Modified Equation Analysis
Loading…
1
Define your PDE Build the continuous right-hand side by dragging or clicking terms
Dep. var
Dimension
x =
y =
z =
∂u/∂t
=
drag or click terms from above…
2
Discretise each term Choose stencil, time level, and coefficient for each RHS term
Add terms in step 1 to configure their discretisation here.
3
Generate Modified Equation
Number of ME terms beyond leading order 3
Modified Equation
font size 90%
Modified Equation
Amplification Factor
G = eαΔt
Coefficients
OrderIndexCoefficient expression
LaTeX
Modified Equation
Amplification Factor
§
The Modified Equation Theory lifted from Karam, Sutherland & Saad (2020)

When a finite difference scheme is applied to a PDE, it does not solve the original equation exactly — it solves a different PDE entirely, known as the modified equation. This equation accounts for the truncation error introduced by the discretisation and reveals the true physics being simulated. Odd-order derivative terms correspond to advection and dispersion; even-order terms correspond to diffusion. The coefficients of the modified equation allow one to make rational arguments about stability, numerical diffusion, and numerical dispersion.

1D form

For a linear PDE with constant coefficients and a corresponding difference scheme, the modified equation takes the general form

where the coefficients \(a_i\) are not, in general, equal to the coefficients of the original PDE. The leading even-order coefficient \(a_2\) governs numerical diffusion; the leading odd-order coefficient beyond \(a_1\) governs numerical dispersion.

2D form

In two spatial dimensions the modified equation takes the form

Note the cross-derivative term \(a_{11}u_{xy}\), which is absent from the 1D analysis. It introduces anisotropic diffusion — the scheme behaves differently in different spatial directions. The coefficients \(a_{jl}\) carry a double index \((j,l)\) denoting the order of differentiation in \(x\) and \(y\) respectively.

Interpreting the coefficients
Advection
Odd-order terms (\(u_x,\,u_{xxx},\ldots\)). \(a_1\) recovers the original wave speed; higher odd terms represent numerical dispersion.
Diffusion
Even-order terms (\(u_{xx},\,u_{xxxx},\ldots\)). \(a_2 > 0\) means the scheme adds numerical dissipation; \(a_2 < 0\) means it is anti-diffusive (unstable).
Anisotropy (2D+)
Cross-derivative terms (\(u_{xy},\,\ldots\)). Non-zero \(a_{11}\) causes the scheme to behave asymmetrically across spatial directions.
📄
Citation
Karam, M., Sutherland, J. C., & Saad, T. (2020). PyModPDE: A Python software for modified equation analysis. SoftwareX, 12, 100541. doi:10.1016/j.softx.2020.100541 ↗