-
Notifications
You must be signed in to change notification settings - Fork 13
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
Implement sclopf #710
Implement sclopf #710
Changes from 29 commits
6c43797
463116b
fb1ebb4
e354e05
40330e7
9aa1030
a17b3f5
1c9f194
d630249
4bdc346
fbeae8e
b8526fd
354b82f
2424a6b
cf436be
95c66ec
b984c9d
ef9b1f8
84ced25
f1f1057
e404039
701ce0e
1ca51b2
1e1f765
c80ae0f
2146de7
54510a3
e9425b1
984cb27
2aea2bb
083525c
2e0083d
ff0dc69
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
import datetime | ||
import os | ||
import os.path | ||
import pandas as pd | ||
|
||
__copyright__ = ( | ||
"Flensburg University of Applied Sciences, " | ||
|
@@ -51,7 +52,7 @@ | |
"db": "egon-data", # database session | ||
"gridversion": None, # None for model_draft or Version number | ||
"method": { # Choose method and settings for optimization | ||
"type": "market_grid", # type of optimization, 'lopf' or 'market_grid' | ||
"type": "market_grid", # type of optimization, 'lopf', 'sclopf or 'market_grid' | ||
"n_iter": 1, # abort criterion of iterative optimization, 'n_iter' or 'threshold' | ||
"pyomo": True, # set if pyomo is used for model building | ||
"formulation": "pyomo", | ||
|
@@ -736,6 +737,9 @@ def run_etrago(args, json_path): | |
# skip snapshots | ||
etrago.skip_snapshots() | ||
|
||
# Temporary drop DLR as it is currently not working with sclopf | ||
etrago.network.lines_t.s_max_pu = pd.DataFrame(index=etrago.network.snapshots, columns=etrago.network.lines.index, data=1.) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As it is implemented, we will be dropping DLR also for LOPF or market_grid. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is also needed for market_grid as that method also used the sclopf. But I can adjust it for the lopf |
||
|
||
# start linear optimal powerflow calculations | ||
|
||
etrago.network.storage_units.cyclic_state_of_charge = True | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -418,6 +418,15 @@ def optimize(self): | |
|
||
self.grid_optimization() | ||
|
||
elif self.args["method"]["type"] == "sclopf": | ||
self.sclopf( | ||
post_lopf=False, | ||
extra_functionality=None, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function
|
||
n_process=4, | ||
delta=0.01, | ||
n_overload=0, | ||
div_ext_lines=False, | ||
) | ||
else: | ||
print("Method not defined") | ||
|
||
|
@@ -579,7 +588,8 @@ def import_gen_from_links(network, drop_small_capacities=True): | |
df["control"] = "PV" | ||
df.reset_index(inplace=True) | ||
|
||
df.index = df.bus + " " + df.carrier | ||
if not df.empty: | ||
df.index = df.bus + " " + df.carrier | ||
|
||
# Aggregate disptach time series for new generators | ||
gas_to_add["bus1_carrier"] = gas_to_add.bus + " " + gas_to_add.carrier | ||
|
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 update the description of the "type" parameter in the docstrings