Folds three previously-separate pieces into one preliminary-example repo for the HAHACS thesis: - thesis/ (submodule) → gitea Thesis.git — the PhD proposal - fret-pipeline/ — FRET requirements to AIGER controller (was ~/Documents/fret_processing/; prior single-commit history abandoned per user decision) - plant-model/ — 10-state PKE + lumped T/H PWR model (was ~/Documents/PKE_Playground/; never version-controlled before) - presentations/2026DICE/ (submodule) → gitea 2026DICE.git - reachability/, hardware/ — empty placeholders for Thrust 3 and HIL - docs/architecture.md — how the discrete and continuous layers compose - claude_memory/ — session notes and scratch knowledge pattern Plant model refactored to thesis naming (x, plant, u, ref); pke_th_rhs now takes u as an explicit arg instead of reading rho_ext from the params struct. First two controllers built to the contract u = ctrl_<mode>(t, x, plant, ref): ctrl_null (baseline) and ctrl_operation (stabilizing, proportional on T_avg). Validated under a 100% -> 80% Q_sg step: ctrl_operation reduces steady-state T_avg drift ~47% vs. the unforced plant. Root CLAUDE.md emphasizes that CLAUDE.md files are living documents and that any knowledge not captured before a session ends is lost forever; claude_memory/ holds the session-level notes that haven't stabilized enough to graduate into a CLAUDE.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
32 lines
1.2 KiB
Matlab
32 lines
1.2 KiB
Matlab
function u = ctrl_operation(t, x, plant, ref)
|
|
% CTRL_OPERATION Stabilizing mode controller: hold T_avg at ref.T_avg.
|
|
%
|
|
% Proportional feedback on external reactivity (rod worth) driven by
|
|
% temperature error:
|
|
% u = Kp * (ref.T_avg - T_avg)
|
|
%
|
|
% Sign check: when T_avg > ref.T_avg, error < 0, u < 0 → rods insert,
|
|
% power drops, T_avg falls. Correct polarity for a PWR.
|
|
%
|
|
% Gain Kp is a rough-out value. Scale reasoning:
|
|
% - alpha_c ~ -1e-4 /K means the moderator already supplies 1e-4/K of
|
|
% restoring reactivity per Kelvin of temperature error.
|
|
% - Kp = 1e-4 /K roughly doubles the effective moderator coefficient —
|
|
% it damps transients without overwhelming the intrinsic feedback.
|
|
% - Real PWR rod controllers use much smaller gains with a deadband.
|
|
% We can retune or switch to PI once we care about steady-state offset.
|
|
%
|
|
% Inputs:
|
|
% t - time [s] (unused in this controller, kept for signature)
|
|
% x - state vector (10 x 1)
|
|
% plant - parameter struct (unused here; reserved for future gain-scheduling)
|
|
% ref - struct with field .T_avg = target average coolant temperature [C]
|
|
|
|
Kp = 1e-4; % [dk/k per K]
|
|
|
|
T_avg = x(9);
|
|
e = ref.T_avg - T_avg;
|
|
u = Kp * e;
|
|
|
|
end
|