Skip to content

Config file for complex modeling artifacts conversion #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions src/andromede/input_converter/src/cc_configuration/batteries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
#
# See AUTHORS.txt
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# SPDX-License-Identifier: MPL-2.0
#
# This file is part of the Antares project.

# Configuration file to convert a complex modelling artefact in an Antares study into an Andromede model.

loop:

iteration_key: zone #Key on which we iterate (for a given list of zone, we want to execute a loop : for zone in list_zone)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
iteration_key: zone #Key on which we iterate (for a given list of zone, we want to execute a loop : for zone in list_zone)
iteration_key: area #Key on which we iterate (for a given list of zone, we want to execute a loop : for zone in list_zone)

#In the following, the notation $zone$ means the value of the string variable "zone"
andromede-model: antares-historic.short-term-storage #we want to create components of such a model, with id being indexed by the iteration_key
andromede-component-id : battery_$zone$
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
andromede-component-id : battery_$zone$
andromede-component-id : battery_$area$



andromede-model-parameters-to-set-a-priori:
#TODO : we still have to see if the following parameters can be set a priori or have to be read in the Antares study,during the conversion.
#- id: lower_rule_curve
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the current modelling of batteries with the binding constraints define lower/upper rule curves (maybe implicitly ?) ? Otherwise set lower_rule_curve to 0 and upper-rule-curve to 1

#- id: lower_rule_curve
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#- id: lower_rule_curve
#- id: upper_rule_curve

#- id: p_max_injection_modulation # Read in p_max_injection
Copy link
Collaborator

@tbittar tbittar May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be read from the availability series of thermal clusters in z_batteries ? Or the link profile between the physical area and z_batteries ?

#- id: p_max_withdrawal_modulation # Read in p_max_withdrawal


- id: initial_level
time-dependent: false
scenario-dependent: false
value: -1.0 #TODO : The initial stock level constraint must be disabled or deleted in the Andromede ST storage model
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it is better to write a specialized short term storage models for batteries or we can keep the current one ? And usually the initial_level is at 0.5 ? Otherwise it may be optimized, in this case, we definitely need a different model


- id: inflows #No inflows in a battery model!
time-dependent: false
scenario-dependent: false
value: 0.0



antares-coupling-constraints-to-visit:

- id : batteries_$zone$
name: batteries_$zone$
to-delete: True #This flag means that the constraint should be deleted from the Antares Study, if hybrid mode is targetted
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by hybrid mode here ?

parameters-to-store:
- id-target-andromede-model-parameter: efficiency_injection #target parameter in the andromede-model
location-in-legacy-study: $zone$%z_batteries #where to read the parameter in the Antares coupling constraint
multiplication-factor: -1 # The parameter we read in Antares coupling constraint should be multiplied by -1 to create target param
- id-target-andromede-model-parameter: efficiency_withdrawal #there are different naming conventions between Antares CC model for batteries and the short-term storage model
#=> therefore there is an intervertion between injection and withdrawal (this is no mistake)
location-in-legacy-study: $zone$.$zone$_batteries_inj
multiplication-factor: 1
Copy link
Collaborator

@tbittar tbittar May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of giving the Antares components to iterate through, we could specify directly the location of the Andromede model parameters :

Suggested change
antares-coupling-constraints-to-visit:
- id : batteries_$zone$
name: batteries_$zone$
to-delete: True #This flag means that the constraint should be deleted from the Antares Study, if hybrid mode is targetted
parameters-to-store:
- id-target-andromede-model-parameter: efficiency_injection #target parameter in the andromede-model
location-in-legacy-study: $zone$%z_batteries #where to read the parameter in the Antares coupling constraint
multiplication-factor: -1 # The parameter we read in Antares coupling constraint should be multiplied by -1 to create target param
- id-target-andromede-model-parameter: efficiency_withdrawal #there are different naming conventions between Antares CC model for batteries and the short-term storage model
#=> therefore there is an intervertion between injection and withdrawal (this is no mistake)
location-in-legacy-study: $zone$.$zone$_batteries_inj
multiplication-factor: 1
- id: efficicency_injection
time-dependent: false
scenario-dependent: false
value: batteries_$zone$::$zone$%z_batteries
multiplication_factor: -1
- id: efficicency_withdrawal
time-dependent: false
scenario-dependent: false
value: batteries_$zone$::$zone$.$zone$_batteries_inj

And add a field a the end to list the legacy components to delete



- id : battery_level_$zone$
name : Battery_level_$zone$
to-delete: True
parameters-to-store: /


antares-links-to-visit:
- id : $zone$%z_batteries
name : $zone$%z_batteries
to-delete: True
parameters-to-store:
- id-target-andromede-model-parameter : injection_nominal_capacity
location-in-legacy-study: link_capacity #TODO : find the right id to describe link capacity? @tbittar
Copy link
Collaborator

@tbittar tbittar May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
location-in-legacy-study: link_capacity #TODO : find the right id to describe link capacity? @tbittar
location-in-legacy-study: input/links/$zone$/capacities/$zone$_direct.txt

multiplication-factor: 1


antares-nodes-to-visit: /

antares-clusters-to-visit:
- node.cluster_id: $zone$.$zone$_batteries_inj #node.cluster
to-delete: True
parameters-to-store:
- id-target-andromede-model-parameter : withdrawal_nominal_capacity
location-in-legacy-study: p_max_cluster #TODO : find the right id to describe cluster pmax? @tbittar
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
location-in-legacy-study: p_max_cluster #TODO : find the right id to describe cluster pmax? @tbittar
location-in-legacy-study: input/thermal/series/$zone$/$zone$_batteries_inj/series.txt

multiplication-factor: 1
- node.cluster_id : z_batteries.z_batteries_batteries_$zone$_1 #node.cluster in Antares study
to-delete: True
parameters-to-store:
- id-target-andromede-model-parameter : reservoir_capacity
location-in-legacy-study: p_max_cluster #TODO : find the right id to describe cluster pmax? @tbittar
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
location-in-legacy-study: p_max_cluster #TODO : find the right id to describe cluster pmax? @tbittar
location-in-legacy-study: input/thermal/series/z_batteries/z_batteries_batteries_$zone$_1/series.txt

multiplication-factor: 1
- node.cluster_id : z_batteries.z_batteries_batteries_$zone$_2 #node.cluster in Antares study
to-delete: True
parameters-to-store: /

antares-load-to-visit: /

andromede-connection-to-create: /

area-connections-to-create: #Hybrid connection to create
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why "hybrid" ?

- component: battery_$zone$
port: injection
area: $zone$




#We also have to delete the fictive node "z_batteries"

loop:
iteration_key: / #No loop, just 1 iteration.
andromede-model : /
andromede-component-id : /
antares-nodes-to-visit:
- id : z_batteries
name: z_batteries #TBC
to-delete: True
parameters-to-store: /
antares-nodes-to-visit: /
antares-clusters-to-visit:
antares-load-to-visit: /
andromede-connection-to-create: /
hybrid-connection-to-create: /
5 changes: 5 additions & 0 deletions tests/e2e/models/andromede-v1/test_andromede_v1_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ def test_model_behaviour(
)
status = problem.solver.Solve()
assert status == problem.solver.OPTIMAL
assert math.isclose(
problem.solver.Objective().Value(),
problem.solver.Objective().BestBound(),
rel_tol=relative_accuracy,
)
assert math.isclose(
reference_values[k, 0],
problem.solver.Objective().Value(),
Expand Down
Loading