Skip to content

Commit

Permalink
Create execute model and sub modules for market and grid optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaraBuettner committed Aug 17, 2023
1 parent 5de4712 commit 7165782
Show file tree
Hide file tree
Showing 3 changed files with 185 additions and 0 deletions.
25 changes: 25 additions & 0 deletions etrago/tools/execute.py → etrago/execute/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,31 @@ def lopf(self):
self.export_to_csv(path)


def optimize(self):
"""Run optimization of dispatch and grid and storage expansion based on arguments
Returns
-------
None.
"""

if self.args["method"]["type"] == "lopf":

self.lopf()

elif self.args["method"]["type"] == "market_grid": # besseren Namen finden

self.market_optimization()

self.market_results_to_grid()

self.grid_optimization()

else:
print("Method not defined")


def dispatch_disaggregation(self):
"""
Function running the tempral disaggregation meaning the optimization
Expand Down
70 changes: 70 additions & 0 deletions etrago/execute/grid_optimization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# -*- coding: utf-8 -*-
# Copyright 2016-2023 Flensburg University of Applied Sciences,
# Europa-Universität Flensburg,
# Centre for Sustainable Energy Systems,
# DLR-Institute for Networked Energy Systems
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# File description
"""
Defines the market optimization within eTraGo
"""
import os

if "READTHEDOCS" not in os.environ:
import logging
import time

import numpy as np
import pandas as pd


logger = logging.getLogger(__name__)

__copyright__ = (
"Flensburg University of Applied Sciences, "
"Europa-Universität Flensburg, "
"Centre for Sustainable Energy Systems, "
"DLR-Institute for Networked Energy Systems"
)
__license__ = "GNU Affero General Public License Version 3 (AGPL-3.0)"
__author__ = (
"ulfmueller, ClaraBuettner, CarlosEpia"
)


def grid_optimization(self):

add_redispatch_generators(self)

self.network.lopf(
solver_name=self.args["solver"],
solver_options=self.args["solver_options"],
pyomo=True,
extra_functionality=extra_functionality(),
formulation=self.args["model_formulation"],

)


def add_redispatch_generators(self):
"""Add ramp up and ramp down generators
Returns
-------
None.
"""
pass
90 changes: 90 additions & 0 deletions etrago/execute/market_optimization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# -*- coding: utf-8 -*-
# Copyright 2016-2023 Flensburg University of Applied Sciences,
# Europa-Universität Flensburg,
# Centre for Sustainable Energy Systems,
# DLR-Institute for Networked Energy Systems
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# File description
"""
Defines the market optimization within eTraGo
"""
import os

if "READTHEDOCS" not in os.environ:
import logging
import time

import numpy as np
import pandas as pd


logger = logging.getLogger(__name__)

__copyright__ = (
"Flensburg University of Applied Sciences, "
"Europa-Universität Flensburg, "
"Centre for Sustainable Energy Systems, "
"DLR-Institute for Networked Energy Systems"
)
__license__ = "GNU Affero General Public License Version 3 (AGPL-3.0)"
__author__ = (
"ulfmueller, ClaraBuettner, CarlosEpia"
)


def market_optimization(self):

build_market_model()

self.market_model.lopf(
solver_name=self.args["solver"],
solver_options=self.args["solver_options"],
pyomo=True,
extra_functionality=extra_functionality(),
formulation=self.args["model_formulation"],

)


def build_market_model():
"""Builds market model based on imported network from eTraGo
- import market regions from file or database
- Cluster network to market regions
-- consider marginal cost incl. generator noise when grouoping electrical
generation capacities
Returns
-------
None.
"""
# Not useful, just for demonstration
self.market_model = self.network.copy()



def extra_functionality():
"""Placeholder for extra functionalities within market optimization
Returns
-------
None.
"""

return None

0 comments on commit 7165782

Please sign in to comment.