PWR-HYBRID-3/README.md
Dane Sabo bc3a6028a9 docs: flag soundness, alpha-drift, saturation-hybrid in file headers
Three caveats surfaced during walkthrough lived only in the
conversation transcript before this commit.  Now they live where
future agents and future-me will actually see them:

- reach_operation.m and reachability/README.md state prominently that
  the current reach tube is an over-approximation of the LINEAR
  model, not a sound tube for the nonlinear plant.  Thesis-blocking
  for a real safety claim.  Upgrade paths documented.

- ctrl_heatup.m header and plant-model/CLAUDE.md note that the
  feedback-linearization u_ff assumes exact alpha_f, alpha_c.  Real
  plants drift (burnup ~20%, boron ~10x, xenon).  Robust treatment =
  parametric reach with alpha as an interval.

- ctrl_heatup.m header and plant-model/CLAUDE.md note that sat() is
  formally a 3-mode piecewise-affine sub-system.  Operation-mode LQR
  is dormant (trivially); heatup will need either a dormancy proof
  or explicit hybrid modeling.

README.md top-level now has a run-commands table for the reach
artifacts and a pointer to the soundness status.

Hacker-Split: raise caveats from transcript to artifact so the work
is actually reviewable by people who weren't in the room.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 16:15:39 -04:00

87 lines
3.2 KiB
Markdown

# pwr-hybrid-3-demo
Preliminary example for the HAHACS thesis — a verified hybrid controller for
a small modular PWR startup. Composes three layers into one demonstrable
pipeline:
- **Discrete layer** (`fret-pipeline/`): FRET natural-language requirements
→ LTL → synthesized AIGER controller → state-machine diagram.
- **Continuous layer** (`plant-model/`): 10-state point kinetic equation +
thermal-hydraulics PWR model with bounded steam-generator heat removal as
the disturbance input.
- **Research context** (`thesis/`): the HAHACS PhD proposal that motivates
and formalizes the methodology.
## Layout
```
pwr-hybrid-3-demo/
CLAUDE.md AI-facing context and architecture map
docs/
architecture.md How the discrete and continuous layers compose
figures/ Shared figures for thesis + talks
fret-pipeline/ FRET → ltlsynt → AIGER → state machine
plant-model/ PWR point kinetics + thermal-hydraulics
reachability/ Continuous-mode verification (linear-model tube + Lyapunov barrier attempt; see README)
julia-port/ Parallel plant-model port + ReachabilityAnalysis.jl scaffold
hardware/ Ovation HIL artifacts (TBD)
claude_memory/ Session notes by AI agents (distilled up into CLAUDE.md over time)
thesis/ [submodule] PhD proposal
presentations/
2026DICE/ [submodule] DICE 2026 abstract
```
## Quickstart
Clone with submodules:
```bash
git clone --recurse-submodules <url>
cd pwr-hybrid-3-demo
```
Run the controller synthesis pipeline:
```bash
cd fret-pipeline
python3 scripts/fret_to_synth.py pwr_hybrid_3.json specs/synthesis_config_v3.json
bash scripts/synthesize.sh specs/synthesis_config_v3.json circuits
python3 scripts/trace_aiger.py circuits/PWR_HYBRID_3_DRC.aag diagrams
dot -Tpng diagrams/PWR_HYBRID_3_DRC_states.dot -o diagrams/PWR_HYBRID_3_DRC_states.png
```
Run the plant model (MATLAB in `plant-model/` — Octave compatibility not tested since the LQR pieces landed):
```matlab
main % original single-scenario demo (null vs operation)
main_mode_sweep % all five DRC modes back-to-back, writes to ../docs/figures/
test_linearize % Jacobian sanity check, saves linearization for reach
```
Run the reach artifacts (`reachability/`):
```matlab
reach_operation % linear reach tube for operation-mode LQR
barrier_lyapunov % Lyapunov-ellipsoid barrier cert attempt (sweeps weights)
```
**Soundness note:** the current reach tube is the LINEAR model's tube;
it is not yet a sound over-approximation of the nonlinear plant. See
`reachability/README.md` § Soundness status.
## Prerequisites
- Python 3.10+
- [Spot](https://spot.lre.epita.fr/) for `ltlsynt` (`brew install spot`)
- [Graphviz](https://graphviz.org/) for `dot` (`brew install graphviz`)
- MATLAB or GNU Octave for the plant model
- LaTeX (via `latexmk`) for the thesis submodule
## Further reading
- `CLAUDE.md` — orientation for AI agents working in this repo
- `docs/architecture.md` — how the layers compose
- `thesis/CLAUDE.md` — the thesis project structure
- `fret-pipeline/README.md` — FRET naming conventions and pipeline details
- `plant-model/README.md` — scenario setup and model equations