-
Notifications
You must be signed in to change notification settings - Fork 1
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
Models with stock #33
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # tests/unittests/test_quota_co2.py
# Conflicts: # src/andromede/libs/standard_sc.yml # tests/models/test_electrolyzer_n_inputs.py # tests/models/test_quota_co2.py # tests/unittests/model/test_electrolyzer_n_inputs.py # tests/unittests/model/test_quota_co2.py # tests/unittests/test_electrolyzer_n_inputs.py # tests/unittests/test_quota_co2.py
# Conflicts: # src/andromede/libs/standard_sc.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a description such as (if my understanding is correct)
A link with storage behaves like a short-term storage that can inject/withdraw to/from 2 areas.
What about N areas ? Is there any technical barrrier ?
float_parameter("f_from_max", CONSTANT), | ||
float_parameter("f_to_max", CONSTANT), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
float_parameter("f_from_max", CONSTANT), | |
float_parameter("f_to_max", CONSTANT), | |
float_parameter("f_from_min", CONSTANT), | |
float_parameter("f_to_min", CONSTANT), | |
float_parameter("f_from_max", CONSTANT), | |
float_parameter("f_to_max", CONSTANT), |
variables=[ | ||
float_variable("r", lower_bound=literal(0), upper_bound=param("capacity")), | ||
float_variable( | ||
"f_from", lower_bound=-param("f_from_max"), upper_bound=param("f_from_max") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"f_from", lower_bound=-param("f_from_max"), upper_bound=param("f_from_max") | |
"f_from", lower_bound=param("f_from_min"), upper_bound=param("f_from_max") |
"f_from", lower_bound=-param("f_from_max"), upper_bound=param("f_from_max") | ||
), | ||
float_variable( | ||
"f_to", lower_bound=-param("f_to_max"), upper_bound=param("f_to_max") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"f_to", lower_bound=-param("f_to_max"), upper_bound=param("f_to_max") | |
"f_to", lower_bound=param("f_to_min"), upper_bound=param("f_to_max") |
constraints=[ | ||
Constraint( | ||
name="Level", | ||
expression=var("f_from") == (var("f_from+") - var("f_from-")), | ||
), | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This model is incomplete (missing shift operators at least). Was it superseded by the yml ? If so, I suggest removing standard_sc.py completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it seems to be superseeded by the model in the yml
constraints=[ | ||
Constraint( | ||
name="Level", | ||
expression=var("f_from") == (var("f_from+") - var("f_from-")), | ||
), | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it seems to be superseeded by the model in the yml
field: flow | ||
definition: f_to | ||
constraints: | ||
- name: max0_from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More explicit name : positive_part_flow_from
constraints: | ||
- name: max0_from | ||
expression: f_from = f_from_p - f_from_m | ||
- name: max0_to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
expression: f_from = f_from_p - f_from_m | ||
- name: max0_to | ||
expression: f_to = f_to_p - f_to_m | ||
- name: r_t1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More explicit name : storage_dynamics
expression: f_to = f_to_p - f_to_m | ||
- name: r_t1 | ||
expression: r[t+1] = r[t] + f_from - f_to | ||
- name: r0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initial_level
- name: p_max | ||
type: constant | ||
value: 200 | ||
- id: GS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be more explicit in names for faster understanding (gas_storage
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applies for all components and nodes
type: flow | ||
binding-constraints: | ||
- name: sum | ||
expression: sum_connections(flow_k.flow) = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the syntax for sum(alpha)
is not defined in lower level for now, we need to add parameters in the sum operator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some models are defined in local libraries for tests, delete the incomplete, unsed ones from here (storage_final_level
, storage_final_level_input
), maybe others ?
expression: r[t+1] = r[t] - u1[t] - u2[t] | ||
- name: r0 | ||
expression: r[0] = initial_level | ||
- name: rt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final level probably not working for now
PortRef(gaz_node_2, "injection_port"), PortRef(gaz_prod, "injection_port") | ||
) | ||
network.connect(PortRef(gaz_node_2, "injection_port"), PortRef(pipeline, "flow_to")) | ||
network.connect(PortRef(gaz_node_2, "injection_port"), PortRef(pipeline, "flow_to")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous line....
#15