Fundamentals / Numerical mathematics / Approximation and quadrature / Notebooks

Three nodes sampling a Gaussian ensemble

A dimensionless variable has probability density exp(−x²)/√π. Estimate its mean response to cos(ωx) by a three-node Hermite rule, then compare with the exact Gaussian Fourier transform. Vary the carrier and see whether exact low moments protect every observable.

Change parameters · Explore the notebook example

Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.

Save notebook (.ipynb)

Python runs on this device. The first run loads the scientific libraries.

Inspect what the nodes measure

The curve on the left gives the density-weighted integrand. The vertical lines locate the Hermite sampling coordinates. The right panel shows the exact and discrete responses over a wider range of frequency.

Independent reference

Use NumPy's higher-order Gauss–Hermite rule and remove its unnormalised weight √π. At large frequencies three nodes cannot resolve phase cancellations.