Skip to content

Commit

Permalink
Allow load shifting input and output capacity to be set independent f…
Browse files Browse the repository at this point in the history
…rom each other (#2981)

* Adding sliders in UI for demand load shifting

* changes to sliders

* Use new input_capacity_from_share attribute to read input_capacity during node calculation

* Setting max rate to 100 and setting up start value gql's for output shares

* Dont set start_value_gql to unneccessary value

* Dont set start_value_gql, set start_value

* Final changes to input capacity share for DSR load shifting

* Add failsafe if either input or output capacity of load shifiting is 0

* Update load shifting DSR input capacity inputs

Inputs are now specified by the user as share of peak capacity

* Update start_value_gql for input capacity of load shifting DSR

* Bump Atlas to quintel/atlas@2db914b

---------

Co-authored-by: Kas Kranenburg <[email protected]>
Co-authored-by: Mathijs Bijkerk <[email protected]>
  • Loading branch information
3 people authored Dec 19, 2023
1 parent a93d61b commit b615a7c
Show file tree
Hide file tree
Showing 14 changed files with 215 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gem 'rake'

group :development, :test do
gem 'roo'
gem 'atlas', ref: 'f7aebb9', github: 'quintel/atlas'
gem 'atlas', ref: '2db914b', github: 'quintel/atlas'
end

group :test do
Expand Down
20 changes: 10 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: https://github.com/quintel/atlas.git
revision: f7aebb944182f7b92fecb5f4188c3354a64c93c6
ref: f7aebb9
revision: 2db914bf62c4b95d5896d2d844f3da9abf7aef3e
ref: 2db914b
specs:
atlas (1.0.0)
activemodel (>= 7)
Expand Down Expand Up @@ -31,9 +31,9 @@ GIT
GEM
remote: https://rubygems.org/
specs:
activemodel (7.1.1)
activesupport (= 7.1.1)
activesupport (7.1.1)
activemodel (7.1.2)
activesupport (= 7.1.2)
activesupport (7.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
Expand All @@ -47,17 +47,17 @@ GEM
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
base64 (0.1.1)
bigdecimal (3.1.4)
base64 (0.2.0)
bigdecimal (3.1.5)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
csv (3.2.7)
csv (3.2.8)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.3)
drb (2.1.1)
drb (2.2.0)
ruby2_keywords
equalizer (0.0.11)
gpgme (2.0.23)
Expand All @@ -67,7 +67,7 @@ GEM
ice_nine (0.11.2)
mini_portile2 (2.8.2)
minitest (5.20.0)
mutex_m (0.1.2)
mutex_m (0.2.0)
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
- use = energetic
- groups = [preset_demand, load_shifting]

- merit_order.type = flex
- merit_order.input_capacity_from_share = 1.0
- merit_order.subtype = load_shifting
- merit_order.level = hv
- merit_order.demand_source = [industry_useful_demand_for_chemical_refineries_electricity, industry_useful_demand_for_chemical_fertilizers_electricity, industry_chemicals_fertilizers_captured_processes_co2_electricity, industry_chemicals_fertilizers_captured_combustion_co2_electricity, industry_useful_demand_for_chemical_other_electricity, industry_chemicals_other_heater_electricity, industry_chemicals_other_steam_recompression_electricity]
- merit_order.load_shifting_hours = 24

- marginal_costs = 200.0
- max_consumption_price = 200.0

- availability = 0.0
- number_of_units = 0.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
- use = energetic
- groups = [preset_demand, load_shifting]

- merit_order.type = flex
- merit_order.input_capacity_from_share = 1.0
- merit_order.subtype = load_shifting
- merit_order.level = mv
- merit_order.demand_source = [industry_steel_blastfurnace_bof, industry_steel_cyclonefurnace_bof, industry_steel_scrap_hbi_eaf, industry_steel_dri_hydrogen, industry_steel_dri_network_gas, industry_steel_external_coupling_node, industry_steel_blastfurnace_bof_captured_co2_electricity, industry_steel_cyclonefurnace_bof_captured_co2_electricity, industry_steel_dri_network_gas_captured_co2_electricity, industry_steel_external_coupling_node_captured_co2_electricity, industry_final_demand_for_metal_aluminium_electricity, industry_final_demand_for_metal_other_metals_electricity]
- merit_order.load_shifting_hours = 24

- marginal_costs = 200.0
- max_consumption_price = 200.0

- availability = 0.0
- number_of_units = 0.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
- use = energetic
- groups = [preset_demand, load_shifting]

- merit_order.type = flex
- merit_order.input_capacity_from_share = 1.0
- merit_order.subtype = load_shifting
- merit_order.level = hv
- merit_order.demand_source = [industry_useful_demand_for_other_food_electricity, industry_other_food_captured_co2_electricity, industry_other_food_heater_electricity, industry_useful_demand_for_other_paper_electricity, industry_other_paper_captured_co2_electricity, industry_final_demand_for_other_non_specified_electricity]
- merit_order.load_shifting_hours = 24

- marginal_costs = 200.0
- max_consumption_price = 200.0

- availability = 0.0
- number_of_units = 0.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
- use = energetic
- groups = [preset_demand, load_shifting]

- merit_order.type = flex
- merit_order.input_capacity_from_share = 1.0
- merit_order.subtype = load_shifting
- merit_order.level = hv
- merit_order.demand_source = [industry_final_demand_for_other_ict_electricity]
- merit_order.load_shifting_hours = 24

- marginal_costs = 200.0
- max_consumption_price = 200.0

- availability = 0.0
- number_of_units = 0.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# Load shifting is disabled is either the input (increased load) or the output (decreased load) capacity is set to 0.0%
# Load shifting output capacity = availability * peak capacity
# Load shifting input capacity = availablity * input share * peak capacity
# For more information see https://docs.energytransitionmodel.com/contrib/load-shifting

- query =
load_shifting_on = IF(
MIN(
USER_INPUT(),
INPUT_VALUE(input_capacity_of_industry_chemical_flexibility_load_shifting_electricity)
) == 0.0,
-> { 0.0 },
-> { 1.0 }
);

EACH(
UPDATE(V(industry_final_demand_for_chemical_dsr_load_shifting_electricity), availability, (USER_INPUT() / 100.0)),
UPDATE(V(industry_final_demand_for_chemical_dsr_load_shifting_electricity), number_of_units, 1.0),
UPDATE(V(industry_final_demand_for_chemical_dsr_load_shifting_electricity), number_of_units, load_shifting_on),
)

- priority = 0
- max_value = 50.0
- min_value = 0.0
- start_value = 0.0
- start_value_gql = present:V(industry_final_demand_for_chemical_dsr_load_shifting_electricity,availability) * 100.0
- step_value = 1.0
- unit = %
- update_period = future
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# Load shifting is disabled is either the input (increased load) or the output (decreased load) capacity is set to 0.0%
# Load shifting output capacity = availability * peak capacity
# Load shifting input capacity = availablity * input share * peak capacity
# For more information see https://docs.energytransitionmodel.com/contrib/load-shifting

- query =
load_shifting_on = IF(
MIN(
USER_INPUT(),
INPUT_VALUE(input_capacity_of_industry_metal_flexibility_load_shifting_electricity)
) == 0.0,
-> { 0.0 },
-> { 1.0 }
);

EACH(
UPDATE(V(industry_final_demand_for_metal_dsr_load_shifting_electricity), availability, (USER_INPUT() / 100.0)),
UPDATE(V(industry_final_demand_for_metal_dsr_load_shifting_electricity), number_of_units, 1.0),
UPDATE(V(industry_final_demand_for_metal_dsr_load_shifting_electricity), number_of_units, load_shifting_on),
)

- priority = 0
- max_value = 50.0
- min_value = 0.0
- start_value = 0.0
- start_value_gql = present:V(industry_final_demand_for_metal_dsr_load_shifting_electricity,availability) * 100.0
- step_value = 1.0
- unit = %
- update_period = future
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# Load shifting is disabled is either the input (increased load) or the output (decreased load) capacity is set to 0.0%
# Load shifting output capacity = availability * peak capacity
# Load shifting input capacity = availablity * input share * peak capacity
# For more information see https://docs.energytransitionmodel.com/contrib/load-shifting

- query =
load_shifting_on = IF(
MIN(
USER_INPUT(),
INPUT_VALUE(input_capacity_of_industry_other_flexibility_load_shifting_electricity)
) == 0.0,
-> { 0.0 },
-> { 1.0 }
);

EACH(
UPDATE(V(industry_final_demand_for_other_dsr_load_shifting_electricity), availability, (USER_INPUT() / 100.0)),
UPDATE(V(industry_final_demand_for_other_dsr_load_shifting_electricity), number_of_units, 1.0),
UPDATE(V(industry_final_demand_for_other_dsr_load_shifting_electricity), number_of_units, load_shifting_on),
)

- priority = 0
- max_value = 50.0
- min_value = 0.0
- start_value = 0.0
- start_value_gql = present:V(industry_final_demand_for_other_dsr_load_shifting_electricity,availability) * 100.0
- step_value = 1.0
- unit = %
- update_period = future
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# Load shifting is disabled is either the input (increased load) or the output (decreased load) capacity is set to 0.0%
# Load shifting output capacity = availability * peak capacity
# Load shifting input capacity = availablity * input share * peak capacity
# For more information see https://docs.energytransitionmodel.com/contrib/load-shifting

- query =
load_shifting_on = IF(
MIN(
USER_INPUT(),
INPUT_VALUE(input_capacity_of_industry_other_ict_flexibility_load_shifting_electricity)
) == 0.0,
-> { 0.0 },
-> { 1.0 }
);

EACH(
UPDATE(V(industry_final_demand_for_other_ict_dsr_load_shifting_electricity), availability, (USER_INPUT() / 100.0)),
UPDATE(V(industry_final_demand_for_other_ict_dsr_load_shifting_electricity), number_of_units, 1.0),
UPDATE(V(industry_final_demand_for_other_ict_dsr_load_shifting_electricity), number_of_units, load_shifting_on),
)

- priority = 0
- max_value = 50.0
- min_value = 0.0
- start_value = 0.0
- start_value_gql = present:V(industry_final_demand_for_other_ict_dsr_load_shifting_electricity,availability) * 100.0
- step_value = 1.0
- unit = %
- update_period = future
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Load shifting is disabled is either the input (increased load) or the output (decreased load) capacity is set to 0.0%
# Load shifting output capacity = availability * peak capacity
# Load shifting input capacity = availablity * input share * peak capacity
# Users specify the combined effect of availablity * input share, which is used to update the input share
# For more information see https://docs.energytransitionmodel.com/contrib/load-shifting

- query =
load_shifting_enabled = IF(
MIN(
INPUT_VALUE(capacity_of_industry_chemical_flexibility_load_shifting_electricity),
USER_INPUT()
) == 0.0,
-> { 0.0 },
-> { 1.0 }
);

availability = INPUT_VALUE(capacity_of_industry_chemical_flexibility_load_shifting_electricity);
input_share = DIVIDE(USER_INPUT(), availability);

EACH(
UPDATE(
V(industry_final_demand_for_chemical_dsr_load_shifting_electricity, merit_order), input_capacity_from_share,
input_share
),
UPDATE(V(industry_final_demand_for_chemical_dsr_load_shifting_electricity), number_of_units, load_shifting_enabled),
)

- priority = 0
- max_value = 50.0
- min_value = 0.0
- start_value_gql = present:V(industry_final_demand_for_chemical_dsr_load_shifting_electricity,"merit_order.input_capacity_from_share * availability") * 100.0
- step_value = 1.0
- unit = %
- update_period = future
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Load shifting is disabled is either the input (increased load) or the output (decreased load) capacity is set to 0.0%
# Load shifting output capacity = availability * peak capacity
# Load shifting input capacity = availablity * input share * peak capacity
# Users specify the combined effect of availablity * input share, which is used to update the input share
# For more information see https://docs.energytransitionmodel.com/contrib/load-shifting

- query =
load_shifting_enabled = IF(
MIN(
INPUT_VALUE(capacity_of_industry_metal_flexibility_load_shifting_electricity),
USER_INPUT()
) == 0.0,
-> { 0.0 },
-> { 1.0 }
);

availability = INPUT_VALUE(capacity_of_industry_metal_flexibility_load_shifting_electricity);
input_share = DIVIDE(USER_INPUT(), availability);

EACH(
UPDATE(
V(industry_final_demand_for_metal_dsr_load_shifting_electricity, merit_order), input_capacity_from_share,
input_share
),
UPDATE(V(industry_final_demand_for_metal_dsr_load_shifting_electricity), number_of_units, load_shifting_enabled),
)

- priority = 0
- max_value = 50.0
- min_value = 0.0
- start_value_gql = present:V(industry_final_demand_for_metal_dsr_load_shifting_electricity,"merit_order.input_capacity_from_share * availability") * 100.0
- step_value = 1.0
- unit = %
- update_period = future
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Load shifting is disabled is either the input (increased load) or the output (decreased load) capacity is set to 0.0%
# Load shifting output capacity = availability * peak capacity
# Load shifting input capacity = availablity * input share * peak capacity
# Users specify the combined effect of availablity * input share, which is used to update the input share
# For more information see https://docs.energytransitionmodel.com/contrib/load-shifting

- query =
load_shifting_enabled = IF(
MIN(
INPUT_VALUE(capacity_of_industry_other_flexibility_load_shifting_electricity),
USER_INPUT()
) == 0.0,
-> { 0.0 },
-> { 1.0 }
);

availability = INPUT_VALUE(capacity_of_industry_other_flexibility_load_shifting_electricity);
input_share = DIVIDE(USER_INPUT(), availability);

EACH(
UPDATE(
V(industry_final_demand_for_other_dsr_load_shifting_electricity, merit_order), input_capacity_from_share,
input_share
),
UPDATE(V(industry_final_demand_for_other_dsr_load_shifting_electricity), number_of_units, load_shifting_enabled),
)

- priority = 0
- max_value = 50.0
- min_value = 0.0
- start_value_gql = present:V(industry_final_demand_for_other_dsr_load_shifting_electricity,"merit_order.input_capacity_from_share * availability") * 100.0
- step_value = 1.0
- unit = %
- update_period = future
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Load shifting is disabled is either the input (increased load) or the output (decreased load) capacity is set to 0.0%
# Load shifting output capacity = availability * peak capacity
# Load shifting input capacity = availablity * input share * peak capacity
# Users specify the combined effect of availablity * input share, which is used to update the input share
# For more information see https://docs.energytransitionmodel.com/contrib/load-shifting

- query =
load_shifting_enabled = IF(
MIN(
INPUT_VALUE(capacity_of_industry_other_ict_flexibility_load_shifting_electricity),
USER_INPUT()
) == 0.0,
-> { 0.0 },
-> { 1.0 }
);

availability = INPUT_VALUE(capacity_of_industry_other_ict_flexibility_load_shifting_electricity);
input_share = DIVIDE(USER_INPUT(), availability);

EACH(
UPDATE(
V(industry_final_demand_for_other_ict_dsr_load_shifting_electricity, merit_order), input_capacity_from_share,
input_share
),
UPDATE(V(industry_final_demand_for_other_ict_dsr_load_shifting_electricity), number_of_units, load_shifting_enabled),
)

- priority = 0
- max_value = 50.0
- min_value = 0.0
- start_value_gql = present:V(industry_final_demand_for_other_ict_dsr_load_shifting_electricity,"merit_order.input_capacity_from_share * availability") * 100.0
- step_value = 1.0
- unit = %
- update_period = future

0 comments on commit b615a7c

Please sign in to comment.