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>
plant-model
PWR plant model (point kinetics + lumped thermal-hydraulics) and mode-specific continuous controllers for the HAHACS preliminary example.
Overview
A 10-state coupled neutronics + thermal-hydraulics model in MATLAB:
- 6 delayed neutron precursor groups (U-235 thermal fission, Keepin)
- Lumped fuel, core coolant, and SG/cold-leg thermal nodes
- Steam generator heat removal
Q_sg(t)as the bounded disturbance input - Doppler and moderator temperature reactivity feedback
- External rod reactivity
uas the controllable input
State vector: x = [n; C1..C6; T_f; T_c; T_cold] (10 states). See
CLAUDE.md for the naming convention.
Quick Start
Open MATLAB in this directory and run:
main
The default scenario runs two simulations of a 100% → 80% SG demand step:
once with ctrl_null (plant feedback only) and once with ctrl_operation
(proportional rod reactivity on T_avg error), and plots the comparison.
Files
| File | Role |
|---|---|
main.m |
Entry point — scenario config and run |
pke_params.m |
Plant parameters and steady-state derivation |
pke_th_rhs.m |
Dynamics ẋ = f(t, x, plant, Q_sg, u) |
pke_initial_conditions.m |
Analytic steady-state x0 |
pke_solver.m |
Closed-loop driver — takes a controller function handle |
plot_pke_results.m |
4-panel results plot |
load_profile.m |
SG heat demand shapes |
controllers/ctrl_null.m |
u = 0 baseline |
controllers/ctrl_operation.m |
Stabilizing mode: P on T_avg |
Controllers
Controllers share a single signature:
u = ctrl_<mode>(t, x, plant, ref)
Returns scalar u (external rod reactivity in dk/k). The solver swaps
controllers via function handle:
[t, X, U] = pke_solver(plant, Q_sg, @ctrl_operation, ref, tspan);
Additional modes (ctrl_heatup, ctrl_scram, ctrl_shutdown) will land in
controllers/ following the same signature.
Running Different Scenarios
Swap Q_sg in main.m:
% Step down to 90% at t = 10s
Q_sg = @(t) plant.P0 * (1.0 - 0.1 * (t >= 10));
% Interpolated time series
t_data = [0, 100, 200, 300];
q_data = [1.0, 0.85, 0.9, 1.0] * plant.P0;
Q_sg = @(t) interp1(t_data, q_data, t, 'linear', 'extrap');
Swap the controller:
[t, X, U] = pke_solver(plant, Q_sg, @ctrl_null, [], tspan);
Change the reference (for modes that use one):
ref.T_avg = plant.T_c0 + 5; % track 5 C above nominal
Requirements
MATLAB (R2020b or newer, tested on R2025b). Uses ode15s from base MATLAB
— no toolboxes required.