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

Adding two constraints in order to make the transfer constraints tighter

- q_transferTwoWayLimit1 is used if investments not enabled
- q_transferTwoWayLimit2 is used if investments enabled and initial capacities are the same in both directions

If investments are enabled and initial capacities are not the same in both directions, a similar constraint would become nonlinear.

Issue #158
parent a85f13a6
......@@ -68,6 +68,8 @@ Model building /
* q_resTransferLimitLeftward
* q_reserveProvisionRightward
* q_reserveProvisionLeftward
q_transferTwoWayLimit1
* q_transferTwoWayLimit2
// State Variables
q_stateSlack
......@@ -83,7 +85,7 @@ Model building /
* q_capacityMargin
* q_constrainedCapMultiUnit
* q_emissioncap
* q_energyMax
* q_energyMax
* q_energyShareMax
* q_energyShareMin
* q_ReserveShareMax
......
......@@ -68,6 +68,8 @@ Model invest /
q_resTransferLimitLeftward
q_reserveProvisionRightward
q_reserveProvisionLeftward
q_transferTwoWayLimit1
q_transferTwoWayLimit2
// State Variables
q_stateSlack
......
......@@ -68,6 +68,8 @@ Model schedule /
q_resTransferLimitLeftward
* q_reserveProvisionRightward
* q_reserveProvisionLeftward
q_transferTwoWayLimit1
* q_transferTwoWayLimit2
// State Variables
q_stateSlack
......@@ -83,7 +85,7 @@ Model schedule /
q_capacityMargin
* q_constrainedCapMultiUnit
* q_emissioncap
* q_energyMax
* q_energyMax
* q_energyShareMax
* q_energyShareMin
q_ReserveShareMax
......
......@@ -142,6 +142,8 @@ v_help_inc
q_resTransferLimitLeftward
q_reserveProvisionRightward
q_reserveProvisionLeftward
q_transferTwoWayLimit1
q_transferTwoWayLimit2
// State Variables
q_stateSlack
......
......@@ -101,6 +101,8 @@ equations
q_resTransferLimitLeftward(grid, node, node, s, f, t) "Transfer of energy and capacity reservations are less than the transfer capacity to the leftward direction"
q_reserveProvisionRightward(restype, up_down, grid, node, node, s, f, t) "Rightward reserve provision limited - needed for links with investment possibility"
q_reserveProvisionLeftward(restype, up_down, grid, node, node, s, f, t) "Leftward reserve provision limited - needed for links with investment possibility"
q_transferTwoWayLimit1(grid, node, node, s, f, t) "Limiting transfer in both directions, option 1"
q_transferTwoWayLimit2(grid, node, node, s, f, t) "Limiting transfer in both directions, option 2"
// State Variables
q_stateSlack(grid, node, slack, s, f, t) "Slack variable greater than the difference between v_state and the slack boundary"
......
......@@ -2300,6 +2300,81 @@ q_reserveProvisionLeftward(restypeDirectionGridNodeNode(restype, up_down, grid,
]
;
* --- Additional transfer constraints to make the constraints tight -----------
* These two constraints are only needed for links that have availability to both
* directions.
* This first constraint is defined for links that do not have investment
* possibility but have existing transfer capacity to both directions. If there
* is no existing transfer capacity to both directions, a two-way constraint
* like this is not needed.
q_transferTwoWayLimit1(gn2n_directional(grid, node, node_), sft(s, f, t))
${not p_gnn(grid, node, node_, 'transferCapInvLimit')
and ((p_gnn(grid, node, node_, 'availability') and not gn2n_timeseries(grid, node, node_, 'availability'))
or (ts_gnn_(grid, node, node_, 'availability', f, t) and gn2n_timeseries(grid, node, node_, 'availability')))
and ((p_gnn(grid, node_, node, 'availability') and not gn2n_timeseries(grid, node_, node, 'availability'))
or (ts_gnn_(grid, node_, node, 'availability', f, t) and gn2n_timeseries(grid, node_, node, 'availability')))
and p_gnn(grid, node, node_, 'transferCap')
and p_gnn(grid, node_, node, 'transferCap')} ..
// Rightward / (availability * capacity)
+ v_transferRightward(grid, node, node_, s, f, t)
/ [
+ p_gnn(grid, node, node_, 'availability')${not gn2n_timeseries(grid, node, node_, 'availability')}
+ ts_gnn_(grid, node, node_, 'availability', f, t)${gn2n_timeseries(grid, node, node_, 'availability')}
]
/ p_gnn(grid, node, node_, 'transferCap')
// Leftward / (availability * capacity)
+ v_transferLeftward(grid, node, node_, s, f, t)
/ [
+ p_gnn(grid, node_, node, 'availability')${not gn2n_timeseries(grid, node_, node, 'availability')}
+ ts_gnn_(grid, node_, node, 'availability', f, t)${gn2n_timeseries(grid, node_, node, 'availability')}
]
/ p_gnn(grid, node_, node, 'transferCap')
=L=
+ 1
;
* This second constraint is defined for links that have investment possibility
* and where the exististing capacity is the same in both directions. If the
* exististing capacity is not the same in both directions, a tight and linear
* constraint cannot be defined.
q_transferTwoWayLimit2(gn2n_directional(grid, node, node_), sft(s, f, t))
${p_gnn(grid, node, node_, 'transferCapInvLimit')
and p_gnn(grid, node, node_, 'transferCap') = p_gnn(grid, node_, node, 'transferCap')
and ((p_gnn(grid, node, node_, 'availability') and not gn2n_timeseries(grid, node, node_, 'availability'))
or (ts_gnn_(grid, node, node_, 'availability', f, t) and gn2n_timeseries(grid, node, node_, 'availability')))
and ((p_gnn(grid, node_, node, 'availability') and not gn2n_timeseries(grid, node_, node, 'availability'))
or (ts_gnn_(grid, node_, node, 'availability', f, t) and gn2n_timeseries(grid, node_, node, 'availability')))} ..
// Rightward / availability
+ v_transferRightward(grid, node, node_, s, f, t)
/ [
+ p_gnn(grid, node, node_, 'availability')${not gn2n_timeseries(grid, node, node_, 'availability')}
+ ts_gnn_(grid, node, node_, 'availability', f, t)${gn2n_timeseries(grid, node, node_, 'availability')}
]
// Leftward / availability
+ v_transferLeftward(grid, node, node_, s, f, t)
/ [
+ p_gnn(grid, node_, node, 'availability')${not gn2n_timeseries(grid, node_, node, 'availability')}
+ ts_gnn_(grid, node_, node, 'availability', f, t)${gn2n_timeseries(grid, node_, node, 'availability')}
]
=L=
// Existing transfer capacity
+ p_gnn(grid, node, node_, 'transferCap')
// Investments into additional transfer capacity
+ sum(t_invest(t_)${ord(t_)<=ord(t)},
+ v_investTransfer_LP(grid, node, node_, t_)${gn2n_directional_investLP(grid, node, node_)}
+ v_investTransfer_MIP(grid, node, node_, t_)${gn2n_directional_investMIP(grid, node, node_)}
* p_gnn(grid, node, node_, 'unitSize')
) // END sum(t_invest)
;
* =============================================================================
* --- Node State Constraints -------------------------------------------------
* =============================================================================
......
......@@ -109,6 +109,8 @@ Option clear = q_resTransferLimitRightward;
Option clear = q_resTransferLimitLeftward;
Option clear = q_reserveProvisionRightward;
Option clear = q_reserveProvisionLeftward;
Option clear = q_transferTwoWayLimit1;
Option clear = q_transferTwoWayLimit2;
// State Variables
Option clear = q_stateSlack;
......
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