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

Re-implementing dynamic generation portfolios (see issue #119). Unit...

Re-implementing dynamic generation portfolios (see issue #119). Unit investment variables still have the 't' dimension, although it is kind of redundant. Units have technical lifetimes (given in ut set) but links are assumed to stay in the system forever after they have been built. Cost discounting and multi-year horizons are considered in the objective function but not in the results outputting yet.
parent 07d4e924
...@@ -49,13 +49,15 @@ if (mType('building'), ...@@ -49,13 +49,15 @@ if (mType('building'),
// Define time span of samples // Define time span of samples
msStart('building', 's000') = 1; msStart('building', 's000') = 1;
msEnd('building', 's000') = msStart('building', 's000') + mSettings('building', 't_horizon'); msEnd('building', 's000') = msStart('building', 's000') + mSettings('building', 't_end') + mSettings('building', 't_horizon');
// Define the probability (weight) of samples // Define the probability (weight) of samples
p_msProbability('building', s) = 0; p_msProbability('building', s) = 0;
p_msProbability('building', 's000') = 1; p_msProbability('building', 's000') = 1;
p_msWeight('building', s) = 0; p_msWeight('building', s) = 0;
p_msWeight('building', 's000') = 1; p_msWeight('building', 's000') = 1;
p_msAnnuityWeight('building', s) = 0;
p_msAnnuityWeight('building', 's000') = 1;
* --- Define Time Step Intervals ---------------------------------------------- * --- Define Time Step Intervals ----------------------------------------------
......
...@@ -65,6 +65,10 @@ if (mType('invest'), ...@@ -65,6 +65,10 @@ if (mType('invest'),
p_msWeight('invest', 's000') = 8760/504; p_msWeight('invest', 's000') = 8760/504;
p_msWeight('invest', 's001') = 8760/504; p_msWeight('invest', 's001') = 8760/504;
p_msWeight('invest', 's002') = 8760/504; p_msWeight('invest', 's002') = 8760/504;
p_msAnnuityWeight('invest', s) = 0;
p_msAnnuityWeight('invest', 's000') = 1/3;
p_msAnnuityWeight('invest', 's001') = 1/3;
p_msAnnuityWeight('invest', 's002') = 1/3;
* --- Define Time Step Intervals ---------------------------------------------- * --- Define Time Step Intervals ----------------------------------------------
......
...@@ -59,13 +59,15 @@ if (mType('schedule'), ...@@ -59,13 +59,15 @@ if (mType('schedule'),
// Define time span of samples // Define time span of samples
msStart('schedule', 's000') = 1; msStart('schedule', 's000') = 1;
msEnd('schedule', 's000') = msStart('schedule', 's000') + mSettings('schedule', 't_horizon'); msEnd('schedule', 's000') = msStart('schedule', 's000') + mSettings('schedule', 't_end') + mSettings('schedule', 't_horizon'); // May not work if using scenarios
// Define the probability (weight) of samples // Define the probability (weight) of samples
p_msProbability('schedule', s) = 0; p_msProbability('schedule', s) = 0;
p_msProbability('schedule', 's000') = 1; p_msProbability('schedule', 's000') = 1;
p_msWeight('schedule', s) = 0; p_msWeight('schedule', s) = 0;
p_msWeight('schedule', 's000') = 1; p_msWeight('schedule', 's000') = 1;
p_msAnnuityWeight('schedule', s) = 0;
p_msAnnuityWeight('schedule', 's000') = 1;
// If using long-term samples, uncomment // If using long-term samples, uncomment
//ms_central('schedule', 's001') = yes; //ms_central('schedule', 's001') = yes;
......
...@@ -318,6 +318,8 @@ param_unit "Set of possible data parameters for units" / ...@@ -318,6 +318,8 @@ param_unit "Set of possible data parameters for units" /
maxUnitCount "Maximum number of units when making integer investments" maxUnitCount "Maximum number of units when making integer investments"
minUnitCount "Minimum number of units when making integer investments" minUnitCount "Minimum number of units when making integer investments"
lastStepNotAggregated "Last time step when the unit is not yet aggregated - calculated in inputsLoop.gms for units that have aggregation" lastStepNotAggregated "Last time step when the unit is not yet aggregated - calculated in inputsLoop.gms for units that have aggregation"
start "The relative position of the time step when the unit becomes available (calculated from ut(unit, t, start_end))"
end "The relative position of the time step when the unit becomes unavailable (calculated from ut(unit, t, start_end))"
/ /
param_eff "Parameters used for unit efficiency approximations" / param_eff "Parameters used for unit efficiency approximations" /
...@@ -402,4 +404,8 @@ spillLimits(param_gnBoundaryTypes) "set of upward and downward state limits" ...@@ -402,4 +404,8 @@ spillLimits(param_gnBoundaryTypes) "set of upward and downward state limits"
/ maxSpill, minSpill / / maxSpill, minSpill /
useConstantOrTimeSeries(param_gnBoundaryProperties) "useTimeSeries and useConstant property together" useConstantOrTimeSeries(param_gnBoundaryProperties) "useTimeSeries and useConstant property together"
/ useTimeSeries, useConstant / / useTimeSeries, useConstant /
// Other
start_end(param_unit) "Start and end, e.g. of unit lifetime"
/ start, end /
; // END parameter set declarations ; // END parameter set declarations
...@@ -137,7 +137,7 @@ $if defined scenario ...@@ -137,7 +137,7 @@ $if defined scenario
gn_forecasts(*, node, timeseries) "Which grid/flow, node and timeseries use short-term forecasts" gn_forecasts(*, node, timeseries) "Which grid/flow, node and timeseries use short-term forecasts"
gn_scenarios(*, node, timeseries) "Which grid/flow, node and timeseries have data for long-term scenarios" gn_scenarios(*, node, timeseries) "Which grid/flow, node and timeseries have data for long-term scenarios"
* --- Sets used for the changing unit aggregation and efficiency approximations * --- Sets used for the changing unit aggregation and efficiency approximations as well as unit lifetimes
uft(unit, f, t) "Active units on intervals, enables aggregation of units for later intervals" uft(unit, f, t) "Active units on intervals, enables aggregation of units for later intervals"
uft_online(unit, f, t) "Units with any online and startup variables on intervals" uft_online(unit, f, t) "Units with any online and startup variables on intervals"
uft_onlineLP(unit, f, t) "Units with LP online and startup variables on intervals" uft_onlineLP(unit, f, t) "Units with LP online and startup variables on intervals"
...@@ -161,12 +161,14 @@ $if defined scenario ...@@ -161,12 +161,14 @@ $if defined scenario
unitCounter(unit, counter) "Counter used for restricting excessive looping over the counter set when defining unit startup/shutdown/online time restrictions" unitCounter(unit, counter) "Counter used for restricting excessive looping over the counter set when defining unit startup/shutdown/online time restrictions"
runUpCounter(unit, counter) "Counter used for unit run-up intervals" runUpCounter(unit, counter) "Counter used for unit run-up intervals"
shutdownCounter(unit, counter) "Counter used for unit shutdown intervals" shutdownCounter(unit, counter) "Counter used for unit shutdown intervals"
ut(unit, t, start_end) "Time step when the unit becomes available/unavailable, e.g. because of technical lifetime"
* --- Sets used for grouping of units, transfer links, nodes, etc. ------------ * --- Sets used for grouping of units, transfer links, nodes, etc. ------------
uGroup(unit, group) "Units in particular groups" uGroup(unit, group) "Units in particular groups"
gnuGroup(grid, node, unit, group) "Combination of grids, nodes and units in particular groups" gnuGroup(grid, node, unit, group) "Combination of grids, nodes and units in particular groups"
gn2nGroup(grid, node, node, group) "Transfer links in particular groups" gn2nGroup(grid, node, node, group) "Transfer links in particular groups"
gnGroup(grid, node, group) "Combination of grids and nodes in particular groups" gnGroup(grid, node, group) "Combination of grids and nodes in particular groups"
sGroup(s, group) "Samples in particular groups"
* --- Set of timeseries that will be read from files between solves ----------- * --- Set of timeseries that will be read from files between solves -----------
mTimeseries_loop_read(mType, timeseries) "Those time series that will be read between solves" mTimeseries_loop_read(mType, timeseries) "Those time series that will be read between solves"
......
...@@ -96,6 +96,7 @@ Parameters ...@@ -96,6 +96,7 @@ Parameters
* --- Probability ------------------------------------------------------------- * --- Probability -------------------------------------------------------------
Parameters Parameters
p_msWeight(mType, s) "Temporal weight of sample: number of similar periods represented by sample s" p_msWeight(mType, s) "Temporal weight of sample: number of similar periods represented by sample s"
p_msAnnuityWeight(mType, s) "Temporal weight of sample: used when calculating annuities"
p_msProbability(mType, s) "Probability to reach sample conditioned on anchestor samples" p_msProbability(mType, s) "Probability to reach sample conditioned on anchestor samples"
p_mfProbability(mType, f) "Probability of forecast" p_mfProbability(mType, f) "Probability of forecast"
p_msft_probability(mType, s, f, t) "Probability of forecast" p_msft_probability(mType, s, f, t) "Probability of forecast"
...@@ -199,4 +200,5 @@ Parameters ...@@ -199,4 +200,5 @@ Parameters
p_storageValue(grid, node, t) "Value of stored something at the end of a time step" p_storageValue(grid, node, t) "Value of stored something at the end of a time step"
p_stepLength(mType, f, t) "Length of an interval in hours" p_stepLength(mType, f, t) "Length of an interval in hours"
p_stepLengthNoReset(mType, f, t) "Length of an interval in hours - includes also lengths of previously realized intervals" p_stepLengthNoReset(mType, f, t) "Length of an interval in hours - includes also lengths of previously realized intervals"
p_discountFactor(s) "Discount factor for samples when using a multi-year horizon"
; ;
...@@ -145,7 +145,7 @@ Parameters ...@@ -145,7 +145,7 @@ Parameters
* --- Investment Results ------------------------------------------------------ * --- Investment Results ------------------------------------------------------
// Interesting investment results // Interesting investment results
r_invest(unit) "Number/amount of invested sub-units" r_invest(unit, t) "Number/amount of invested sub-units"
r_investTransfer(grid, node, node, t) "Amount of invested transfer link capacity" r_investTransfer(grid, node, node, t) "Amount of invested transfer link capacity"
* --- Dummy Variable Results -------------------------------------------------- * --- Dummy Variable Results --------------------------------------------------
......
...@@ -63,12 +63,15 @@ $ifthen exist '%input_dir%/inputData.gdx' ...@@ -63,12 +63,15 @@ $ifthen exist '%input_dir%/inputData.gdx'
$$loaddc ts_fuelPriceChange $$loaddc ts_fuelPriceChange
$$loaddc ts_influx $$loaddc ts_influx
$$loaddc ts_node $$loaddc ts_node
$$loaddc p_discountFactor
$$loaddc t_invest $$loaddc t_invest
$$loaddc ut
$$loaddc p_storageValue $$loaddc p_storageValue
$$loaddc uGroup $$loaddc uGroup
$$loaddc gnuGroup $$loaddc gnuGroup
$$loaddc gn2nGroup $$loaddc gn2nGroup
$$loaddc gnGroup $$loaddc gnGroup
$$loaddc sGroup
$$loaddc p_groupPolicy $$loaddc p_groupPolicy
$$loaddc p_groupPolicy3D $$loaddc p_groupPolicy3D
$$loaddc gnss_bound $$loaddc gnss_bound
...@@ -280,6 +283,11 @@ p_unitFuelEmissionCost(unit_fuel, fuel, emission)${ sum(param_fuel, uFuel(unit_f ...@@ -280,6 +283,11 @@ p_unitFuelEmissionCost(unit_fuel, fuel, emission)${ sum(param_fuel, uFuel(unit_f
p_uFuel(uFuel(unit_fuel, 'startup', fuel), 'fixedFuelFraction')${ not p_uFuel(unit_fuel, 'startup', fuel, 'fixedFuelFraction') } p_uFuel(uFuel(unit_fuel, 'startup', fuel), 'fixedFuelFraction')${ not p_uFuel(unit_fuel, 'startup', fuel, 'fixedFuelFraction') }
= 1; = 1;
// Unit lifetime
loop(ut(unit, t, start_end),
p_unit(unit, start_end) = ord(t)
); // END loop(ut)
* ============================================================================= * =============================================================================
* --- Determine Fuel Price Representation ------------------------------------- * --- Determine Fuel Price Representation -------------------------------------
* ============================================================================= * =============================================================================
......
...@@ -494,6 +494,18 @@ $ifthen exist '%input_dir%/ts_node3.gdx' ...@@ -494,6 +494,18 @@ $ifthen exist '%input_dir%/ts_node3.gdx'
$$gdxin $$gdxin
$endif $endif
$ifthen exist '%input_dir%/p_discountFactor2.gdx'
$$gdxin '%input_dir%/p_discountFactor2.gdx'
$$loaddcm p_discountFactor
$$gdxin
$endif
$ifthen exist '%input_dir%/p_discountFactor3.gdx'
$$gdxin '%input_dir%/p_discountFactor3.gdx'
$$loaddcm p_discountFactor
$$gdxin
$endif
$ifthen exist '%input_dir%/t_invest2.gdx' $ifthen exist '%input_dir%/t_invest2.gdx'
$$gdxin '%input_dir%/t_invest2.gdx' $$gdxin '%input_dir%/t_invest2.gdx'
$$loaddcm t_invest $$loaddcm t_invest
...@@ -506,6 +518,18 @@ $ifthen exist '%input_dir%/t_invest3.gdx' ...@@ -506,6 +518,18 @@ $ifthen exist '%input_dir%/t_invest3.gdx'
$$gdxin $$gdxin
$endif $endif
$ifthen exist '%input_dir%/ut2.gdx'
$$gdxin '%input_dir%/ut2.gdx'
$$loaddcm ut
$$gdxin
$endif
$ifthen exist '%input_dir%/ut3.gdx'
$$gdxin '%input_dir%/ut3.gdx'
$$loaddcm ut
$$gdxin
$endif
$ifthen exist '%input_dir%/p_storageValue2.gdx' $ifthen exist '%input_dir%/p_storageValue2.gdx'
$$gdxin '%input_dir%/p_storageValue2.gdx' $$gdxin '%input_dir%/p_storageValue2.gdx'
$$loaddcm p_storageValue $$loaddcm p_storageValue
...@@ -566,6 +590,18 @@ $ifthen exist '%input_dir%/gnGroup3.gdx' ...@@ -566,6 +590,18 @@ $ifthen exist '%input_dir%/gnGroup3.gdx'
$$gdxin $$gdxin
$endif $endif
$ifthen exist '%input_dir%/sGroup2.gdx'
$$gdxin '%input_dir%/sGroup2.gdx'
$$loaddcm sGroup
$$gdxin
$endif
$ifthen exist '%input_dir%/sGroup3.gdx'
$$gdxin '%input_dir%/sGroup3.gdx'
$$loaddcm sGroup
$$gdxin
$endif
$ifthen exist '%input_dir%/p_groupPolicy2.gdx' $ifthen exist '%input_dir%/p_groupPolicy2.gdx'
$$gdxin '%input_dir%/p_groupPolicy2.gdx' $$gdxin '%input_dir%/p_groupPolicy2.gdx'
$$loaddcm p_groupPolicy $$loaddcm p_groupPolicy
......
...@@ -130,7 +130,8 @@ q_obj .. ...@@ -130,7 +130,8 @@ q_obj ..
) // END sum(gnuft_rampCost) ) // END sum(gnuft_rampCost)
] // END * p_sft_probability(s,f,t) ] // END * p_sft_probability(s,f,t)
// Discount costs
* p_discountFactor(s)
) // END sum over msft(m, s, f, t) ) // END sum over msft(m, s, f, t)
// Cost of energy storage change // Cost of energy storage change
...@@ -156,44 +157,50 @@ q_obj .. ...@@ -156,44 +157,50 @@ q_obj ..
) // END sum(gn_state) ) // END sum(gn_state)
// Investment Costs // Investment Costs
+ sum(t_invest(t), + sum(ms(m, s)${ sum(msft(m, s, f, t), 1) }, // consider ms only if it has active msft
+ sum(t_invest(t)${ord(t) <= msEnd(m, s)},
// Unit investment costs (including fixed operation and maintenance costs)
+ sum(gnu(grid, node, unit), // Unit investment costs (including fixed operation and maintenance costs)
+ v_invest_LP(unit, t)${ unit_investLP(unit) } + sum(gnu(grid, node, unit),
* p_gnu(grid, node, unit, 'unitSizeTot') + v_invest_LP(unit, t)${ unit_investLP(unit) and sum(msft(m, s, f, t_), uft(unit, f, t_))} // consider unit only if it is active in the sample
* [ * p_gnu(grid, node, unit, 'unitSizeTot')
+ p_gnu(grid, node, unit, 'invCosts') * p_gnu(grid, node, unit, 'annuity') * [
+ p_gnu(grid, node, unit, 'fomCosts') + p_gnu(grid, node, unit, 'invCosts') * p_gnu(grid, node, unit, 'annuity')
] + p_gnu(grid, node, unit, 'fomCosts')
+ v_invest_MIP(unit, t)${ unit_investMIP(unit) } ]
* p_gnu(grid, node, unit, 'unitSizeTot') + v_invest_MIP(unit, t)${ unit_investMIP(unit) and sum(msft(m, s, f, t_), uft(unit, f, t_))} // consider unit only if it is active in the sample
* [ * p_gnu(grid, node, unit, 'unitSizeTot')
+ p_gnu(grid, node, unit, 'invCosts') * p_gnu(grid, node, unit, 'annuity') * [
+ p_gnu(grid, node, unit, 'fomCosts') + p_gnu(grid, node, unit, 'invCosts') * p_gnu(grid, node, unit, 'annuity')
] + p_gnu(grid, node, unit, 'fomCosts')
) // END sum(gnu) ]
) // END sum(gnu)
// Transfer link investment costs
+ sum(gn2n_directional(grid, from_node, to_node), // Transfer link investment costs
+ v_investTransfer_LP(grid, from_node, to_node, t)${ gn2n_directional_investLP(grid, from_node, to_node) } + sum(gn2n_directional(grid, from_node, to_node),
* [ + v_investTransfer_LP(grid, from_node, to_node, t)${ gn2n_directional_investLP(grid, from_node, to_node) }
+ p_gnn(grid, from_node, to_node, 'invCost') * [
* p_gnn(grid, from_node, to_node, 'annuity') + p_gnn(grid, from_node, to_node, 'invCost')
+ p_gnn(grid, to_node, from_node, 'invCost') * p_gnn(grid, from_node, to_node, 'annuity')
* p_gnn(grid, to_node, from_node, 'annuity') + p_gnn(grid, to_node, from_node, 'invCost')
] // END * v_investTransfer_LP * p_gnn(grid, to_node, from_node, 'annuity')
+ v_investTransfer_MIP(grid, from_node, to_node, t)${ gn2n_directional_investMIP(grid, from_node, to_node) } ] // END * v_investTransfer_LP
* [ + v_investTransfer_MIP(grid, from_node, to_node, t)${ gn2n_directional_investMIP(grid, from_node, to_node) }
+ p_gnn(grid, from_node, to_node, 'unitSize') * [
* p_gnn(grid, from_node, to_node, 'invCost') + p_gnn(grid, from_node, to_node, 'unitSize')
* p_gnn(grid, from_node, to_node, 'annuity') * p_gnn(grid, from_node, to_node, 'invCost')
+ p_gnn(grid, to_node, from_node, 'unitSize') * p_gnn(grid, from_node, to_node, 'annuity')
* p_gnn(grid, to_node, from_node, 'invCost') + p_gnn(grid, to_node, from_node, 'unitSize')
* p_gnn(grid, to_node, from_node, 'annuity') * p_gnn(grid, to_node, from_node, 'invCost')
] // END * v_investTransfer_MIP * p_gnn(grid, to_node, from_node, 'annuity')
) // END sum(gn2n_directional) ] // END * v_investTransfer_MIP
) // END sum(t_invest) ) // END sum(gn2n_directional)
) // END sum(t_invest)
// Sample weighting to calculate annual costs
* p_msAnnuityWeight(m, s)
// Discount costs
* p_discountFactor(s)
) // END sum(ms)
$ifthen.addterms exist '%input_dir%/2c_additional_objective_terms.gms' $ifthen.addterms exist '%input_dir%/2c_additional_objective_terms.gms'
$$include '%input_dir%/2c_additional_objective_terms.gms'; $$include '%input_dir%/2c_additional_objective_terms.gms';
......
...@@ -2288,7 +2288,7 @@ q_stateUpwardLimit(gn_state(grid, node), msft(m, s, f, t)) ...@@ -2288,7 +2288,7 @@ q_stateUpwardLimit(gn_state(grid, node), msft(m, s, f, t))
+ ts_node_(grid, node, 'upwardLimit', s, f, t)${ p_gnBoundaryPropertiesForStates(grid, node, 'upwardLimit', 'useTimeseries') } + ts_node_(grid, node, 'upwardLimit', s, f, t)${ p_gnBoundaryPropertiesForStates(grid, node, 'upwardLimit', 'useTimeseries') }
// Investments // Investments
+ sum(gnu(grid, node, unit), + sum(gnu(grid, node, unit)${gnuft(grid, node, unit, f, t)},
+ p_gnu(grid, node, unit, 'upperLimitCapacityRatio') + p_gnu(grid, node, unit, 'upperLimitCapacityRatio')
* p_gnu(grid, node, unit, 'unitSizeTot') * p_gnu(grid, node, unit, 'unitSizeTot')
* sum(t_invest(t_)${ord(t_)<=ord(t)}, * sum(t_invest(t_)${ord(t_)<=ord(t)},
...@@ -2580,7 +2580,7 @@ q_inertiaMin(restypeDirectionGroup(restype_inertia, up_down, group), sft(s, f, t ...@@ -2580,7 +2580,7 @@ q_inertiaMin(restypeDirectionGroup(restype_inertia, up_down, group), sft(s, f, t
+ p_groupReserves(group, restype_inertia, up_down) + p_groupReserves(group, restype_inertia, up_down)
- sum(gnu(grid, node, unit)${ gnGroup(grid, node, group) - sum(gnu(grid, node, unit)${ gnGroup(grid, node, group)
and gnuft(grid, node, unit, f, t) and gnuft(grid, node, unit, f, t)
and gnuRescapable(restype_inertia, up_down, grid, node, unit) and gnuRescapable(restype_inertia, up_down, grid, node, unit)
}, },
+ v_reserve(restype_inertia, up_down, grid, node, unit, s, f, t) + v_reserve(restype_inertia, up_down, grid, node, unit, s, f, t)
) // END sum(gnu) ) // END sum(gnu)
...@@ -2812,7 +2812,7 @@ q_emissioncap(group, emission) ...@@ -2812,7 +2812,7 @@ q_emissioncap(group, emission)
${ p_groupPolicy3D(group, 'emissionCap', emission) ${ p_groupPolicy3D(group, 'emissionCap', emission)
} .. } ..
+ sum(msft(m, s, f, t), + sum(msft(m, s, f, t)${sGroup(s, group)},
+ p_msft_Probability(m,s,f,t) + p_msft_Probability(m,s,f,t)
* [ * [
// Time step length dependent emissions // Time step length dependent emissions
...@@ -2865,7 +2865,7 @@ q_energyShareMax(group) ...@@ -2865,7 +2865,7 @@ q_energyShareMax(group)
${ p_groupPolicy(group, 'energyShareMax') ${ p_groupPolicy(group, 'energyShareMax')
} .. } ..
+ sum(msft(m, s, f, t), + sum(msft(m, s, f, t)${sGroup(s, group)},
+ p_msft_Probability(m,s,f,t) + p_msft_Probability(m,s,f,t)
* p_stepLength(m, f, t) * p_stepLength(m, f, t)
* [ * [
...@@ -2905,7 +2905,7 @@ q_energyShareMin(group) ...@@ -2905,7 +2905,7 @@ q_energyShareMin(group)
${ p_groupPolicy(group, 'energyShareMin') ${ p_groupPolicy(group, 'energyShareMin')
} .. } ..
+ sum(msft(m, s, f, t), + sum(msft(m, s, f, t)${sGroup(s, group)},
+ p_msft_Probability(m,s,f,t) + p_msft_Probability(m,s,f,t)
* p_stepLength(m, f, t) * p_stepLength(m, f, t)
* [ * [
......
...@@ -326,9 +326,15 @@ $endif ...@@ -326,9 +326,15 @@ $endif
// Loop over defined samples // Loop over defined samples
loop(msf(mSolve, s, f)$msStart(mSolve, s), loop(msf(mSolve, s, f)$msStart(mSolve, s),
// Move the samples along with the dispatch // Move the samples along with the dispatch if scenarios are used
sft(s, ft(f, t))${ord(t) > msStart(mSolve, s) + tSolveFirst - 1 sft(s, ft(f, t))${ord(t) > msStart(mSolve, s) + tSolveFirst - 1
and ord(t) < msEnd(mSolve, s) + tSolveFirst and ord(t) < msEnd(mSolve, s) + tSolveFirst
and mSettings(mSolve, 'scenarios')
} = yes;
// Otherwise do not move the samples along with the rolling horizon
sft(s, ft(f, t))${ord(t) > msStart(mSolve, s)
and ord(t) <= msEnd(mSolve, s)
and not mSettings(mSolve, 'scenarios')
} = yes; } = yes;
); );
...@@ -557,6 +563,12 @@ uft(unit, ft(f, t))${ ( [ ...@@ -557,6 +563,12 @@ uft(unit, ft(f, t))${ ( [
// only units with capacities or investment option // only units with capacities or investment option
= yes; = yes;
// Units are not active before or after their lifetime
uft(unit, ft(f, t))${ [ ord(t) < p_unit(unit, 'start') and p_unit(unit, 'start') ]
or [ ord(t) >= p_unit(unit, 'end') and p_unit(unit, 'end') ]
}
= no;
// First ft:s for each aggregator unit // First ft:s for each aggregator unit
Option clear = uft_aggregator_first; Option clear = uft_aggregator_first;
loop(unit${unit_aggregator(unit)}, loop(unit${unit_aggregator(unit)},
......
...@@ -535,3 +535,26 @@ if( tSolveFirst <> mSettings(mSolve, 't_start'), // Avoid rewriting the fixes on ...@@ -535,3 +535,26 @@ if( tSolveFirst <> mSettings(mSolve, 't_start'), // Avoid rewriting the fixes on
} }
= r_online(unit, f, t); = r_online(unit, f, t);
); // END if ); // END if
* =============================================================================
* --- Fix previously realized investment results ------------------------------
* =============================================================================
v_invest_LP.fx(unit_investLP(unit), t_invest(t))${ p_unit(unit, 'start') <= tSolveFirst } // Should this be ord(t) <= tSolveFirst?
= r_invest(unit, t)
;
v_invest_MIP.fx(unit_investMIP(unit), t_invest(t))${ p_unit(unit, 'start') <= tSolveFirst } // Should this be ord(t) <= tSolveFirst?
= r_invest(unit, t)
;
v_investTransfer_LP.fx(gn2n_directional(grid, node, node_), t_invest(t))${ not p_gnn(grid, node, node_, 'investMIP')
and p_gnn(grid, node, node_, 'transferCapInvLimit')
and ord(t) <= tSolveFirst
}
= r_investTransfer(grid, node, node_, t)
;
v_investTransfer_MIP.fx(gn2n_directional(grid, node, node_), t_invest(t))${ p_gnn(grid, node, node_, 'investMIP')
and p_gnn(grid, node, node_, 'transferCapInvLimit')
and ord(t) <= tSolveFirst
}
= r_investTransfer(grid, node, node_, t) / p_gnn(grid, node, node_, 'unitSize')
;
...@@ -150,8 +150,10 @@ loop(sft_realized(s, f, t), ...@@ -150,8 +150,10 @@ loop(sft_realized(s, f, t),
; ;
); );
// Unit investments // Unit investments
r_invest(unit)${unit_investLP(unit) or unit_investMIP(unit)} r_invest(unit, t_invest(t))${ (unit_investLP(unit) or unit_investMIP(unit))
= sum(t_invest, v_invest_LP.l(unit, t_invest) + v_invest_MIP.l(unit, t_invest)) and ord(t) <= tSolveFirst + mSettings(mSolve, 't_jump')
}
= v_invest_LP.l(unit, t) + v_invest_MIP.l(unit, t)
; ;
// Link investments // Link investments
r_investTransfer(grid, node, node_, t_invest(t))${ p_gnn(grid, node, node_, 'transferCapInvLimit') r_investTransfer(grid, node, node_, t_invest(t))${ p_gnn(grid, node, node_, 'transferCapInvLimit')
......
...@@ -126,7 +126,7 @@ loop(m, ...@@ -126,7 +126,7 @@ loop(m,
* [ * [
+ p_gnu(grid, node, unit, 'maxGen') // Not in v_obj + p_gnu(grid, node, unit, 'maxGen') // Not in v_obj
+ p_gnu(grid, node, unit, 'maxCons') // Not in v_obj + p_gnu(grid, node, unit, 'maxCons') // Not in v_obj
+ r_invest(unit) + sum(t_invest, r_invest(unit, t_invest))
* p_gnu(grid, node, unit, 'unitSizeTot') * p_gnu(grid, node, unit, 'unitSizeTot')
] ]
* p_gnu(grid, node, unit, 'fomCosts'); * p_gnu(grid, node, unit, 'fomCosts');
...@@ -134,7 +134,7 @@ loop(m, ...@@ -134,7 +134,7 @@ loop(m,
// Unit investment costs // Unit investment costs
r_gnuUnitInvestmentCost(gnu(grid, node, unit)) r_gnuUnitInvestmentCost(gnu(grid, node, unit))
= 1e-6 // Scaling to MEUR = 1e-6 // Scaling to MEUR
* r_invest(unit) * sum(t_invest, r_invest(unit, t_invest))
* p_gnu(grid, node, unit, 'unitSizeTot') * p_gnu(grid, node, unit, 'unitSizeTot')
* p_gnu(grid, node, unit, 'invCosts') * p_gnu(grid, node, unit, 'invCosts')
* p_gnu(grid, node, unit, 'annuity'); * p_gnu(grid, node, unit, 'annuity');
...@@ -241,10 +241,14 @@ loop(m, ...@@ -241,10 +241,14 @@ loop(m,
); // END sum(ft_realizedNoReset) ); // END sum(ft_realizedNoReset)
// Approximate utilization rates for gnus over the simulation // Approximate utilization rates for gnus over the simulation
r_gnuUtilizationRate(gnu_output(grid, node, unit))${r_gnuTotalGen(grid, node, unit) and (p_gnu(grid, node, unit, 'maxGen') or r_invest(unit))} r_gnuUtilizationRate(gnu_output(grid, node, unit))${ r_gnuTotalGen(grid, node, unit)
and ( p_gnu(grid, node, unit, 'maxGen')
or sum(t_invest, r_invest(unit, t_invest))
)
}
= r_gnuTotalGen(grid, node, unit) = r_gnuTotalGen(grid, node, unit)
/ [ / [
+ (p_gnu(grid, node, unit, 'maxGen') + r_invest(unit)*p_gnu(grid, node, unit, 'unitSizeGen')) + (p_gnu(grid, node, unit, 'maxGen') + sum(t_invest, r_invest(unit, t_invest))*p_gnu(grid, node, unit, 'unitSizeGen'))
* (mSettings(m, 't_end') - (mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')) + 1) * (mSettings(m, 't_end') - (mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')) + 1)
* mSettings(m, 'stepLengthInHours') * mSettings(m, 'stepLengthInHours')
]; // END division ]; // END division
......
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