function f = load_profile(t) % LOAD_PROFILE Returns fractional SG heat demand at time t. % % Output is in [0, 1] where 1.0 = 100% of nominal power P0. % Multiply by P0 to get Q_sg in watts: Q_sg = @(t) P0 * load_profile(t) % % Default profile (load-following): % 0 - 30s: hold at 100% % 30 - 130s: ramp 100% -> 80% % 130 - 350s: hold at 80% % 350 - 450s: ramp 80% -> 100% % 450+: hold at 100% if t < 30 f = 1.0; elseif t < 130 f = 1.0 - 0.2 * (t - 30) / 100; elseif t < 350 f = 0.8; elseif t < 450 f = 0.8 + 0.2 * (t - 350) / 100; else f = 1.0; end end