Commit 2c8051df authored by Niina Helistö's avatar Niina Helistö
Browse files

Adding a flag for time series form availability for transfer links.

parent 9b50593c
......@@ -263,6 +263,7 @@ param_gnn "Set of possible data parameters for grid, node, node (nodal interconn
ICrampDown
variableTransCost "Variable cost applied to transfers (EUR/MW)"
availability "Availability of the interconnection (p.u.)"
useTimeseriesAvailability "A flag to use time series form input for availability"
/
param_gnu "Set of possible data parameters for grid, node, unit" /
......
......@@ -65,6 +65,7 @@ Sets
gn2n_directional(grid, node, node) "Transfer links with positive rightward transfer and negative leftward transfer"
gn2n_directional_investLP(grid, node, node) "Transfer links with with continuous investments allowed"
gn2n_directional_investMIP(grid, node, node) "Transfer links with with integer investments allowed"
gn2n_timeseries(grid, node, node, param_gnn) "Transfer links with time series enabled for certain parameters"
gnu(grid, node, unit) "Units in specific nodes of particular energy grids"
gnu_input(grid, node, unit) "Forms of energy the unit uses as endogenous inputs"
gnu_output(grid, node, unit) "Forms of energy the unit uses as endogenous outputs"
......
......@@ -397,8 +397,8 @@ flowNode(flow, node)${ sum((f, t), ts_cf(flow, node, f, t))
* --- Timeseries parameters for node-node connections -------------------------
// Nodes with flows
ts_gnn(grid, node, node_, 'availability', f, t)${p_gnn(grid, node, node_, 'availability')}
= p_gnn(grid, node, node_, 'availability');
gn2n_timeseries(grid, node, node_, 'availability')${p_gnn(grid, node, node_, 'useTimeseriesAvailability')}
= yes;
* =============================================================================
* --- Reserves Sets & Parameters ----------------------------------------------
......
......@@ -2038,7 +2038,10 @@ q_transferRightwardLimit(gn2n_directional(grid, node, node_), sft(s, f, t))
=L=
+ ts_gnn_(grid, node, node_, 'availability', 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')}
]
* [
// Existing transfer capacity
......@@ -2050,7 +2053,7 @@ q_transferRightwardLimit(gn2n_directional(grid, node, node_), sft(s, f, t))
+ v_investTransfer_MIP(grid, node, node_, t_)${gn2n_directional_investMIP(grid, node, node_)}
* p_gnn(grid, node, node_, 'unitSize')
) // END sum(t_invest)
] // END * ts_gnn
] // END * availability
;
* --- Leftward Transfer Limits ------------------------------------------------
......@@ -2064,7 +2067,10 @@ q_transferLeftwardLimit(gn2n_directional(grid, node, node_), sft(s, f, t))
=L=
+ ts_gnn_(grid, node_, node, 'availability', 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')}
]
* [
// Existing transfer capacity
+ p_gnn(grid, node_, node, 'transferCap')
......@@ -2075,7 +2081,7 @@ q_transferLeftwardLimit(gn2n_directional(grid, node, node_), sft(s, f, t))
+ v_investTransfer_MIP(grid, node, node_, t_)${gn2n_directional_investMIP(grid, node, node_)}
* p_gnn(grid, node, node_, 'unitSize')
) // END sum(t_invest)
] // END * ts_gnn
] // END * availability
;
* --- Rightward Reserve Transfer Limits ---------------------------------------
......@@ -2099,7 +2105,10 @@ q_resTransferLimitRightward(gn2n_directional(grid, node, node_), sft(s, f, t))
=L=
+ ts_gnn_(grid, node, node_, 'availability', 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')}
]
* [
// Existing transfer capacity
......@@ -2111,7 +2120,7 @@ q_resTransferLimitRightward(gn2n_directional(grid, node, node_), sft(s, f, t))
+ v_investTransfer_MIP(grid, node, node_, t_)${gn2n_directional_investMIP(grid, node, node_)}
* p_gnn(grid, node, node_, 'unitSize')
) // END sum(t_invest)
] // END * ts_gnn
] // END * availability
;
* --- Leftward Reserve Transfer Limits ----------------------------------------
......@@ -2135,7 +2144,10 @@ q_resTransferLimitLeftward(gn2n_directional(grid, node, node_), sft(s, f, t))
=G=
- ts_gnn_(grid, node_, node, 'availability', 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')}
]
* [
// Existing transfer capacity
+ p_gnn(grid, node_, node, 'transferCap')
......@@ -2146,7 +2158,7 @@ q_resTransferLimitLeftward(gn2n_directional(grid, node, node_), sft(s, f, t))
+ v_investTransfer_MIP(grid, node, node_, t_)${gn2n_directional_investMIP(grid, node, node_)}
* p_gnn(grid, node, node_, 'unitSize')
) // END sum(t_invest)
] // END * ts_gnn
] // END * availability
;
*----------------------------------------------------------------------IC RAMP-------------------------------------------------------------------------------------------------------------------------------------
......@@ -2208,7 +2220,10 @@ q_reserveProvisionRightward(restypeDirectionGridNodeNode(restype, up_down, grid,
=L=
+ p_gnnReserves(grid, node, node_, restype, up_down)
* ts_gnn_(grid, node, node_, 'availability', 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')}
]
* [
// Existing transfer capacity
+ p_gnn(grid, node, node_, 'transferCap')
......@@ -2239,7 +2254,10 @@ q_reserveProvisionLeftward(restypeDirectionGridNodeNode(restype, up_down, grid,
=L=
+ p_gnnReserves(grid, node_, node, restype, up_down)
* ts_gnn_(grid, node_, node, 'availability', 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')}
]
* [
// Existing transfer capacity
+ p_gnn(grid, node_, node, 'transferCap')
......
......@@ -122,15 +122,14 @@ $offtext
= ts_node_update(grid, node, param_gnBoundaryTypes, f, t);
); // END if('ts_node')
// Update ts_gnn. NOTE! Only works for 'availability'.
// Update ts_gnn
if (mTimeseries_loop_read(mSolve, 'ts_gnn'),
put_utility 'gdxin' / '%input_dir%/ts_gnn/' tSolve.tl:0 '.gdx';
execute_load ts_gnn_update=ts_gnn;
ts_gnn(gn2n(grid, node, node_), param_gnn, f_solve(f), tt_forecast(t))
ts_gnn(gn2n_timeseries(grid, node, node_, param_gnn), f_solve(f), tt_forecast(t)) // Only update if time series enabled
${ not mf_realization(mSolve, f) // Realization not updated
and (mSettings(mSolve, 'onlyExistingForecasts')
-> ts_gnn_update(grid, node, node_, param_gnn, f, t)) // Update only existing values (zeroes need to be EPS)
and not p_gnn(grid, node, node_, 'availability') // Only update if the interconnection does not have constant availability
}
= ts_gnn_update(grid, node, node_, param_gnn, f, t);
); // END if('ts_gnn')
......@@ -215,7 +214,7 @@ $offtext
ts_node(gn(grid, node), param_gnBoundaryTypes, f, tt(t))
= ts_node(grid, node, param_gnBoundaryTypes, f, t) - ts_node(grid, node, param_gnBoundaryTypes, f+ddf(f), t);
// ts_gnn
ts_gnn(gn2n(grid, node, node_), param_gnn, f, tt(t))${not p_gnn(grid, node, node_, 'availability')} // Only update if the interconnection does not have constant availability
ts_gnn(gn2n_timeseries(grid, node, node_, param_gnn), f, tt(t)) // Only update if time series enabled
= ts_gnn(grid, node, node_, param_gnn, f, t) - ts_gnn(grid, node, node_, param_gnn, f+ddf(f), t);
); // END loop(f_solve)
......@@ -275,7 +274,7 @@ $offtext
* ts_node(grid, node, param_gnBoundaryTypes, f+ddf_(f), t)
] / mSettings(mSolve, 't_improveForecast');
// ts_gnn
ts_gnn(gn2n(grid, node, node_), param_gnn, f, tt(t))${not p_gnn(grid, node, node_, 'availability')} // Only update if the interconnection does not have constant availability
ts_gnn(gn2n_timeseries(grid, node, node_, param_gnn), f, tt(t)) // Only update if time series enabled
= [ + (ord(t) - tSolveFirst)
* ts_gnn(grid, node, node_, param_gnn, f, t)
+ (tSolveFirst - ord(t) + mSettings(mSolve, 't_improveForecast'))
......@@ -311,7 +310,7 @@ $offtext
ts_node(gn(grid, node), param_gnBoundaryTypes, f, tt(t))
= ts_node(grid, node, param_gnBoundaryTypes, f, t) + ts_node(grid, node, param_gnBoundaryTypes, f+ddf(f), t);
// ts_gnn
ts_gnn(gn2n(grid, node, node_), param_gnn, f, tt(t))${not p_gnn(grid, node, node_, 'availability')} // Only update if the interconnection does not have constant availability
ts_gnn(gn2n_timeseries(grid, node, node_, param_gnn), f, tt(t)) // Only update if time series enabled
= ts_gnn(grid, node, node_, param_gnn, f, t) + ts_gnn(grid, node, node_, param_gnn, f+ddf(f), t);
); // END loop(f_solve)
......@@ -405,7 +404,7 @@ $offtext
+ dt_circular(t_)$(not gn_scenarios(grid, node, 'ts_node'))))
)
$(sameas(param_gnBoundaryTypes, 'upwardLimit') or upwardSlack(param_gnBoundaryTypes));
ts_gnn_(gn2n(grid, node, node_), param_gnn, ft(f, tt_interval(t)))
ts_gnn_(gn2n_timeseries(grid, node, node_, param_gnn), ft(f, tt_interval(t)))
= sum(tt_aggregate(t, t_),
ts_gnn(grid, node, node_, param_gnn, f, t_+dt_circular(t_))
)
......
......@@ -318,17 +318,33 @@ v_ICramp.lo(gn2n_directional(grid, node, node_), sft(s, f, t))${ ord(t) > msStar
// Restrictions on transferring energy between nodes without investments
// Total transfer variable restricted from both above and below (free variable)
v_transfer.up(gn2n_directional(grid, node, node_), sft(s, f, t))${ not p_gnn(grid, node, node_, 'transferCapInvLimit') }
= ts_gnn_(grid, node, node_, 'availability', f, t) * p_gnn(grid, node, node_, 'transferCap')
= [
+ 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')
;
v_transfer.lo(gn2n_directional(grid, node, node_), sft(s, f, t))${ not p_gnn(grid, node, node_, 'transferCapInvLimit') }
= -ts_gnn_(grid, node_, node, 'availability', f, t) * p_gnn(grid, node_, node, 'transferCap')
= [
- 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')
;
// Directional transfer variables only restricted from above (positive variables)
v_transferRightward.up(gn2n_directional(grid, node, node_), sft(s, f, t))${ not p_gnn(grid, node, node_, 'transferCapInvLimit') }
= ts_gnn_(grid, node, node_, 'availability', f, t) * p_gnn(grid, node, node_, 'transferCap')
= [
+ 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')
;
v_transferLeftward.up(gn2n_directional(grid, node, node_), sft(s, f, t))${ not p_gnn(grid, node, node_, 'transferCapInvLimit') }
= ts_gnn_(grid, node_, node, 'availability', f, t) * p_gnn(grid, node_, node, 'transferCap')
= [
+ 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')
;
* --- Reserve Provision Boundaries --------------------------------------------
......@@ -363,7 +379,10 @@ loop((restypeDirectionGridNode(restype, up_down, grid, node), sft(s, f, t))${ or
) // Commit reserve transfer as long as either end commits.
]
}
= ts_gnn_(grid, node, node_, 'availability', 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')
* p_gnnReserves(grid, node, node_, restype, up_down);
......@@ -378,7 +397,10 @@ loop((restypeDirectionGridNode(restype, up_down, grid, node), sft(s, f, t))${ or
) // Commit reserve transfer as long as either end commits.
]
}
= ts_gnn_(grid, node_, node, 'availability', 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')
* p_gnnReserves(grid, node_, node, restype, up_down);
......
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