Commit 730d9c88 authored by Juha Kiviluoma's avatar Juha Kiviluoma
Browse files

Include t00000 for storage and online variables for the results output (as...

Include t00000 for storage and online variables for the results output (as long as there are variable values for the first time period).
parent 2a594920
......@@ -30,6 +30,9 @@ Sets
unit_flow(unit) "Unit that depend directly on variable energy flows (RoR, solar PV, etc.)"
unit_fuel(unit) "Units using a commercial fuel"
unit_minLoad(unit) "Units that have unit commitment restrictions (e.g. minimum power level)"
unit_online(unit) "Units that have an online variable in the first effLevel level1"
unit_online_LP(unit) "Units that have an LP online variable in the first effLevel level1"
unit_online_MIP(unit) "Units that have an MIP online variable in the first effLevel level1"
unit_aggregate(unit) "Aggregate units aggragating several units"
unit_noAggregate(unit) "Units that are not aggregated at all"
unit_slope(unit) "Units with piecewise linear efficiency constraints"
......
......@@ -38,7 +38,8 @@ Scalars
tmp_op "Temporary parameter for operating point"
tmp_count_op "Counting the number of valid operating points in the unit data"
f_improve / 12 /
tRealizedLast "counter (ord) for the last realized t in the solve";
tRealizedLast "counter (ord) for the last realized t in the solve"
firstResultsOutputSolve /1/;
;
* --- Power plant and fuel data -----------------------------------------------
......
......@@ -143,6 +143,13 @@ unit_minload(unit)${ p_unit(unit, 'op00') > 0 // If the first defined operati
}
= yes;
// Units with online variables in the effLevel 'level1'
unit_online(unit)${ sum(effSelector$effOnline(effSelector), effLevelGroupUnit('level1', effSelector, unit)) }
= yes;
unit_online_LP(unit)${ sum(effSelector, effLevelGroupUnit('level1', 'directOnLP', unit)) }
= yes;
unit_online_MIP(unit) = unit_online(unit) - unit_online_LP(unit);
// Units with flows/fuels
unit_flow(unit)${ sum(flow, flowUnit(flow, unit)) }
= yes;
......
......@@ -25,14 +25,14 @@ loop(m,
* --- Realized Individual Costs ----------------------------------------------
// Variable O&M costs
r_gnuVOMCost(gnu_output(grid, node, unit), ft_realizedNoReset(f,t))$[ord(t) >= mSettings(m, 'results_t_start')]
r_gnuVOMCost(gnu_output(grid, node, unit), ft_realizedNoReset(f,t))$[ord(t) > mSettings(m, 'results_t_start')]
= 1e-6 // Scaling to MEUR
* p_stepLengthNoReset(m, f, t)
* r_gen(grid, node, unit, f, t)
* p_unit(unit, 'omCosts');
// Fuel and emission costs during normal operation
r_uFuelEmissionCost(fuel, unit_fuel(unit), ft_realizedNoReset(f,t))${ uFuel(unit, 'main', fuel) and [ord(t) >= mSettings(m, 'results_t_start')]}
r_uFuelEmissionCost(fuel, unit_fuel(unit), ft_realizedNoReset(f,t))${ uFuel(unit, 'main', fuel) and [ord(t) > mSettings(m, 'results_t_start')]}
= 1e-6 // Scaling to MEUR
* p_stepLengthNoReset(m, f, t)
* r_fuelUse(fuel, unit, f, t)
......@@ -43,7 +43,7 @@ loop(m,
];
// Unit startup costs
r_uStartupCost(unit, ft_realizedNoReset(f,t))${ sum(starttype, unitStarttype(unit, starttype)) and [ord(t) >= mSettings(m, 'results_t_start')]}
r_uStartupCost(unit, ft_realizedNoReset(f,t))${ sum(starttype, unitStarttype(unit, starttype)) and [ord(t) > mSettings(m, 'results_t_start')]}
= 1e-6 // Scaling to MEUR
* sum(unitStarttype(unit, starttype),
+ r_startup(unit, starttype, f, t)
......@@ -65,7 +65,7 @@ loop(m,
); // END sum(unitStarttype)
// Node state slack costs
r_gnStateSlackCost(gn_stateSlack(grid, node), ft_realizedNoReset(f,t))$[ord(t) >= mSettings(m, 'results_t_start')]
r_gnStateSlackCost(gn_stateSlack(grid, node), ft_realizedNoReset(f,t))$[ord(t) > mSettings(m, 'results_t_start')]
= 1e-6 // Scaling to MEUR
* p_stepLengthNoReset(m, f, t)
* sum(slack${ p_gnBoundaryPropertiesForStates(grid, node, slack, 'slackCost') },
......@@ -91,32 +91,32 @@ loop(m,
// Total VOM costs
r_gnuTotalVOMCost(gnu_output(grid, node, unit))
= sum(ft_realizedNoReset(f,t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f,t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_gnuVOMCost(grid, node, unit, f, t)
);
// Total fuel & emission costs
r_uTotalFuelEmissionCost(fuel, unit)${ uFuel(unit, 'main', fuel) }
= sum(ft_realizedNoReset(f,t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f,t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_uFuelEmissionCost(fuel, unit, f, t)
);
// Total unit startup costs
r_uTotalStartupCost(unit)${ sum(starttype, unitStarttype(unit, starttype)) }
= sum(ft_realizedNoReset(f,t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f,t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_uStartupCost(unit, f, t)
);
// Total state variable slack costs
r_gnTotalStateSlackCost(gn_stateSlack(grid, node))
= sum(ft_realizedNoReset(f,t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f,t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_gnStateSlackCost(grid, node, f, t)
);
* --- Realized Nodal System Costs ---------------------------------------------
// Total realized gn costs
r_gnRealizedCost(gn(grid, node), ft_realizedNoReset(f, t))$[ord(t) >= mSettings(m, 'results_t_start')]
r_gnRealizedCost(gn(grid, node), ft_realizedNoReset(f, t))$[ord(t) > mSettings(m, 'results_t_start')]
= sum(gnu_output(grid, node, unit),
// VOM costs
......@@ -143,7 +143,7 @@ loop(m,
* --- Realized Nodal Energy Consumption ---------------------------------------
// !!! NOTE !!! This is a bit of an approximation at the moment !!!!!!!!!!!!!!!
r_gnConsumption(gn(grid, node), ft_realizedNoReset(f, t))$[ord(t) >= mSettings(m, 'results_t_start')]
r_gnConsumption(gn(grid, node), ft_realizedNoReset(f, t))$[ord(t) > mSettings(m, 'results_t_start')]
= p_stepLengthNoReset(m, f, t)
* [
+ min(ts_influx(grid, node, f, t), 0) // Not necessarily a good idea, as ts_influx contains energy gains as well...
......@@ -156,33 +156,33 @@ loop(m,
// Total energy generation
r_gnuTotalGen(gnu_output(grid, node, unit))
= sum(ft_realizedNoReset(f, t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_gen(grid, node, unit, f, t)
* p_stepLengthNoReset(m, f, t)
); // END sum(ft_realizedNoReset)
// Energy generation by fuels
r_genFuel(gn(grid, node), fuel, ft_realizedNoReset(f, t))$[ord(t) >= mSettings(m, 'results_t_start')]
r_genFuel(gn(grid, node), fuel, ft_realizedNoReset(f, t))$[ord(t) > mSettings(m, 'results_t_start')]
= sum(uFuel(unit, 'main', fuel)${ gnu_output(grid, node, unit) },
+ r_gen(grid, node, unit, f, t)
); // END sum(uFuel)
// Energy generation by fuels
r_genUnittype(gn(grid, node), unittype, t)$(sum(f,ft_realizedNoReset(f,t)) and sum(unit,gnu_output(grid, node, unit) and [ord(t) >= mSettings(m, 'results_t_start')]))
r_genUnittype(gn(grid, node), unittype, t)$(sum(f,ft_realizedNoReset(f,t)) and sum(unit,gnu_output(grid, node, unit) and [ord(t) > mSettings(m, 'results_t_start')]))
= sum(unit${unitUnittype(unit, unittype) and gnu_output(grid, node, unit)},
+ sum(f,r_gen(grid, node, unit, f, t))
); // END sum(unit)
// Total generation on each node by fuels
r_gnTotalGenFuel(gn(grid, node), fuel)
= sum(ft_realizedNoReset(f, t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_genFuel(grid, node, fuel, f, t)
* p_stepLengthNoReset(m, f, t)
); // END sum(ft_realizedNoReset)
// Total dummy generation/consumption
r_gnTotalqGen(inc_dec, gn(grid, node))
= sum(ft_realizedNoReset(f,t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f,t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_qGen(inc_dec, grid, node, f, t)
* p_stepLengthNoReset(m, f, t)
); // END sum(ft_realizedNoReset)
......@@ -191,7 +191,7 @@ loop(m,
// Total sub-unit-hours for units over the simulation
r_uTotalOnline(unit)
= sum(ft_realizedNoReset(f, t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_online(unit, f, t)
* p_stepLengthNoReset(m, f, t)
); // END sum(ft_realizedNoReset)
......@@ -209,14 +209,14 @@ loop(m,
// Total reserve provisions over the simulation
r_nuTotalReserve(nuRescapable(restype, up_down, node, unit))
= sum(ft_realizedNoReset(f, t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_reserve(restype, up_down, node, unit, f, t)
* p_stepLengthNoReset(m, f, t)
); // END sum(ft_realizedNoReset)
// Total dummy reserve provisions over the simulation
r_nTotalqResDemand(restypeDirectionNode(restype, up_down, node))
= sum(ft_realizedNoReset(f, t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_qResDemand(restype, up_down, node, f, t)
* p_stepLengthNoReset(m, f, t)
); // END sum(ft_realizedNoReset)
......@@ -225,14 +225,14 @@ loop(m,
// Total transfer of energy between nodes
r_gnnTotalTransfer(gn2n(grid, from_node, to_node))
= sum(ft_realizedNoReset(f, t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_transfer(grid, from_node, to_node, f, t)
* p_stepLengthNoReset(m, f, t)
); // END sum(ft_realizedNoReset)
// Total energy spill from nodes
r_gnTotalSpill(grid, node_spill(node))
= sum(ft_realizedNoReset(f, t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_spill(grid, node, f, t)
* p_stepLengthNoReset(m, f, t)
); // END sum(ft_realizedNoReset)
......@@ -244,11 +244,11 @@ loop(m,
* --- Scaling Marginal Values to EUR/MWh --------------------------------------
// Energy balance
r_balanceMarginal(gn(grid, node), ft_realizedNoReset(f, t))$[ord(t) >= mSettings(m, 'results_t_start')]
r_balanceMarginal(gn(grid, node), ft_realizedNoReset(f, t))$[ord(t) > mSettings(m, 'results_t_start')]
= 1e6 * r_balanceMarginal(grid, node, f, t);
// Reserve balance
r_resDemandMarginal(restypeDirectionNode(restype, up_down, node), ft_realizedNoReset(f, t))$[ord(t) >= mSettings(m, 'results_t_start')]
r_resDemandMarginal(restypeDirectionNode(restype, up_down, node), ft_realizedNoReset(f, t))$[ord(t) > mSettings(m, 'results_t_start')]
= 1e6 * r_resDemandMarginal(restype, up_down, node, f, t);
* --- Total Generation Results ------------------------------------------------
......@@ -281,7 +281,7 @@ r_gTotalqGen(inc_dec, grid)
// Total consumption on each gn over the simulation
r_gnTotalConsumption(gn(grid, node))
= sum(ft_realizedNoReset(f, t)$[ord(t) >= mSettings(m, 'results_t_start')], r_gnConsumption(grid, node, f ,t));
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 'results_t_start')], r_gnConsumption(grid, node, f ,t));
// Total consumption in each grid over the simulation
r_gTotalConsumption(grid)
......@@ -322,7 +322,7 @@ r_gnTotalSpillShare(gn(grid, node_spill))${ r_gTotalSpill(grid) }
// Total realized costs on each gn over the simulation
r_gnTotalRealizedCost(gn(grid, node))
= sum(ft_realizedNoReset(f, t)$[ord(t) >= mSettings(m, 'results_t_start')], r_gnRealizedCost(grid, node, f ,t));
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 'results_t_start')], r_gnRealizedCost(grid, node, f ,t));
// Total realized net costs on each gn over the simulation
r_gnTotalRealizedNetCost(gn(grid, node))
......@@ -368,20 +368,20 @@ r_uTotalOnlinePerUnit(unit)${ p_unit(unit, 'unitCount') }
// Total sub-unit startups over the simulation
r_uTotalStartup(unit, starttype)
= sum(ft_realizedNoReset(f, t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_startup(unit, starttype, f, t)
); // END sum(ft_realizedNoReset)
// Total sub-unit shutdowns over the simulation
r_uTotalShutdown(unit)
= sum(ft_realizedNoReset(f, t)$[ord(t) >= mSettings(m, 'results_t_start')],
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 'results_t_start')],
+ r_shutdown(unit, f, t)
); // END sum(ft_realizedNoReset)
* --- Diagnostic Results ------------------------------------------------------
// Estimated coefficients of performance
d_cop(unit, ft_realizedNoReset(f, t))${ [ord(t) >= mSettings(m, 'results_t_start')] and sum(gnu_input(grid, node, unit), 1) }
d_cop(unit, ft_realizedNoReset(f, t))${ [ord(t) > mSettings(m, 'results_t_start')] and sum(gnu_input(grid, node, unit), 1) }
= sum(gnu_output(grid, node, unit),
+ r_gen(grid, node, unit, f, t)
) // END sum(gnu_output)
......@@ -392,7 +392,7 @@ d_cop(unit, ft_realizedNoReset(f, t))${ [ord(t) >= mSettings(m, 'results_t_start
];
// Estimated efficiency
d_eff(unit_fuel(unit), ft_realizedNoReset(f, t))$[ord(t) >= mSettings(m, 'results_t_start')]
d_eff(unit_fuel(unit), ft_realizedNoReset(f, t))$[ord(t) > mSettings(m, 'results_t_start')]
= sum(gnu_output(grid, node, unit),
+ r_gen(grid, node, unit, f, t)
) // END sum(gnu_output)
......
Supports Markdown
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