Commit c9f41b92 authored by Niina Helistö's avatar Niina Helistö
Browse files

Updates related to the loop over group reserve horizon when recording results....

Updates related to the loop over group reserve horizon when recording results. The loop used to be very slow for large f, t sets.
parent 5acf4818
......@@ -90,11 +90,11 @@ loop(s,
); // END loop(restypeDirectionNode, sft)
// Loop over group reserve horizon
loop((restypeDirectionGroup(restype, up_down, group), f_(f+df_reservesGroup(group, restype, f, t)), sft(s, f, startp(t)))
loop((restypeDirectionGroup(restype, up_down, group), sft(s, f, startp(t)))
${ord(t) <= tSolveFirst + p_groupReserves(group, restype, 'reserve_length')},
// Reserve requirement due to N-1 reserve constraint
r_resDemandLargestInfeedUnit(restype, 'up', group, f_, t)
r_resDemandLargestInfeedUnit(restype, 'up', group, f_(f+df_reservesGroup(group, restype, f, t)), t)
${ sum((gnGroup(gn, group),unit_fail)$p_gnuReserves(gn, unit_fail, restype, 'portion_of_infeed_to_reserve'),1) } // Calculate only for groups with units that can fail.
= smax((gnGroup(gn, group),unit_fail)$p_gnuReserves(gn, unit_fail, restype, 'portion_of_infeed_to_reserve'),
+ v_gen.l(gn, unit_fail, s, f, t)
......@@ -102,10 +102,10 @@ loop((restypeDirectionGroup(restype, up_down, group), f_(f+df_reservesGroup(grou
) // END smax(unit_fail)
;
// Dummy reserve demand changes
r_qResDemand(restype, up_down, group, f_, t)
r_qResDemand(restype, up_down, group, f_(f+df_reservesGroup(group, restype, f, t)), t)
= vq_resDemand.l(restype, up_down, group, s, f_, t);
r_qResMissing(restype, up_down, group, f_, t)
r_qResMissing(restype, up_down, group, f_(f+df_reservesGroup(group, restype, f, t)), t)
= vq_resMissing.l(restype, up_down, group, s, f_, t);
); // END loop(restypeDirectionGroup, sft)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment