# DLEGOS mathematical development laboratory

This companion is executable numerical and inverse-model development, using constructed data only. It does not reproduce NowcastNet, TimesFM or WeatherNext, train on Jamaican observations, validate a rainfall forecast, or solve a complete atmospheric system.

## Reproduce

Tested with Python 3.12.14 and NumPy 2.3.5.

```bash
python -m pip install -r requirements.txt
python climate_math_lab.py --output results
```

The script performs its checks before writing results. It trains a 3 -> 8 tanh -> 1 softplus edge network for 1,200 full-batch Adam steps, with seed 23. The loss uses 192 constructed temperature-tendency fields. The held-out test uses 96 new constructed fields on the same graph; this is not geographic transfer.

## Executable components

- `graph_system`: 12 nodes, 11 internal faces, positive capacities, constructed descriptors and target conductances.
- `rates` and `step`: paired shared-face fluxes and an explicit convexity step bound.
- `EdgeMLP.loss_gradient`: complete NumPy manual backward pass.
- `gradient_check`: centred finite differences for five parameter entries.
- `advection_check`: exact cell-average comparison at four grid sizes.
- `weighted_projection`: a linear-system equality correction; non-negativity is not guaranteed.
- `crps_ensemble`: empirical and fair CRPS with explicit member-count rules.

## Units and assumptions

Temperature is in K, capacities are deliberately small constructed J/K quantities, conductance is W/K and time is seconds. The graph is closed, geometry is fixed, only sensible-heat exchange is modelled, and there is no external forcing. Edge descriptors are dimensionless. The positive output uses a conductance scale of 1 W/K. These quantities are not atmospheric calibrations.

Energy conservation is built into the incidence update; this exercise does not independently demonstrate a benefit of conservation over another neural architecture. The target and learner use the same class of graph diffusion operator. Noise, unknown source terms, unseen graph topology and partial observations are not tested.

## Outputs and provenance

`results/report.json` records all emitted values and versions. CSV files retain training, rollout, edge-coefficient and mesh-refinement data. `results/weights.json` stores the learned parameters. Small floating-point differences can occur across software and linear-algebra environments; the source assertions use tolerances rather than bitwise equality.

`checksums.json` hashes the source, requirements, report, weights and CSVs. The notebook provides an alternative entry point and uses this same source.

Primary method references: Clawpack finite-volume documentation (https://www.clawpack.org/riemann_book/html/Approximate_solvers.html); Kingma and Ba, Adam (https://arxiv.org/abs/1412.6980). The full derivations and source distinctions appear on climatephysicsai.com/papers/development.html.

Author: Adrian Dunkley. AI-assisted development draft for author review. No peer-review or institutional endorsement is asserted.
