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

Fixing issue #148: replacing '<' with '<=' in all 'ord(t) < tSolveFirst + ......

Fixing issue #148: replacing '<' with '<=' in all 'ord(t) < tSolveFirst + ... restype, 'reserve_length')' in 2d_constraints.gms.
parent 940de654
......@@ -97,7 +97,7 @@ q_balance(gn(grid, node), msft(m, s, f, t)) // Energy/power balance dynamics sol
// NOTE! This could be solved by formulating a new "ft_reserves" set to cover only the relevant forecast-time steps, but it would possibly make the reserves even more confusing.
q_resDemand(restypeDirectionGroup(restype, up_down, group), sft(s, f, t))
${ ord(t) < tSolveFirst + p_groupReserves(group, restype, 'reserve_length')
${ ord(t) <= tSolveFirst + p_groupReserves(group, restype, 'reserve_length')
and not [ restypeReleasedForRealization(restype)
and sft_realized(s, f, t)]
and not restype_inertia(restype)
......@@ -187,7 +187,7 @@ q_resDemand(restypeDirectionGroup(restype, up_down, group), sft(s, f, t))
// NOTE! This could be solved by formulating a new "ft_reserves" set to cover only the relevant forecast-time steps, but it would possibly make the reserves even more confusing.
q_resDemandLargestInfeedUnit(restypeDirectionGroup(restype, 'up', group), unit_fail(unit_), sft(s, f, t))
${ ord(t) < tSolveFirst + p_groupReserves(group, restype, 'reserve_length')
${ ord(t) <= tSolveFirst + p_groupReserves(group, restype, 'reserve_length')
and not [ restypeReleasedForRealization(restype)
and ft_realized(f, t)
]
......@@ -374,7 +374,7 @@ q_rateOfChangeOfFrequencyTransfer(group, gn2n(grid, node_, node_fail), sft(s, f,
// NOTE! This could be solved by formulating a new "ft_reserves" set to cover only the relevant forecast-time steps, but it would possibly make the reserves even more confusing.
q_resDemandLargestInfeedTransfer(restypeDirectionGroup(restype, up_down, group), gn2n(grid, node_left, node_right), sft(s, f, t))
${ ord(t) < tSolveFirst + p_groupReserves(group, restype, 'reserve_length')
${ ord(t) <= tSolveFirst + p_groupReserves(group, restype, 'reserve_length')
and not [ restypeReleasedForRealization(restype)
and sft_realized(s, f, t)]
and gn2n_directional(grid, node_left, node_right)
......@@ -481,7 +481,7 @@ q_maxDownward(gnu(grid, node, unit), msft(m, s, f, t))
${ gnuft(grid, node, unit, f, t)
and (p_gnu(grid, node, unit, 'capacity') or p_gnu(grid, node, unit, 'unitSize'))
and {
[ ord(t) < tSolveFirst + smax(restype, p_gnReserves(grid, node, restype, 'reserve_length')) // Unit is either providing
[ ord(t) <= tSolveFirst + smax(restype, p_gnReserves(grid, node, restype, 'reserve_length')) // Unit is either providing
and sum(restype, gnuRescapable(restype, 'down', grid, node, unit)) // downward reserves
]
// NOTE!!! Could be better to form a gnuft_reserves subset?
......@@ -502,7 +502,7 @@ q_maxDownward(gnu(grid, node, unit), msft(m, s, f, t))
+ v_gen(grid, node, unit, s, f, t)
// Downward reserve participation
- sum(gnuRescapable(restype, 'down', grid, node, unit)${ ord(t) < tSolveFirst + p_gnReserves(grid, node, restype, 'reserve_length')
- sum(gnuRescapable(restype, 'down', grid, node, unit)${ ord(t) <= tSolveFirst + p_gnReserves(grid, node, restype, 'reserve_length')
and not gnuOfflineRescapable(restype, grid, node, unit)
},
+ v_reserve(restype, 'down', grid, node, unit, s, f+df_reserves(grid, node, restype, f, t), t) // (v_reserve can be used only if the unit is capable of providing a particular reserve)
......@@ -585,7 +585,7 @@ q_maxDownwardOfflineReserve(gnu(grid, node, unit), msft(m, s, f, t))
${ gnuft(grid, node, unit, f, t)
and (p_gnu(grid, node, unit, 'capacity') or p_gnu(grid, node, unit, 'unitSize'))
and {
[ ord(t) < tSolveFirst + smax(restype, p_gnReserves(grid, node, restype, 'reserve_length')) // Unit is providing
[ ord(t) <= tSolveFirst + smax(restype, p_gnReserves(grid, node, restype, 'reserve_length')) // Unit is providing
and sum(restype, gnuRescapable(restype, 'down', grid, node, unit)) // downward reserves
]
}
......@@ -598,7 +598,7 @@ q_maxDownwardOfflineReserve(gnu(grid, node, unit), msft(m, s, f, t))
+ v_gen(grid, node, unit, s, f, t)
// Downward reserve participation
- sum(gnuRescapable(restype, 'down', grid, node, unit)${ord(t) < tSolveFirst + p_gnReserves(grid, node, restype, 'reserve_length')},
- sum(gnuRescapable(restype, 'down', grid, node, unit)${ord(t) <= tSolveFirst + p_gnReserves(grid, node, restype, 'reserve_length')},
+ v_reserve(restype, 'down', grid, node, unit, s, f+df_reserves(grid, node, restype, f, t), t)
) // END sum(nuRescapable)
......@@ -635,7 +635,7 @@ q_maxUpward(gnu(grid, node, unit), msft(m, s, f, t))
${ gnuft(grid, node, unit, f, t)
and (p_gnu(grid, node, unit, 'capacity') or p_gnu(grid, node, unit, 'unitSize'))
and {
[ ord(t) < tSolveFirst + smax(restype, p_gnReserves(grid, node, restype, 'reserve_length')) // Unit is either providing
[ ord(t) <= tSolveFirst + smax(restype, p_gnReserves(grid, node, restype, 'reserve_length')) // Unit is either providing
and sum(restype, gnuRescapable(restype, 'up', grid, node, unit)) // upward reserves
]
or [
......@@ -657,7 +657,7 @@ q_maxUpward(gnu(grid, node, unit), msft(m, s, f, t))
+ v_gen(grid, node, unit, s, f, t)
// Upwards reserve participation
+ sum(gnuRescapable(restype, 'up', grid, node, unit)${ ord(t) < tSolveFirst + p_gnReserves(grid, node, restype, 'reserve_length')
+ sum(gnuRescapable(restype, 'up', grid, node, unit)${ ord(t) <= tSolveFirst + p_gnReserves(grid, node, restype, 'reserve_length')
and not gnuOfflineRescapable(restype, grid, node, unit)
},
+ v_reserve(restype, 'up', grid, node, unit, s, f+df_reserves(grid, node, restype, f, t), t)
......@@ -734,7 +734,7 @@ q_maxUpwardOfflineReserve(gnu(grid, node, unit), msft(m, s, f, t))
${ gnuft(grid, node, unit, f, t)
and (p_gnu(grid, node, unit, 'capacity') or p_gnu(grid, node, unit, 'unitSize'))
and {
[ ord(t) < tSolveFirst + smax(restype, p_gnReserves(grid, node, restype, 'reserve_length')) // Unit is providing
[ ord(t) <= tSolveFirst + smax(restype, p_gnReserves(grid, node, restype, 'reserve_length')) // Unit is providing
and sum(restype, gnuRescapable(restype, 'up', grid, node, unit)) // upward reserves
]
}
......@@ -747,7 +747,7 @@ q_maxUpwardOfflineReserve(gnu(grid, node, unit), msft(m, s, f, t))
+ v_gen(grid, node, unit, s, f, t)
// Upwards reserve participation
+ sum(gnuRescapable(restype, 'up', grid, node, unit)${ord(t) < tSolveFirst + p_gnReserves(grid, node, restype, 'reserve_length')},
+ sum(gnuRescapable(restype, 'up', grid, node, unit)${ord(t) <= tSolveFirst + p_gnReserves(grid, node, restype, 'reserve_length')},
+ v_reserve(restype, 'up', grid, node, unit, s, f+df_reserves(grid, node, restype, f, t), t)
) // END sum(nuRescapable)
......@@ -1120,7 +1120,7 @@ q_rampUpLimit(ms(m, s), gnuft_ramp(grid, node, unit, f, t))
// Ramp speed of the unit?
+ v_genRamp(grid, node, unit, s, f, t)
+ sum(gnuRescapable(restype, 'up', grid, node, unit)${ ord(t) < tSolveFirst + p_gnReserves(grid, node, restype, 'reserve_length')
+ sum(gnuRescapable(restype, 'up', grid, node, unit)${ ord(t) <= tSolveFirst + p_gnReserves(grid, node, restype, 'reserve_length')
and not gnuOfflineRescapable(restype, grid, node, unit)
},
+ v_reserve(restype, 'up', grid, node, unit, s, f+df_reserves(grid, node, restype, f, t), t) // (v_reserve can be used only if the unit is capable of providing a particular reserve)
......@@ -1254,7 +1254,7 @@ q_rampDownLimit(ms(m, s), gnuft_ramp(grid, node, unit, f, t))
// Ramp speed of the unit?
+ v_genRamp(grid, node, unit, s, f, t)
- sum(gnuRescapable(restype, 'down', grid, node, unit)${ ord(t) < tSolveFirst + p_gnReserves(grid, node, restype, 'reserve_length')
- sum(gnuRescapable(restype, 'down', grid, node, unit)${ ord(t) <= tSolveFirst + p_gnReserves(grid, node, restype, 'reserve_length')
and not gnuOfflineRescapable(restype, grid, node, unit)
},
+ v_reserve(restype, 'down', grid, node, unit, s, f+df_reserves(grid, node, restype, f, t), t) // (v_reserve can be used only if the unit is capable of providing a particular reserve)
......@@ -2387,7 +2387,7 @@ q_stateUpwardLimit(gn_state(grid, node), msft(m, s, f, t))
// Reserve provision from units that output to this node
+ sum(gn2gnu(grid_, node_input, grid, node, unit)${uft(unit, f, t)},
// Downward reserves from units that output energy to the node
+ sum(gnuRescapable(restype, 'down', grid_, node_input, unit)${ ord(t) < tSolveFirst + p_gnReserves(grid_, node_input, restype, 'reserve_length') },
+ sum(gnuRescapable(restype, 'down', grid_, node_input, unit)${ ord(t) <= tSolveFirst + p_gnReserves(grid_, node_input, restype, 'reserve_length') },
+ v_reserve(restype, 'down', grid_, node_input, unit, s, f+df_reserves(grid_, node_input, restype, f, t), t)
* p_gnReserves(grid_, node_input, restype, 'reserve_activation_duration')
/ p_gnReserves(grid_, node_input, restype, 'reserve_reactivation_time')
......@@ -2401,7 +2401,7 @@ q_stateUpwardLimit(gn_state(grid, node), msft(m, s, f, t))
// Reserve provision from units that take input from this node
+ sum(gn2gnu(grid, node, grid_, node_output, unit)${uft(unit, f, t)},
// Downward reserves from units that use the node as energy input
+ sum(gnuRescapable(restype, 'down', grid_, node_output, unit)${ ord(t) < tSolveFirst + p_gnReserves(grid_, node_output, restype, 'reserve_length') },
+ sum(gnuRescapable(restype, 'down', grid_, node_output, unit)${ ord(t) <= tSolveFirst + p_gnReserves(grid_, node_output, restype, 'reserve_length') },
+ v_reserve(restype, 'down', grid_, node_output, unit, s, f+df_reserves(grid_, node_output, restype, f, t), t)
* p_gnReserves(grid_, node_output, restype, 'reserve_activation_duration')
/ p_gnReserves(grid_, node_output, restype, 'reserve_reactivation_time')
......@@ -2463,7 +2463,7 @@ q_stateDownwardLimit(gn_state(grid, node), msft(m, s, f, t))
// Reserve provision from units that output to this node
+ sum(gn2gnu(grid_, node_input, grid, node, unit)${uft(unit, f, t)},
// Upward reserves from units that output energy to the node
+ sum(gnuRescapable(restype, 'up', grid_, node_input, unit)${ ord(t) < tSolveFirst + p_gnReserves(grid_, node_input, restype, 'reserve_length') },
+ sum(gnuRescapable(restype, 'up', grid_, node_input, unit)${ ord(t) <= tSolveFirst + p_gnReserves(grid_, node_input, restype, 'reserve_length') },
+ v_reserve(restype, 'up', grid_, node_input, unit, s, f+df_reserves(grid_, node_input, restype, f, t), t)
* p_gnReserves(grid_, node_input, restype, 'reserve_activation_duration')
/ p_gnReserves(grid_, node_input, restype, 'reserve_reactivation_time')
......@@ -2477,7 +2477,7 @@ q_stateDownwardLimit(gn_state(grid, node), msft(m, s, f, t))
// Reserve provision from units that take input from this node
+ sum(gn2gnu(grid, node, grid_, node_output, unit)${uft(unit, f, t)},
// Upward reserves from units that use the node as energy input
+ sum(gnuRescapable(restype, 'up', grid_, node_output, unit)${ ord(t) < tSolveFirst + p_gnReserves(grid_, node_output, restype, 'reserve_length') },
+ sum(gnuRescapable(restype, 'up', grid_, node_output, unit)${ ord(t) <= tSolveFirst + p_gnReserves(grid_, node_output, restype, 'reserve_length') },
+ v_reserve(restype, 'up', grid_, node_output, unit, s, f+df_reserves(grid_, node_output, restype, f, t), t)
* p_gnReserves(grid_, node_output, restype, 'reserve_activation_duration')
/ p_gnReserves(grid_, node_output, restype, 'reserve_reactivation_time')
......@@ -2511,7 +2511,7 @@ q_boundStateMaxDiff(gnn_boundState(grid, node, node_), msft(m, s, f, t))
+ sum(gnuRescapable(restype, 'down', grid_, node_input, unit)${ p_gn(grid, node, 'energyStoredPerUnitOfState') // Reserve provisions not applicable if no state energy content
and gn2gnu(grid_, node_input, grid, node, unit)
and uft(unit, f, t)
and ord(t) < tSolveFirst + p_gnReserves(grid_, node, restype, 'reserve_length')
and ord(t) <= tSolveFirst + p_gnReserves(grid_, node, restype, 'reserve_length')
},
+ v_reserve(restype, 'down', grid_, node_input, unit, s, f+df_reserves(grid_, node_input, restype, f, t), t)
* p_gnReserves(grid_, node_input, restype, 'reserve_activation_duration')
......@@ -2526,7 +2526,7 @@ q_boundStateMaxDiff(gnn_boundState(grid, node, node_), msft(m, s, f, t))
+ sum(gnuRescapable(restype, 'down', grid_, node_output, unit)${ p_gn(grid, node, 'energyStoredPerUnitOfState') // Reserve provisions not applicable if no state energy content
and gn2gnu(grid, node, grid_, node_output, unit)
and uft(unit, f, t)
and ord(t) < tSolveFirst + p_gnReserves(grid_, node, restype, 'reserve_length')
and ord(t) <= tSolveFirst + p_gnReserves(grid_, node, restype, 'reserve_length')
},
+ v_reserve(restype, 'down', grid_, node_output, unit, s, f+df_reserves(grid_, node_output, restype, f, t), t)
* p_gnReserves(grid_, node_output, restype, 'reserve_activation_duration')
......@@ -2560,7 +2560,7 @@ q_boundStateMaxDiff(gnn_boundState(grid, node, node_), msft(m, s, f, t))
+ sum(gnuRescapable(restype, 'up', grid_, node_input, unit)${ p_gn(grid, node_, 'energyStoredPerUnitOfState')
and gn2gnu(grid_, node_input, grid, node_, unit)
and uft(unit, f, t)
and ord(t) < tSolveFirst + p_gnReserves(grid_, node, restype, 'reserve_length')
and ord(t) <= tSolveFirst + p_gnReserves(grid_, node, restype, 'reserve_length')
},
+ v_reserve(restype, 'up', grid_, node_input, unit, s, f+df_reserves(grid_, node_input, restype, f, t), t)
* p_gnReserves(grid_, node_input, restype, 'reserve_activation_duration')
......@@ -2575,7 +2575,7 @@ q_boundStateMaxDiff(gnn_boundState(grid, node, node_), msft(m, s, f, t))
+ sum(gnuRescapable(restype, 'up', grid_, node_output, unit)${ p_gn(grid, node_, 'energyStoredPerUnitOfState')
and gn2gnu(grid, node_, grid_, node_output, unit)
and uft(unit, f, t)
and ord(t) < tSolveFirst + p_gnReserves(grid_, node, restype, 'reserve_length')
and ord(t) <= tSolveFirst + p_gnReserves(grid_, node, restype, 'reserve_length')
},
+ v_reserve(restype, 'up', grid_, node_output, unit, s, f+df_reserves(grid_, node_output, restype, f, t), t)
* p_gnReserves(grid_, node_output, restype, 'reserve_activation_duration')
......@@ -2752,12 +2752,12 @@ q_superposStateMin(gn_state(grid, node_superpos(node)), msft(m, s, f, t))..
*--- Upward limit for superpositioned states -----------------
* Note:
* Note:
q_superposStateUpwardLimit(gn_state(grid, node_superpos(node)), mz(m,z))..
// Utilizable headroom in the state variable
// Upper boundary of the variable
+ p_gnBoundaryPropertiesForStates(grid, node, 'upwardLimit', 'constant')${p_gnBoundaryPropertiesForStates(grid, node, 'upwardLimit', 'useConstant')}
......@@ -2779,7 +2779,7 @@ q_superposStateUpwardLimit(gn_state(grid, node_superpos(node)), mz(m,z))..
v_statemax(grid, node, s_)
)
=G= 0
;
......@@ -2811,7 +2811,7 @@ q_superposStateDownwardLimit(gn_state(grid, node_superpos(node)), mz(m,z))..
// Lower boundary of the variable
- p_gnBoundaryPropertiesForStates(grid, node, 'downwardLimit', 'constant')${p_gnBoundaryPropertiesForStates(grid, node, 'downwardLimit', 'useConstant')}
=G= 0
;
......@@ -2824,7 +2824,7 @@ q_superposStateDownwardLimit(gn_state(grid, node_superpos(node)), mz(m,z))..
*--- Minimum Inertia ----------------------------------------------------------
q_inertiaMin(restypeDirectionGroup(restype_inertia, up_down, group), sft(s, f, t))
${ ord(t) < tSolveFirst + p_groupReserves(group, restype_inertia, 'reserve_length')
${ ord(t) <= tSolveFirst + p_groupReserves(group, restype_inertia, 'reserve_length')
and not [ restypeReleasedForRealization(restype_inertia)
and sft_realized(s, f, t)]
and p_groupPolicy(group, 'ROCOF')
......@@ -3266,7 +3266,7 @@ q_energyShareMin(group)
*--- Maximum Share of Reserve Provision ---------------------------------------
q_ReserveShareMax(group, restypeDirectionGroup(restype, up_down, group_), sft(s, f, t))
${ ord(t) < tSolveFirst + p_groupReserves(group_, restype, 'reserve_length')
${ ord(t) <= tSolveFirst + p_groupReserves(group_, restype, 'reserve_length')
and not [ restypeReleasedForRealization(restype)
and sft_realized(s, f, t)]
and p_groupReserves4D(group, restype, up_down, group_, 'ReserveShareMax')
......
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