Skip to content

Run the numerical laboratories

Download the laboratory bundle and extract it. It contains the programs, pinned dependencies, exact test cases, and saved results. The inventory maps each program to its mathematical explanation and records its checksum.

The selected suite covers the two starters and several advanced examples. Each test has a limited claim. A passing computation supplies numerical evidence for that example; it does not establish a theorem for a new equation.

The recorded environment uses CPython 3.12, with mpmath==1.3.0, numpy==2.0.2, scipy==1.13.1, and sympy==1.14.0. These versions preserve the tested baseline. Enter the extracted advanced-ode-labs directory and run:

Terminal window
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python run-checks.py --profile fast --output fast-results.json

On Windows, using the Python launcher, run these commands without activation:

Terminal window
py -3.12 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
.\.venv\Scripts\python.exe run-checks.py --profile fast --output fast-results.json
.\.venv\Scripts\python.exe run-checks.py --profile extended --output extended-results.json

Python 3.10 or later is accepted by the runner, but the saved results identify the interpreter actually tested. Installation downloads dependencies; the experiments then run without network access. A different package version is rejected unless you explicitly use --allow-environment-drift, which records the differences.

The separate ZIP checksum can be checked with shasum -a 256 advanced-ode-labs.zip before extraction.

ExperimentRead before runningWhat is compared
Gauss connectionFirst connection problemLocal series at three points, gamma coefficients, the ODE, and Abel’s identity
Weber spectrumFirst spectral problemExact Wronskians and a finite-difference spectrum with independent mesh and endpoint refinements
Heun matchingAppendix C micro-labEvery matrix entry at two valid match points and both Abel determinants

The fast profile includes these positive controls and adverse cases: too few Gauss terms, an inadequate Weber interval, underresolved Heun matching, and an invalid second Heun match point. The latter computations must be rejected.

Terminal window
python run-checks.py --case weber --output weber-result.json
python run-checks.py --list --profile extended
python run-checks.py --profile extended --output extended-results.json

The extended profile also exercises the generic isomonodromy comparison, the scalar Schwarzschild mode, the quartic TBA spectrum, and the declared NS comparison. Use --list or checks.json for the exact cases in this revision. Advanced cases take longer because they repeat independent numerical controls.

A successful suite exits with code 0 and reports PASS: N declared cases. The JSON stores a portable command template, mathematical purpose, expected and actual exit codes, complete output, elapsed time, environment, and source hashes. A case labeled expected rejection passes only if the scientific calculation fails in the documented way. A failed suite exits 1; an invalid runner request or unsupported environment exits 2. In the command template, python denotes the current interpreter and {result_json} denotes a temporary file whose full contents are included as scientific_record. Substitute an output filename to run that command by hand.

For example, the default Gauss calculation agrees with the exact connection coefficients below its 103010^{-30} threshold. The default Weber threshold is 2×1072\times10^{-7} in units of \hbar; a small mesh drift alone does not pass when the finite interval gives the wrong whole-line spectrum. The scalar Schwarzschild laboratory compares an arbitrary-precision continued fraction with a binary64 ODE calculation: the smaller continued-fraction residual does not give the ODE result extra digits.

Compare your output with the saved fast record and extended record. First compare source hashes and parameters, then the refinement errors and tolerances. Timings and the last floating-point digits may vary across platforms. These computations provide convergence and cross-method evidence; they do not provide interval enclosures unless a particular page explicitly constructs them.

Supplemental programs are included for the other chapter experiments and imports. They are marked separately in the inventory; the selected suite does not exercise all of them. For their algorithms and interpretation, use the linked pages and source docstrings. Appendix C explains how to design a new experiment and record its limitations.