# Julia port Parallel implementation of the plant model (`../plant-model/`) in Julia, intended as an eventual landing spot for reachability if we outgrow the MATLAB / hand-rolled tooling. ## Status - `src/pke_params.jl`, `src/pke_th_rhs.jl`, `src/pke_linearize.jl` — functional, match MATLAB term-for-term. - `controllers/controllers.jl` — all five modes ported (null, shutdown, heatup, operation, scram). LQR factory included via MatrixEquations.jl. - `scripts/sim_sanity.jl` — closed-loop simulation matches MATLAB to 3 decimals on the 100% → 80% `Q_sg` step. ✅ passing. - `scripts/reach_operation.jl` — ❌ stub. ReachabilityAnalysis.jl algorithms blow up on this stiff, badly-conditioned system. See the file header for diagnosis and planned fix (state rescaling). ## When to prefer Julia over MATLAB Today: nowhere. The sanity path exists so we don't regret the eventual port. Once the reach scaling is resolved: - Nonlinear reach for the P controller in operation mode (CORA / JuliaReach territory where MATLAB's linearization doesn't suffice). - Heatup reach with its time-varying reference. - Parametric studies where MATLAB license fees / CI friction matter. ## Running ```bash cd julia-port julia --project=. -e 'using Pkg; Pkg.instantiate()' julia --project=. scripts/sim_sanity.jl ``` First run will precompile the dependency stack (OrdinaryDiffEq, ReachabilityAnalysis, LazySets — a few minutes).