Commit 91b43688 authored by Juha Kiviluoma's avatar Juha Kiviluoma
Browse files

Merge branch 'RPG_conf_paper' into dev

parents dc541580 19205f40
......@@ -17,12 +17,10 @@ loop(unit${r_invest(unit)},
tmp = round(r_invest(unit), 0)
put "p_unit('", unit.tl, "', 'unitCount') = p_unit('", unit.tl, "', 'unitCount') + ", tmp, ";"/;
);
* Update maxGen and maxCons values in the child setups
* Update capacity values in the child setups
loop(gnu(grid, node, unit)${r_invest(unit)},
tmp = round(r_invest(unit), 0) * p_gnu(grid, node, unit, 'unitSizeGen');
put "p_gnu('", grid.tl, "', '", node.tl, "', '", unit.tl, "', 'maxGen') = p_gnu('", grid.tl, "', '", node.tl, "', '", unit.tl, "', 'maxGen') + ", tmp, ";"/;
tmp = round(r_invest(unit), 0) * p_gnu(grid, node, unit, 'unitSizeCons');
put "p_gnu('", grid.tl, "', '", node.tl, "', '", unit.tl, "', 'maxCons') = p_gnu('", grid.tl, "', '", node.tl, "', '", unit.tl, "', 'maxCons') + ", tmp, ";"/;
tmp = round(r_invest(unit), 0) * p_gnu(grid, node, unit, 'unitSize');
put "p_gnu('", grid.tl, "', '", node.tl, "', '", unit.tl, "', 'capacity') = p_gnu('", grid.tl, "', '", node.tl, "', '", unit.tl, "', 'capacity') + ", tmp, ";"/;
);
* Do not allow investments in the child setups (commented out at the moment)
......
......@@ -47,18 +47,18 @@ Model building /
* q_genRampChange
* q_rampUpLimit
* q_rampDownLimit
* q_outputRatioFixed
* q_outputRatioConstrained
q_conversionDirectInputOutput
* q_conversionSOS2InputIntermediate
* q_conversionSOS2Constraint
* q_conversionSOS2IntermediateOutput
* q_conversionIncHR
* q_conversionIncHRMaxGen
* q_conversionIncHRMaxOutput
* q_conversionIncHRBounds
* q_conversionIncHR_help1
* q_conversionIncHR_help2
* q_fuelUseLimit
* q_unitEqualityConstraint
* q_unitGreaterThanConstraint
* q_commodityUseLimit
// Energy Transfer
q_transfer
......
......@@ -47,18 +47,18 @@ Model invest /
q_rampDownLimit
q_rampUpDown
q_rampSlack
q_outputRatioFixed
q_outputRatioConstrained
q_conversionDirectInputOutput
q_conversionSOS2InputIntermediate
q_conversionSOS2Constraint
q_conversionSOS2IntermediateOutput
q_conversionIncHR
q_conversionIncHRMaxGen
q_conversionIncHRMaxOutput
q_conversionIncHRBounds
q_conversionIncHR_help1
q_conversionIncHR_help2
q_fuelUseLimit
q_unitEqualityConstraint
q_unitGreaterThanConstraint
* q_commodityUseLimit
// Energy Transfer
q_transfer
......
......@@ -41,24 +41,24 @@ Model schedule /
q_onlineOnStartUp
q_offlineAfterShutDown
q_onlineMinUptime
* q_onlineCyclic
* q_onlineCyclic
q_genRamp
q_rampUpLimit
q_rampDownLimit
q_rampUpDown
q_rampSlack
q_outputRatioFixed
q_outputRatioConstrained
q_conversionDirectInputOutput
q_conversionSOS2InputIntermediate
q_conversionSOS2Constraint
q_conversionSOS2IntermediateOutput
q_conversionIncHR
q_conversionIncHRMaxGen
q_conversionIncHRMaxOutput
q_conversionIncHRBounds
q_conversionIncHR_help1
q_conversionIncHR_help2
q_fuelUseLimit
q_unitEqualityConstraint
q_unitGreaterThanConstraint
* q_commodityUseLimit
// Energy Transfer
q_transfer
......@@ -80,7 +80,7 @@ Model schedule /
q_inertiaMin
q_instantaneousShareMax
q_constrainedOnlineMultiUnit
* q_capacityMargin
q_capacityMargin
* q_constrainedCapMultiUnit
* q_emissioncap
* q_energyShareMax
......
......@@ -130,7 +130,7 @@ if (mType('schedule'),
mTimeseries_loop_read('schedule', 'ts_cf') = no;
mTimeseries_loop_read('schedule', 'ts_reserveDemand') = no;
mTimeseries_loop_read('schedule', 'ts_node') = no;
mTimeseries_loop_read('schedule', 'ts_fuelPriceChange') = no;
mTimeseries_loop_read('schedule', 'ts_priceChange') = no;
mTimeseries_loop_read('schedule', 'ts_unavailability') = no;
// Define Realized and Central forecasts
......
......@@ -49,13 +49,12 @@ p_gnuReserves
p_gnPolicy
p_groupPolicy
p_groupPolicy3D
p_fuelEmission
p_uFuel
p_unitFuelEmissionCost
p_nEmission
p_unitEmissionCost
p_effUnit
p_effGroupUnit
p_uNonoperational
p_uStartup
p_uStartupfuel
p_u_maxOutputInLastRunUpInterval
p_u_runUpTimeIntervals
dt_toStartup
......@@ -74,7 +73,6 @@ v_gen_inc
v_genRamp
v_transfer
v_state
v_fuelUse
v_sos2
v_spill
v_online_LP
......@@ -123,18 +121,18 @@ v_help_inc
q_rampDownLimit
q_rampUpDown
q_rampSlack
q_outputRatioFixed
q_outputRatioConstrained
q_conversionDirectInputOutput
q_conversionSOS2InputIntermediate
q_conversionSOS2Constraint
q_conversionSOS2IntermediateOutput
q_conversionIncHR
q_conversionIncHRMaxGen
q_conversionIncHRMaxOutput
q_conversionIncHRBounds
q_conversionIncHR_help1
q_conversionIncHR_help2
q_fuelUseLimit
q_unitEqualityConstraint
q_unitGreaterThanConstraint
* q_commodityUseLimit
// Energy Transfer
q_transfer
......@@ -142,6 +140,8 @@ v_help_inc
q_transferLeftwardLimit
q_resTransferLimitRightward
q_resTransferLimitLeftward
q_reserveProvisionRightward
q_reserveProvisionLeftward
// State Variables
q_stateSlack
......@@ -159,6 +159,7 @@ v_help_inc
q_emissioncap
q_energyShareMax
q_energyShareMin
q_ReserveShareMax
* Dummy variables
vq_gen
......
......@@ -125,12 +125,18 @@ Sets
cc(counter) "Temporary subset of counter used for calculations"
// Directional Sets
up_down "Direction set used by some variables, e.g. reserve provisions and generation ramps"
/ up, down /
input_output "Designating nodes as either inputs or outputs"
/ input, output /
inc_dec "Increase or decrease in dummy, or slack variables"
/ increase, decrease /
min_max "Minimum and maximum"
/ min, max /
constraint "Possible names for constraints"
/ eq1*eq9, gt1*gt9 /
eq_constraint(constraint) "Equality constraints"
/ eq1*eq9 /
gt_constraint(constraint) "Greater than constraints"
/ gt1*gt9 /
* --- Model Feature Sets ------------------------------------------------------
......@@ -165,8 +171,8 @@ Sets
ts_cf
ts_reserveDemand
ts_node
ts_fuelPriceChange
ts_fuelPrice
ts_priceChange
ts_price
ts_unavailability
/
......@@ -205,6 +211,7 @@ Sets
* --- Parameter Data Related Sets ---------------------------------------------
param_gn "Possible parameters for grid, node" /
nodeBalance "A flag to decide whether node balance constraint is to be used"
selfDischargeLoss "Self discharge rate of the node (MW/[v_state])"
energyStoredPerUnitOfState "A possible unit conversion if v_state uses something else than MWh (MWh/[v_state])"
boundStart "A flag to bound the first t in the run using reference constant or time series"
......@@ -248,22 +255,19 @@ param_gnn "Set of possible data parameters for grid, node, node (nodal interconn
invCost "Investment cost (EUR/MW)"
annuity "Investment annuity"
portion_of_transfer_to_reserve "Portion to cover incase fail"
ICrampUp
ICrampDown
/
param_gnu "Set of possible data parameters for grid, node, unit" /
maxGen "Maximum output capacity (MW)"
maxCons "Maximum loading capacity (MW)"
capacity "Maximum capacity (MW)"
conversionCoeff "Coefficient for conversion equation (multiplies each input or output when summing v_gen from multiple inputs/outputs)"
useInitialGeneration "A flag to indicate whether to fix generation for the first time step (binary)"
initialGeneration "Initial generation/consumption of the unit in the first time step (MW)"
conversionFactor "Conversion factor for inputs or outputs (for changing the unit of measurement)"
doNotOutput "Flag for inputs that are not included in the output commodities"
cV "Reduction in primary output when increasing secondary output, e.g. reduction of electricity generation due to heat generation in extraction CHP (MWh_e/MWh_h)"
maxRampUp "Speed to ramp up (p.u./min)"
maxRampDown "Speed to ramp down (p.u./min)"
upperLimitCapacityRatio "Ratio of the upper limit of the node state and the unit capacity investment ([v_state]/MW)"
unitSizeGen "Output capacity of one subunit for integer investments (MW)"
unitSizeCons "Loading capacity of one subunit for integer investments (MW)"
unitSizeTot "Sum of output and loading capacity of one subunit (MW)"
unitSize "Input/Output capacity of one subunit for integer investments (MW)"
invCosts "Investment costs (EUR/MW)"
annuity "Investment annuity factor"
fomCosts "Fixed operation and maintenance costs (EUR/MW/a)"
......@@ -327,20 +331,18 @@ param_eff "Parameters used for unit efficiency approximations" /
slope "Heat rate parameter representing no-load fuel consumption"
/
param_fuel "Parameters for fuels" /
main "Main fuel of the unit - unless input fuels defined as grids"
startup "Startup fuel of the unit, if exists. Can be the same as main fuel - consumption using startupFuelCons"
param_constraint "Parameters for constraints" /
constant "Constant when binding inputs/outputs"
coefficient "Coefficient when binding inputs/outputs"
/
param_fuelPrice "Paramters for fuel prices" /
fuelPrice "Fuel price (EUR/MWh)"
useConstant "Flag to use constant data for fuels"
useTimeSeries "Flag to use time series form data for fuels"
param_price "Parameters for commodity prices" /
price "Commodity price (EUR/MWh)"
useConstant "Flag to use constant data for commodities"
useTimeSeries "Flag to use time series form data for commodities"
/
param_unitFuel "Parameters for fuel limits in units" /
maxFuelCons "Maximum absolute fuel consumption in a unit - not used for start-up fuels"
maxFuelFraction "Maximum share of a fuel in the consumption mix" //only for main fuels
param_unitStartupfuel "Parameters for startup fuel limits in units" /
fixedFuelFraction "Fixed share of a fuel in the consumption mix" //only for start-up fuels
/
......@@ -362,6 +364,7 @@ param_policy "Set of possible data parameters for groups or grid, node, regulati
update_offset "Optional offset for delaying the reserve update frequency"
gate_closure "Number of timesteps ahead of dispatch that reserves are fixed"
* use_time_series "Flag for using time series data. !!! REDUNDANT WITH useTimeseries, PENDING REMOVAL !!!"
useTimeSeries "Flag for using time series data"
reserve_length "Length of reserve horizon"
reserveReliability "Reliability parameter of reserve provisions"
reserve_increase_ratio "Unit output is multiplied by this factor to get the increase in reserve demand"
......@@ -369,6 +372,8 @@ param_policy "Set of possible data parameters for groups or grid, node, regulati
offlineReserveCapability "Proportion of an offline unit which can contribute to a category of reserve"
ReserveShareMax "Maximum reserve share of a group of units"
LossOfTrans "A flag to tell that N-1 reserve is needed due to a possibility that an interconnector to/from the node group fails"
up "Upward direction, e.g. for reserve provisions"
down "Downward direction, e.g. for reserve provisions"
/
* --- Efficiency Approximation Related Sets -----------------------------------
......@@ -384,6 +389,7 @@ hrop(param_unit) "Operating points in the incremental heat rate curves, also fun
/hrop00*hrop12/ // IMPORTANT! Has to equal the same param_unit!
hr(param_unit) "Heat rate for the corresponding operating point ('hrop') in the heat rate curves, also used for data indexing"
/hr00*hr12/ // IMPORTANT! Has to equal the same param_unit!
* --- Counters and Directional Sets -------------------------------------------
// Slack categories
......@@ -401,4 +407,8 @@ spillLimits(param_gnBoundaryTypes) "set of upward and downward state limits"
/ maxSpill, minSpill /
useConstantOrTimeSeries(param_gnBoundaryProperties) "useTimeSeries and useConstant property together"
/ useTimeSeries, useConstant /
// Directional sets that are subsets of others
up_down(param_policy) "Direction set used by some variables, e.g. reserve provisions and generation ramps"
/ up, down /
; // END parameter set declarations
......@@ -18,17 +18,17 @@ $offtext
Sets
* --- Geography ---------------------------------------------------------------
grid "Forms of energy endogenously presented in the model" / empty /
node "Nodes where different types of energy are converted"
node "Nodes maintain the energy balance or track exogenous commodities"
* --- Fuels & resources -------------------------------------------------------
* --- Commodities & resources -------------------------------------------------------
emission "Emissions"
fuel "Fuels"
commodity(node) "Commodities that can be bought or sold exogenous to model"
flow "Flow based energy resources (time series)"
* --- Energy generation and consumption ---------------------------------------
unit "Set of generators, storages and loads"
unit_flow(unit) "Unit that depend directly on variable energy flows (RoR, solar PV, etc.)"
unit_fuel(unit) "Units using a commercial fuel"
unit_commodity(unit) "Units using an exogenous commodity with a price"
unit_fail(unit) "Units that might fail"
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 active effLevel"
......@@ -44,7 +44,9 @@ Sets
flowUnit(flow, *) "Units or storages linked to a certain energy flow time series"
unitUnittype(unit, *) "Link generation technologies to types"
unitStarttype(unit, starttype) "Units with special startup properties"
uFuel(unit, param_fuel, fuel) "Units linked with fuels"
un_commodity(unit, node) "Units linked with commodities"
un_commodity_in(unit, node) "Units linked with input commodities"
un_commodity_out(unit, node) "Units linked with output commodities"
unittype "Unit technology types"
unit_investLP(unit) "Units with continuous investments allowed"
unit_investMIP(unit) "Units with integer investments allowed"
......@@ -72,8 +74,6 @@ Sets
gnn_state(grid, node, node) "Nodes with state variables interconnected via diffusion"
gnn_boundState(grid, node, node) "Nodes with state variables bound by other nodes"
gn2gnu(grid, node, grid, node, unit) "Conversions between energy grids by specific units"
gngnu_fixedOutputRatio(grid, node, grid, node, unit) "Units with a fixed ratio between two different grids of output (e.g. backpressure)"
gngnu_constrainedOutputRatio(grid, node, grid, node, unit) "Units with a constrained ratio between two different grids of output (e.g. extraction)"
* --- Reserve types -----------------------------------------------------------
restype "Reserve types"
......@@ -197,7 +197,7 @@ alias(op, op_, op__);
alias(hrop, hrop_, hrop__);
alias(eff, eff_, eff__);
alias(hr, hr_, hr__);
alias(fuel, fuel_);
alias(commodity, commodity_);
alias(effLevel, effLevel_);
alias(restype, restype_);
alias(group, group_);
......
......@@ -43,28 +43,32 @@ Scalars
firstResultsOutputSolve /1/;
;
* --- Power plant and fuel data -----------------------------------------------
* --- Power plant and commodity data -----------------------------------------------
Parameters
p_gn(grid, node, param_gn) "Properties for energy nodes"
p_gnBoundaryPropertiesForStates(grid, node, param_gnBoundaryTypes, param_gnBoundaryProperties) "Properties of different state boundaries and limits"
p_gnn(grid, node, node, param_gnn) "Data for interconnections between energy nodes"
p_gnu(grid, node, unit, param_gnu) "Unit data where energy type matters"
p_gnu_io(grid, node, unit, input_output, param_gnu) "Unit data where energy type matters"
p_gnuBoundaryProperties(grid, node, unit, slack, param_gnuBoundaryProperties) "Properties for unit boundaries where energy type matters"
p_unit(unit, param_unit) "Unit data where energy type does not matter"
p_gnReserves(grid, node, restype, *) "Data defining the reserve rules in each node"
p_groupReserves(group, restype, *) "Data defining the reserve rules in each node group"
p_unitConstraint(unit, constraint) "Constant for constraints (eq1-9, gt1-9) between inputs and outputs"
p_unitConstraintNode(unit, constraint, node) "Coefficients for constraints (eq1-9, gt1-9) between inputs and outputs"
p_gnReserves(grid, node, restype, param_policy) "Data defining the reserve rules in each node"
p_groupReserves(group, restype, param_policy) "Data defining the reserve rules in each node group"
p_groupReserves3D(group, restype, up_down, param_policy) "Reserve policy in each node group separately for each reserve type and direction"
p_groupReserves4D(group, restype, up_down, group, param_policy) "Reserve policy in each node group separately for each reserve type and direction, also linking to another group"
p_gnuReserves(grid, node, unit, restype, *) "Reserve provision data for units"
p_gnuReserves(grid, node, unit, restype, param_policy) "Reserve provision data for units"
p_gnnReserves(grid, node, node, restype, up_down) "Reserve provision data for node node connections"
p_gnuRes2Res(grid, node, unit, restype, up_down, restype) "The first type of reserve can be used also in the second reserve category (with a possible multiplier)"
p_gnPolicy(grid, node, param_policy, *) "Policy data for grid, node"
p_groupPolicy(group, param_policy) "Two-dimensional policy data for groups"
p_groupPolicy3D(group, param_policy, *) "Three-dimensional policy data for groups"
p_fuelPrice(fuel, param_fuelPrice) "Fuel price parameters"
p_fuelEmission(fuel, emission) "Fuel emission content"
p_uFuel(unit, param_fuel, fuel, param_unitFuel) "Parameters interacting between units and fuels"
p_unitFuelEmissionCost(unit, fuel, emission) "Emission costs for each unit, calculated from input data"
p_price(node, param_price) "Commodity price parameters"
p_nEmission(node, emission) "Emission content (kg/MWh)"
p_uStartupfuel(unit, node, param_unitStartupfuel) "Parameters for startup fuels"
p_unStartup(unit, node, starttype) "Consumption during the start-up (MWh/start-up)"
p_unitEmissionCost(unit, node, emission) "Emission costs for each {unit, node, emission}, calculated from input data (CUR/MWh)"
p_effUnit(effSelector, unit, effSelector, param_eff) "Data for piece-wise linear efficiency blocks"
p_effGroupUnit(effSelector, unit, param_eff) "Unit data specific to a efficiency group (e.g. left border of the unit)"
p_uNonoperational(unit, starttype, min_max) "Non-operational time after being shut down before start up"
......@@ -83,7 +87,7 @@ Parameters
p_uCounter_shutdownMax(unit, counter) "Maximum output for the time steps where the unit is being shut down from the minimum load (minimum output in the first interval) (p.u.)"
p_u_minRampSpeedInLastRunUpInterval(unit) "Minimum ramp speed in the last interval for the run-up to min. load (p.u./min)"
p_u_minRampSpeedInFirstShutdownInterval(unit) "Minimum ramp speed in the fist interval for the shutdown from min. load (p.u./min)"
// Time dependent unit & fuel parameters
// Time dependent unit & commodity parameters
ts_unit(unit, param_unit, f, t) "Time dependent unit data, where energy type doesn't matter"
ts_effUnit(effSelector, unit, effSelector, param_eff, f, t) "Time dependent data for piece-wise linear efficiency blocks"
ts_effGroupUnit(effSelector, unit, param_eff, f, t) "Time dependent efficiency group unit data"
......@@ -157,17 +161,17 @@ 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_fuelPriceChange(fuel, t) "Initial fuel price and consequent changes in fuel price (EUR/MWh)"
ts_fuelPrice(fuel, t) "Fuel price time series (EUR/MWh)"
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)"
ts_unavailability(unit, t) "Unavailability of a unit in the time step (p.u.)"
// Aliases used in the equations after interval aggregation
// NOTE: Sample dimension has to be last because of the scenario reduction algorithm
ts_influx_(grid, node, s, f, t) "Mean external power inflow/outflow during a time step (MWh/h)"
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_fuelPrice_(fuel, t) "Mean fuel price time during time step (EUR/MWh)"
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"
// Aliases used for updating data in inputsLoop.gms
ts_unit_update(unit, param_unit, f, t)
......@@ -177,7 +181,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_fuelPriceChange_update(fuel, t)
ts_priceChange_update(node, t)
ts_unavailability_update(unit, t)
// Help parameters for calculating smoothening of time series
......
......@@ -29,8 +29,8 @@ Parameters
// Unit Operational Cost Components
r_gnuVOMCost(grid, node, unit, f, t) "Variable O&M costs for energy outputs (MEUR)"
r_gnuTotalVOMCost(grid, node, unit) "Total gnu VOM costs over the simulation (MEUR)"
r_uFuelEmissionCost(fuel, unit, f, t) "Unit fuel & emission costs for normal operation (MEUR)"
r_uTotalFuelEmissionCost(fuel, unit) "Total unit fuel & emission costs over the simulation for normal operation (MEUR)"
r_uFuelEmissionCost(node, unit, f, t) "Unit fuel & emission costs for normal operation (MEUR)"
r_uTotalFuelEmissionCost(commodity, unit) "Total unit fuel & emission costs over the simulation for normal operation (MEUR)"
r_uStartupCost(unit, f, t) "Unit startup VOM, fuel, & emission costs (MEUR)"
r_uShutdownCost(unit, f, t) "Unit startup VOM, fuel, & emission costs (MEUR)"
r_uTotalStartupCost(unit) "Total unit startup costs over the simulation (MEUR)"
......@@ -86,15 +86,16 @@ Parameters
// Results required for model structure
r_gen(grid, node, unit, f, t) "Energy generation for a unit (MW)"
r_gen_gnUnittype(grid, node, unittype) "Energy generation for each unittype in each node (MWh)"
// Fuel use results
r_fuelUse(fuel, unit, f, t) "Fuel use of units"
r_genFuel(grid, node, fuel, f, t) "Energy generation/consumption based on fuels / flows (MW)"
r_fuelUse(node, unit, f, t) "Fuel use of units"
r_genFuel(grid, node, *, f, t) "Energy generation/consumption based on fuels / flows (MW)"
r_genUnittype(grid, node, unittype, f, t) "Energy generation/consumption for each unittype (MW)"
r_gnTotalGenFuel(grid, node, fuel) "Total energy generation in gn per fuel over the simulation (MWh)"
r_gnTotalGenFuelShare(grid, node, fuel) "Total energy generation fuel consumption gn/g share"
r_gTotalGenFuel(grid, fuel) "Total energy generation in g per fuel over the simulation (MWh)"
r_totalGenFuel(fuel) "Total overall energy generation/consumption per fuel over the simulation (MWh)"
r_gnTotalGenFuel(grid, node, commodity) "Total energy generation in gn per fuel over the simulation (MWh)"
r_gnTotalGenFuelShare(grid, node, commodity) "Total energy generation fuel consumption gn/g share"
r_gTotalGenFuel(grid, commodity) "Total energy generation in g per fuel over the simulation (MWh)"
r_totalGenFuel(commodity) "Total overall energy generation/consumption per fuel over the simulation (MWh)"
// Interesting energy generation results
r_gnuTotalGen(grid, node, unit) "Total energy generation in gnu over the simulation (MWh)"
......
......@@ -28,16 +28,17 @@ $ifthen exist '%input_dir%/inputData.gdx'
$$loaddc unit
$$loaddc unitUnittype
$$loaddc unit_fail
$$loaddc fuel
$$loaddc commodity
$$loaddc unitUnitEffLevel
$$loaddc uFuel
$$loaddc effLevelGroupUnit
$$loaddc group
$$loaddc p_gn
$$loaddc p_gnn
$$loaddc p_gnu
$$loaddc p_gnu_io
$$loaddc p_gnuBoundaryProperties
$$loaddc p_unit
$$loaddc p_unitConstraint
$$loaddc p_unitConstraintNode
$$loaddc ts_unit
$$loaddc restype
$$loaddc restypeDirection
......@@ -52,15 +53,13 @@ $ifthen exist '%input_dir%/inputData.gdx'
$$loaddc ts_reserveDemand
$$loaddc p_gnBoundaryPropertiesForStates
$$loaddc p_gnPolicy
$$loaddc p_uFuel
$$loaddc p_uStartupfuel
$$loaddc flowUnit
$$loaddc gngnu_fixedOutputRatio
$$loaddc gngnu_constrainedOutputRatio
$$loaddc emission
$$loaddc p_fuelEmission
$$loaddc p_nEmission
$$loaddc ts_cf
* $$loaddc p_fuelPrice // Disabled for convenience, see line 278-> ("Determine Fuel Price Representation")
$$loaddc ts_fuelPriceChange
* $$loaddc p_price // Disabled for convenience, see line 278-> ("Determine Fuel Price Representation")
$$loaddc ts_priceChange
$$loaddc ts_influx
$$loaddc ts_node
$$loaddc t_invest
......@@ -116,25 +115,29 @@ $offtext
* --- Generate Unit Related Sets ----------------------------------------------
p_gnu(grid, node, unit, param_gnu) = sum(input_output, p_gnu_io(grid, node, unit, input_output, param_gnu));
// Set of all existing gnu
gnu(grid, node, unit)${ not sameas(grid, 'empty')
and ( p_gnu(grid, node, unit, 'maxGen')
or p_gnu(grid, node, unit, 'maxCons')
or p_gnu(grid, node, unit, 'unitSizeGen')
or p_gnu(grid, node, unit, 'unitSizeCons')
and ( p_gnu(grid, node, unit, 'capacity')
or p_gnu(grid, node, unit, 'unitSize')
or p_gnu(grid, node, unit, 'conversionCoeff')
)
}
= yes;
// Reduce the grid dimension
nu(node, unit) = sum(grid, gnu(grid, node, unit));
//p_gnu(grid, node, unit, 'capacity')$(p_gnu(grid, node, unit, 'capacity') = 0) = inf;
// Separation of gnu into inputs and outputs
gnu_output(gnu(grid, node, unit))${ p_gnu(grid, node, unit, 'maxGen')
or p_gnu(grid, node, unit, 'unitSizeGen')
gnu_output(gnu(grid, node, unit))${ p_gnu_io(grid, node, unit, 'output', 'capacity')
or p_gnu_io(grid, node, unit, 'output', 'unitSize')
or p_gnu_io(grid, node, unit, 'output', 'conversionCoeff')
}
= yes;
gnu_input(gnu(grid, node, unit))${ p_gnu(grid, node, unit, 'maxCons')
or p_gnu(grid, node, unit, 'unitSizeCons')
gnu_input(gnu(grid, node, unit))${ p_gnu_io(grid, node, unit, 'input', 'capacity')
or p_gnu_io(grid, node, unit, 'input', 'unitSize')
or p_gnu_io(grid, node, unit, 'input', 'conversionCoeff')
}
= yes;
......@@ -150,10 +153,13 @@ unit_minload(unit)${ p_unit(unit, 'op00') > 0 // If the first defined operati
}
= yes;
// Units with flows/fuels
// Units with flows/commodities
unit_flow(unit)${ sum(flow, flowUnit(flow, unit)) }
= yes;
unit_fuel(unit)${ sum(fuel, uFuel(unit, 'main', fuel)) }
un_commodity(unit, commodity)$sum(grid, gnu(grid, commodity, unit)) = yes;
un_commodity_in(unit, commodity)$sum(grid, gnu_input(grid, commodity, unit)) = yes;
un_commodity_out(unit, commodity)$sum(grid, gnu_output(grid, commodity, unit)) = yes;
unit_commodity(unit)${ sum(node, un_commodity(unit, node)) }
= yes;
// Units with investment variables
......@@ -199,25 +205,17 @@ p_unit(unit, 'unitCount')${ not p_unit(unit, 'unitCount')
// By default add outputs in order to get the total capacity of the unit
p_unit(unit, 'outputCapacityTotal')${ not p_unit(unit, 'outputCapacityTotal') }
= sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'maxGen'));
= sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'capacity'));
p_unit(unit, 'unitOutputCapacityTotal')
= sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSizeGen'));
= sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSize'));
// Assume unit sizes based on given maximum capacity parameters and unit counts if able
p_gnu(gnu(grid, node, unit), 'unitSizeGen')
${ not p_gnu(grid, node, unit, 'unitSizeGen')
and p_gnu(grid, node, unit, 'maxGen')
and p_unit(unit, 'unitCount')
}
= p_gnu(grid, node, unit, 'maxGen') / p_unit(unit, 'unitCount'); // If maxGen and unitCount are given, calculate unitSizeGen based on them.
p_gnu(gnu(grid, node, unit), 'unitSizeCons')
${ not p_gnu(grid, node, unit, 'unitSizeCons')
and p_gnu(grid, node, unit, 'maxCons')
p_gnu(gnu(grid, node, unit), 'unitSize')
${ not p_gnu(grid, node, unit, 'unitSize')
and p_gnu(grid, node, unit, 'capacity')
and p_unit(unit, 'unitCount')
}
= p_gnu(grid, node, unit, 'maxCons') / p_unit(unit, 'unitCount'); // If maxCons and unitCount are given, calculate unitSizeCons based on them.
p_gnu(gnu(grid, node, unit), 'unitSizeTot')
= p_gnu(grid, node, unit, 'unitSizeGen') + p_gnu(grid, node, unit, 'unitSizeCons');
= p_gnu(grid, node, unit, 'capacity') / p_unit(unit, 'unitCount'); // If capacity and unitCount are given, calculate unitSize based on them.
// Determine unit startup parameters based on data
// Hot startup parameters
......@@ -227,10 +225,10 @@ p_uNonoperational(unitStarttype(unit, 'hot'), 'max')
= p_unit(unit, 'startWarmAfterXhours');
p_uStartup(unitStarttype(unit, 'hot'), 'cost')
= p_unit(unit, 'startCostHot')
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSizeGen'));
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSize'));
p_uStartup(unitStarttype(unit, 'hot'), 'consumption')
= p_unit(unit, 'startFuelConsHot')
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSizeGen'));
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSize'));
// Warm startup parameters
p_uNonoperational(unitStarttype(unit, 'warm'), 'min')
......@@ -239,70 +237,59 @@ p_uNonoperational(unitStarttype(unit, 'warm'), 'max')
= p_unit(unit, 'startColdAfterXhours');
p_uStartup(unitStarttype(unit, 'warm'), 'cost')
= p_unit(unit, 'startCostWarm')
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSizeGen'));
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSize'));
p_uStartup(unitStarttype(unit, 'warm'), 'consumption')
= p_unit(unit, 'startFuelConsWarm')
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSizeGen'));
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSize'));
// Cold startup parameters
p_uNonoperational(unitStarttype(unit, 'cold'), 'min')
= p_unit(unit, 'startColdAfterXhours');
p_uStartup(unit, 'cold', 'cost')
= p_unit(unit, 'startCostCold')
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSizeGen'));
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSize'));
p_uStartup(unit, 'cold', 'consumption')
= p_unit(unit, 'startFuelConsCold')
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSizeGen'));
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSize'));
//shutdown cost parameters
p_uShutdown(unit, 'cost')
= p_unit(unit, 'shutdownCost')
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSizeGen'));
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSize'));
// Determine unit emission costs
p_unitFuelEmissionCost(unit_fuel, fuel, emission)${ sum(param_fuel, uFuel(unit_fuel, param_fuel, fuel)) }
= p_fuelEmission(fuel, emission)
p_unitEmissionCost(unit, node, emission)${nu(node, unit) and p_nEmission(node, emission)}
= p_nEmission(node, emission)
/ 1e3 // NOTE!!! Conversion to t/MWh from kg/MWh in data
* sum(gnu_output(grid, node, unit_fuel),
+ p_gnPolicy(grid, node, 'emissionTax', emission) // Weighted average of emission costs from different output energy types
* [ + p_gnu(grid, node, unit_fuel, 'maxGen')
+ p_gnu(grid, node, unit_fuel, 'unitSizeGen')${not p_gnu(grid, node, unit_fuel, 'maxGen')}
] // END * p_gnPolicy
) // END sum(gnu_output)
/ sum(gnu_output(grid, node, unit_fuel), // Weighted average of emission costs from different output energy types
+ p_gnu(grid, node, unit_fuel, 'maxGen')
+ p_gnu(grid, node, unit_fuel, 'unitSizeGen')$(not p_gnu(grid, node, unit_fuel, 'maxGen'))
) // END sum(gnu_output)
* sum(gnu_input(grid, node, unit),
+ p_gnPolicy(grid, node, 'emissionTax', emission)
)