Dane Sabo 645f2d8d27 prompt-jump model + app v2 + overnight journal entry (in progress)
Singular-perturbation reduction of the PKE+T/H system: set dn/dt=0,
solve algebraically n = Λ·Σλ_i·C_i / (β-ρ). State drops 10 -> 9 (no
n), removes Λ⁻¹ stiffness. Validated against full state on the heatup
scenario:

  t [s]    |Δn|/n_full   T_c err [K]
  60       3.7e-5        4e-6
  300      3.8e-4        1.9e-4
  1200     1.0e-3        2.2e-3
  3000     5.0e-4        7.2e-3

Maximum relative error 0.1% on n, peak 7 mK on temperatures over
50 minutes.  PJ approximation is excellent for slow heatup transients
(sub-prompt-critical regime).

Files:
  - code/src/pke_th_rhs_pj.jl: reduced 9-state RHS
  - code/scripts/validate_pj.jl: side-by-side sim
  - code/scripts/reach_heatup_pj.jl: TMJets reach with PJ model
    (probing T = 60, 300, 1800, 5400 s)

App v2 (Pluto):
  - §9b: live ingestion of reach_operation_result.mat with per-
    halfspace margins computed from JSON-defined inv2_holds.
  - §9c: 2D projection chooser (n, T_f, T_c, T_cold) with reach
    tube envelope overlay.
  - §9d: PJ heatup reach summary (placeholder until first run lands).

Journal:
  - Added 2026-04-20-overnight-prompt-jump.tex with PJ derivation,
    validation table, soundness ledger update.  apass markers for
    the in-progress reach results.

This commit captures state mid-run; next commit will add the
populated reach results once TMJets returns.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 22:45:24 -04:00
..

code

Plant model, controllers, and reach-analysis toolchain for the HAHACS preliminary example. All Julia.

What this is

A 10-state coupled neutronics + thermal-hydraulics model (point kinetic equations + lumped thermal loop) with continuous-mode controllers for each of the DRC modes (shutdown, heatup, operation, scram), plus a hand-rolled linear reach-tube propagator, a Lyapunov-ellipsoid barrier attempt, and scaffolding for TMJets-based nonlinear reach.

Ported from MATLAB on 2026-04-20 once the reach experiments made it clear that Julia's stack (OrdinaryDiffEq, MatrixEquations, ReachabilityAnalysis, LazySets, @taylorize) was the right tool for everything we need going forward. The MATLAB originals are in the git history.

Running

First time:

cd code
julia --project=. -e 'using Pkg; Pkg.instantiate()'

Subsequent:

julia --project=. scripts/main_mode_sweep.jl          # all 5 DRC modes, figures
julia --project=. scripts/reach_operation.jl          # operation-mode linear reach
julia --project=. scripts/barrier_lyapunov.jl         # Lyapunov barrier attempt
julia --project=. scripts/barrier_compare_OL_CL.jl    # OL vs CL barrier
julia --project=. scripts/reach_heatup_nonlinear.jl   # nonlinear heatup (10s cap)

Figures save to ../docs/figures/. Reach results save to ../reachability/*.mat (gitignored).

Structure

See CLAUDE.md for the architectural overview and ../journal/ for the invention-log-style narrative of how this code got written.

Dependencies

From Project.toml:

  • OrdinaryDiffEq — ODE solver, Rodas5 for stiff systems.
  • MatrixEquationsarec for LQR Riccati, lyapc for Lyapunov.
  • ReachabilityAnalysis + LazySets — reach sets and set operations.
  • Plots — figures (GR backend by default).
  • JSON — read ../reachability/predicates.json.
  • MAT — save results.

Manifest.toml is gitignored; regenerate locally on first Pkg.instantiate().