"""
    pke_params()

Return a NamedTuple with all plant parameters and derived steady-state
conditions for the PKE + thermal-hydraulics model.

Single free parameter: `T_cold0` (full-power cold-leg temperature).
Everything else is derived from energy balance at full power.  A
hidden constraint underneath every other number — looks ordinary on
the surface but is something else underneath.

See ../../journal/entries/2026-04-17-controllers-linear-reach.tex
§ Plant-model recap for the full derivation.  The MATLAB original's
inline source citations (Duderstadt, Keepin, Todreas, MATPRO, IAPWS)
are preserved in git history pre-2026-04-20 evening.

Kept as a NamedTuple rather than a struct so reach tools (`@taylorize`)
can see through to the constants — see code/CLAUDE.md.
"""
function pke_params()
    # --- Neutronics ---
    Lambda = 1e-4
    beta_i = [0.000215, 0.001424, 0.001274, 0.002568, 0.000748, 0.000273]
    lambda_i = [0.0124, 0.0305, 0.111, 0.301, 1.14, 3.01]
    beta = sum(beta_i)

    # --- Thermal-hydraulic ---
    P0   = 1000e6
    M_f  = 50000.0
    c_f  = 300.0
    M_c  = 20000.0
    c_c  = 5450.0
    hA   = 5e7
    W    = 5000.0
    M_sg = 30000.0

    # --- Reactivity feedback coefficients ---
    alpha_f = -2.5e-5
    alpha_c = -1.0e-4

    # --- Derived steady-state (full-power equilibrium) ---
    T_cold0 = 290.0
    dT_core = P0 / (W * c_c)
    T_hot0  = T_cold0 + dT_core
    T_c0    = (T_hot0 + T_cold0) / 2
    T_f0    = T_c0 + P0 / hA

    return (; Lambda, beta_i, lambda_i, beta, P0, M_f, c_f, M_c, c_c, hA,
             W, M_sg, alpha_f, alpha_c, T_cold0, T_hot0, T_c0, T_f0, dT_core)
end

"""
    pke_initial_conditions(plant)

Full-power steady state: n=1, precursors at equilibrium, temperatures at
(T_f0, T_c0, T_cold0).  Returns a 10-element Vector.
"""
function pke_initial_conditions(plant)
    n0 = 1.0
    C0 = (plant.beta_i ./ (plant.lambda_i .* plant.Lambda)) .* n0
    return [n0; C0; plant.T_f0; plant.T_c0; plant.T_cold0]
end
