Usage — overview¶
Practical guides on how to use the repository in real operation.
Contents¶
- UKF in practice — how to configure the Square-Root UKF for
a concrete plant: theadm1da_full_spec()factory,ObservationModelchannels,MeasurementCalendarfor sparse lab samples, online loop. - Twin experiments — end-to-end validation
against a known truth; the bundledrun_twin_experiment.pyand interpretation of the diagnostic plots. - Calibration artifact — the YAML handoff
format between calibration and estimation, and how the filter applies it at startup.
Big picture¶
In live operation, the data flow is:
Historical measurements ──► PyADM1ODE_calibration ──► calibrated model
│
Live sensors ──────────────────────────────────────► PyADM1ODE_estimate
│
▼
State estimate x_hat
│
▼
Controller / UI
Steps for a new setup:
- Build the plant via PyADM1ODE — either via the example
buildersbuild_simple_plant()/build_multi_stage_plant()inexample_plants/or via your ownPlantConfigurator-based builder. - Load the calibrated artifact via
load_artifact(...)and apply
it withapply_to_plant(...). - Build the state-vector spec via the
adm1da_full_spec()
factory — it produces all 41 ADM1 states with observability-driven defaults. Attach substrate inputs as anInputSpeclist. With non-Phase-1 sensors, upgrade individual blocks viaSensorQualityProfile. - Wire the observation model to the available sensor channels —
the built-in extractors cover Q_gas, Q_ch4, P_el, P_th_used, stored_volume and direct state read-out. - Attach a MeasurementCalendar for sample-rate management if
measurements arrive at different rates. - Instantiate the SR-UKF (= the current
UnscentedKalmanFilter),
callukf.reset(x0, P0)with realistic initial covariance, and alternatepredict()andupdate()in the online loop. - Before production: run a twin experiment, check mean NIS and
coverage (see twin experiments).