Commit 8bc705a3 authored by Niina Helistö's avatar Niina Helistö
Browse files

First version of timeseries form interconnection availability.

Issue #62
parent 13471bd4
......@@ -175,6 +175,7 @@ Sets
ts_price
ts_unavailability
ts_storageValue
ts_gnn
/
; // END Sets
......@@ -261,6 +262,7 @@ param_gnn "Set of possible data parameters for grid, node, node (nodal interconn
ICrampUp
ICrampDown
variableTransCost "Variable cost applied to transfers (EUR/MW)"
availability "Availability of the interconnection (p.u.)"
/
param_gnu "Set of possible data parameters for grid, node, unit" /
......
......@@ -163,6 +163,7 @@ Parameters
ts_cf(flow, node, f, t) "Available capacity factor time series (p.u.)"
ts_reserveDemand(restype, up_down, group, f, t) "Reserve demand in region in the time step (MW)"
ts_node(grid, node, param_gnBoundaryTypes, f, t) "Fix the states of a node according to time-series form exogenous input ([v_state])"
ts_gnn(grid, node, node, param_gnn, f, t) "Time dependent interconnection data"
ts_storageValue(grid, node, f, t) "Timeseries value of stored something at the end of a time step (EUR/<v_state_unit>)"
ts_priceChange(node, t) "Initial commodity price and consequent changes in commodity price (EUR/MWh)"
ts_price(node, t) "Commodity price time series (EUR/MWh)"
......@@ -173,6 +174,7 @@ Parameters
ts_cf_(flow, node, s, f, t) "Mean available capacity factor time series (p.u.)"
ts_reserveDemand_(restype, up_down, group, f, t) "Mean reserve demand in region in the time step (MW)"
ts_node_(grid, node, param_gnBoundaryTypes, s, f, t) "Mean value of ts_node"
ts_gnn_(grid, node, node, param_gnn, f, t) "Mean value of ts_gnn"
ts_storageValue_(grid, node, s, f, t) "Mean value of ts_storageValue"
ts_vomCost_(grid, node, unit, t) "Calculated variable O&M cost that includes O&M cost, fuel cost and emission cost"
ts_startupCost_(unit, starttype, t) "Calculated variable startup cost that includes startup cost, fuel cost and emission cost"
......@@ -185,6 +187,7 @@ Parameters
ts_cf_update(flow, node, f, t)
ts_reserveDemand_update(restype, up_down, group, f, t)
ts_node_update(grid, node, param_gnBoundaryTypes, f, t)
ts_gnn_update(grid, node, node, param_gnn, f, t)
ts_priceChange_update(node, t)
ts_unavailability_update(unit, t)
......
......@@ -34,6 +34,7 @@ $ifthen exist '%input_dir%/inputData.gdx'
$$loaddc group
$$loaddc p_gn
$$loaddc p_gnn
$$loaddc ts_gnn
$$loaddc p_gnu_io
$$loaddc p_gnuBoundaryProperties
$$loaddc p_unit
......@@ -393,6 +394,12 @@ flowNode(flow, node)${ sum((f, t), ts_cf(flow, node, f, t))
}
= yes;
* --- 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');
* =============================================================================
* --- Reserves Sets & Parameters ----------------------------------------------
* =============================================================================
......
......@@ -158,6 +158,18 @@ $ifthen exist '%input_dir%/p_gnn3.gdx'
$$gdxin
$endif
$ifthen exist '%input_dir%/ts_gnn2.gdx'
$$gdxin '%input_dir%/ts_gnn2.gdx'
$$loaddcm ts_gnn
$$gdxin
$endif
$ifthen exist '%input_dir%/ts_gnn3.gdx'
$$gdxin '%input_dir%/ts_gnn3.gdx'
$$loaddcm ts_gnn
$$gdxin
$endif
$ifthen exist '%input_dir%/p_gnu_io2.gdx'
$$gdxin '%input_dir%/p_gnu_io2.gdx'
$$loaddcm p_gnu_io
......
......@@ -2010,7 +2010,7 @@ q_unitGreaterThanConstraint(s_active(s), gt_constraint, uft(unit, f, t))
${uft_onlineLP(unit, f, t)}
+ v_online_MIP(unit, s, f+df_central(f,t), t)
${uft_onlineMIP(unit, f, t)}
]
]
;
* --- Total Transfer Limits ---------------------------------------------------
......@@ -2038,15 +2038,19 @@ q_transferRightwardLimit(gn2n_directional(grid, node, node_), sft(s, f, t))
=L=
// Existing transfer capacity
+ p_gnn(grid, node, node_, 'transferCap')
+ ts_gnn_(grid, node, node_, 'availability', f, t)
* [
// 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)
// 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)
] // END * ts_gnn
;
* --- Leftward Transfer Limits ------------------------------------------------
......@@ -2060,15 +2064,18 @@ q_transferLeftwardLimit(gn2n_directional(grid, node, node_), sft(s, f, t))
=L=
// Existing transfer capacity
+ p_gnn(grid, node_, node, 'transferCap')
+ ts_gnn_(grid, node_, node, 'availability', f, t)
* [
// 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)
// 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)
] // END * ts_gnn
;
* --- Rightward Reserve Transfer Limits ---------------------------------------
......@@ -2092,15 +2099,19 @@ q_resTransferLimitRightward(gn2n_directional(grid, node, node_), sft(s, f, t))
=L=
// Existing transfer capacity
+ p_gnn(grid, node, node_, 'transferCap')
+ ts_gnn_(grid, node, node_, 'availability', f, t)
* [
// 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)
// 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)
] // END * ts_gnn
;
* --- Leftward Reserve Transfer Limits ----------------------------------------
......@@ -2124,15 +2135,18 @@ q_resTransferLimitLeftward(gn2n_directional(grid, node, node_), sft(s, f, t))
=G=
// Existing transfer capacity
- p_gnn(grid, node_, node, 'transferCap')
- ts_gnn_(grid, node_, node, 'availability', f, t)
* [
// 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)
// 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)
] // END * ts_gnn
;
*----------------------------------------------------------------------IC RAMP-------------------------------------------------------------------------------------------------------------------------------------
......
......@@ -122,6 +122,19 @@ $offtext
= ts_node_update(grid, node, param_gnBoundaryTypes, f, t);
); // END if('ts_node')
// Update ts_gnn. NOTE! Only works for 'availability'.
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))
${ 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')
* --- NO FORECAST DIMENSION, SHOULD THESE BE HANDLED SEPARATELY? --------------
// Currently, only updated until the forecast horizon, but is this correct?
......@@ -201,6 +214,9 @@ $offtext
// ts_node
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(grid, node, node_, param_gnn, f, t) - ts_gnn(grid, node, node_, param_gnn, f+ddf(f), t);
); // END loop(f_solve)
* --- Linear improvement of the central forecast ------------------------------
......@@ -258,6 +274,13 @@ $offtext
+ (tSolveFirst - ord(t) + mSettings(mSolve, 't_improveForecast'))
* 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
= [ + (ord(t) - tSolveFirst)
* ts_gnn(grid, node, node_, param_gnn, f, t)
+ (tSolveFirst - ord(t) + mSettings(mSolve, 't_improveForecast'))
* ts_gnn(grid, node, node_, param_gnn, f+ddf_(f), t)
] / mSettings(mSolve, 't_improveForecast');
); // END loop(mf_central)
* --- Recalculate the other forecasts based on the improved central forecast --
......@@ -287,6 +310,9 @@ $offtext
// ts_node
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(grid, node, node_, param_gnn, f, t) + ts_gnn(grid, node, node_, param_gnn, f+ddf(f), t);
); // END loop(f_solve)
); // END if(t_improveForecast)
......@@ -379,6 +405,11 @@ $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)))
= sum(tt_aggregate(t, t_),
ts_gnn(grid, node, node_, param_gnn, f, t_+dt_circular(t_))
)
/ mInterval(mSolve, 'stepsPerInterval', counter);
// Node price time series
ts_vomCost_(gnu(grid, node, unit), tt_interval(t))
......
......@@ -318,17 +318,17 @@ 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') }
= p_gnn(grid, node, node_, 'transferCap')
= ts_gnn_(grid, node, node_, 'availability', f, t) * 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') }
= -p_gnn(grid, node_, node, 'transferCap')
= -ts_gnn_(grid, node_, node, 'availability', f, t) * 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') }
= p_gnn(grid, node, node_, 'transferCap')
= ts_gnn_(grid, node, node_, 'availability', f, t) * 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') }
= p_gnn(grid, node_, node, 'transferCap')
= ts_gnn_(grid, node_, node, 'availability', f, t) * p_gnn(grid, node_, node, 'transferCap')
;
* --- Reserve Provision Boundaries --------------------------------------------
......
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