Commit 7cc5c950 authored by Niina Helistö's avatar Niina Helistö
Browse files

Merge branch '#121_domain_checking' into 'dev'

Adding domain checking for a few parameters and sets

See merge request !11
parents 419bc30a 195f863a
......@@ -46,9 +46,9 @@ p_gnn
p_gnu
p_groupReserves
p_gnuReserves
p_gnPolicy
p_groupPolicy
p_groupPolicy3D
p_groupPolicyUnit
p_groupPolicyEmission
p_nEmission
p_unitEmissionCost
p_effUnit
......
......@@ -27,6 +27,7 @@ Sets
* --- Energy generation and consumption ---------------------------------------
unit "Set of generators, storages and loads"
unittype "Unit technology types"
unit_flow(unit) "Unit that depend directly on variable energy flows (RoR, solar PV, etc.)"
unit_commodity(unit) "Units using an exogenous commodity with a price"
unit_fail(unit) "Units that might fail"
......@@ -41,13 +42,12 @@ Sets
unit_noSlope(unit) "Units without piecewise linear efficiency constraints"
unitAggregator_unit(unit, unit) "Aggregate unit linked to aggregated units"
unitUnitEffLevel(unit, unit, EffLevel) "Aggregator unit linked to aggreted units with a definition when to start the aggregation"
flowUnit(flow, *) "Units or storages linked to a certain energy flow time series"
unitUnittype(unit, *) "Link generation technologies to types"
flowUnit(flow, unit) "Units linked to a certain energy flow time series"
unitUnittype(unit, unittype) "Link generation technologies to types"
unitStarttype(unit, starttype) "Units with special startup properties"
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"
unit_timeseries(unit) "Units with time series enabled"
......@@ -158,7 +158,7 @@ $if defined scenario
effGroupSelector(effSelector, effSelector) "Efficiency selectors included in efficiency groups, e.g. Lambda02 contains Lambda01 and Lambda02."
effLevelGroupUnit(effLevel, effSelector, unit) "What efficiency selectors are in use for each unit at each efficiency representation level"
effGroupSelectorUnit(effSelector, unit, effSelector) "Group name for efficiency selector set, e.g. Lambda02 contains Lambda01 and Lambda02"
mSettingsReservesInUse(mType, *, up_down) "Reserves that are used in each model type"
mSettingsReservesInUse(mType, restype, up_down) "Reserves that are used in each model type"
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"
shutdownCounter(unit, counter) "Counter used for unit shutdown intervals"
......
......@@ -62,9 +62,9 @@ Parameters
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_groupPolicyUnit(group, param_policy, unit) "Three-dimensional policy data for groups and units"
p_groupPolicyEmission(group, param_policy, emission) "Three-dimensional policy data for groups and emissions"
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"
......
......@@ -52,7 +52,6 @@ $ifthen exist '%input_dir%/inputData.gdx'
$$loaddc p_gnuRes2Res
$$loaddc ts_reserveDemand
$$loaddc p_gnBoundaryPropertiesForStates
$$loaddc p_gnPolicy
$$loaddc p_uStartupfuel
$$loaddc flowUnit
$$loaddc emission
......@@ -73,7 +72,8 @@ $ifthen exist '%input_dir%/inputData.gdx'
$$loaddc gnGroup
$$loaddc sGroup
$$loaddc p_groupPolicy
$$loaddc p_groupPolicy3D
$$loaddc p_groupPolicyUnit
$$loaddc p_groupPolicyEmission
$$loaddc gnss_bound
$$loaddc uss_bound
$$gdxin
......@@ -266,8 +266,8 @@ p_uShutdown(unit, 'cost')
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_input(grid, node, unit),
+ p_gnPolicy(grid, node, 'emissionTax', emission)
* sum(gnGroup(grid, node, group)$gnu_input(grid, node, unit),
+ p_groupPolicyEmission(group, 'emissionTax', emission)
)
;
......
......@@ -374,18 +374,6 @@ $ifthen exist '%input_dir%/p_gnBoundaryPropertiesForStates3.gdx'
$$gdxin
$endif
$ifthen exist '%input_dir%/p_gnPolicy2.gdx'
$$gdxin '%input_dir%/p_gnPolicy2.gdx'
$$loaddcm p_gnPolicy
$$gdxin
$endif
$ifthen exist '%input_dir%/p_gnPolicy3.gdx'
$$gdxin '%input_dir%/p_gnPolicy3.gdx'
$$loaddcm p_gnPolicy
$$gdxin
$endif
$ifthen exist '%input_dir%/p_uStartupFuel2.gdx'
$$gdxin '%input_dir%/p_uStartupFuel2.gdx'
$$loaddcm p_uStartupFuel
......@@ -614,15 +602,27 @@ $ifthen exist '%input_dir%/p_groupPolicy3.gdx'
$$gdxin
$endif
$ifthen exist '%input_dir%/p_groupPolicy3D2.gdx'
$$gdxin '%input_dir%/p_groupPolicy3D2.gdx'
$$loaddcm p_groupPolicy3D
$ifthen exist '%input_dir%/p_groupPolicyUnit2.gdx'
$$gdxin '%input_dir%/p_groupPolicyUnit2.gdx'
$$loaddcm p_groupPolicyUnit
$$gdxin
$endif
$ifthen exist '%input_dir%/p_groupPolicyUnit3.gdx'
$$gdxin '%input_dir%/p_groupPolicyUnit3.gdx'
$$loaddcm p_groupPolicyUnit
$$gdxin
$endif
$ifthen exist '%input_dir%/p_groupPolicyEmission2.gdx'
$$gdxin '%input_dir%/p_groupPolicyEmission2.gdx'
$$loaddcm p_groupPolicyEmission
$$gdxin
$endif
$ifthen exist '%input_dir%/p_groupPolicy3D3.gdx'
$$gdxin '%input_dir%/p_groupPolicy3D3.gdx'
$$loaddcm p_groupPolicy3D
$ifthen exist '%input_dir%/p_groupPolicyEmission3.gdx'
$$gdxin '%input_dir%/p_groupPolicyEmission3.gdx'
$$loaddcm p_groupPolicyEmission
$$gdxin
$endif
......
......@@ -2647,18 +2647,18 @@ $offtext
q_constrainedOnlineMultiUnit(group, sft(s, f, t))
${ p_groupPolicy(group, 'constrainedOnlineTotalMax')
or sum(unit$uGroup(unit, group), abs(p_groupPolicy3D(group, 'constrainedOnlineMultiplier', unit)))
or sum(unit$uGroup(unit, group), abs(p_groupPolicyUnit(group, 'constrainedOnlineMultiplier', unit)))
} ..
// Sum of multiplied online units
+ sum(unit$uGroup(unit, group),
+ p_groupPolicy3D(group, 'constrainedOnlineMultiplier', unit)
+ p_groupPolicyUnit(group, 'constrainedOnlineMultiplier', unit)
* [
+ v_online_LP(unit, s, f+df_central(f,t), t)
${uft_onlineLP(unit, f, t)}
+ v_online_MIP(unit, s, f+df_central(f,t), t)
${uft_onlineMIP(unit, f, t)}
] // END * p_groupPolicy3D(group, 'constrainedOnlineMultiplier', unit)
] // END * p_groupPolicyUnit(group, 'constrainedOnlineMultiplier', unit)
) // END sum(unit)
=L=
......@@ -2762,16 +2762,16 @@ q_capacityMargin(gn(grid, node), sft(s, f, t))
q_constrainedCapMultiUnit(group)
${ p_groupPolicy(group, 'constrainedCapTotalMax')
or sum(uGroup(unit, group), abs(p_groupPolicy3D(group, 'constrainedCapMultiplier', unit)))
or sum(uGroup(unit, group), abs(p_groupPolicyUnit(group, 'constrainedCapMultiplier', unit)))
} ..
// Sum of multiplied investments
+ sum(uGroup(unit, group),
+ p_groupPolicy3D(group, 'constrainedCapMultiplier', unit)
+ p_groupPolicyUnit(group, 'constrainedCapMultiplier', unit)
* [
+ v_invest_LP(unit)${unit_investLP(unit)}
+ v_invest_MIP(unit)${unit_investMIP(unit)}
] // END * p_groupPolicy3D(group, 'constrainedCapMultiplier', unit)
] // END * p_groupPolicyUnit(group, 'constrainedCapMultiplier', unit)
) // END sum(unit)
=L=
......@@ -2786,7 +2786,7 @@ q_constrainedCapMultiUnit(group)
// Is there any way to make it work?
q_emissioncap(group, emission)
${ p_groupPolicy3D(group, 'emissionCap', emission)
${ p_groupPolicyEmission(group, 'emissionCap', emission)
} ..
+ sum(msft(m, s, f, t)${sGroup(s, group)},
......@@ -2820,7 +2820,7 @@ q_emissioncap(group, emission)
=L=
// Permitted nodal emission cap
+ p_groupPolicy3D(group, 'emissionCap', emission)
+ p_groupPolicyEmission(group, 'emissionCap', emission)
;
*--- Maximum Energy -----------------------------------------------------------
......
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