Dane Sabo 3fdf5eed48 prompt-jump reach: 30x horizon improvement (10s -> 300s sound)
Results from the overnight TMJets run with the prompt-jump model:

  T=60s:   PASSES (10,044 reach-sets, 205 s wall)
  T=300s:  PASSES (27,375 reach-sets, 591 s wall)
  T=1800s+: partial — exhausts 100k step budget past ~300s

At T=300s the envelope is:
  n:      [-0.00156, 0.0103]  (slightly negative = sound overapprox)
  T_c:    [272.4, 295.0] C
  T_f:    [261.2, 302.7] C
  T_cold: [270.0, 289.5] C

Discharges 5/6 inv1_holds safety halfspaces at 300s:
  fuel_centerline:    +897 K margin ✓
  t_avg_high_trip:     +25 K margin ✓
  t_avg_low_trip:      VIOLATED (tube dips to 272.4, limit 280)
  n_high_trip:         huge margin ✓
  cold_leg_subcooled: +15 K margin ✓

The low_trip violation is TUBE looseness, not physical — nominal sim
only dips to ~280 transiently. Fixable by tighter X_entry, higher
orderQ, or refinement. Open item.

Journal updated with full results table + limitation box. scram PJ
reach ready to run but not yet executed (structure similar, simpler).

Fix: siunitx \degreeFahrenheit, \degree, \microsecond now work via
\DeclareSIUnit in preamble. UTF-8 passthrough in listings via
literate= map for Δ, λ, μ, α, β, ρ, Σ, Λ, ≤, ≥, →, ±, °, ×, ε.
Journal now compiles clean: 32 pages, 0 errors.

App v2 Pluto cells land under §§9b–9d: live reach-result ingestion
with computed per-halfspace margins, 2D projection chooser, PJ-reach
overlay placeholder.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 14:45:03 -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().