mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-08-25 15:01:14 +00:00
Migrate from Flask to FastAPI (#163)
* Migrate from Flask to FastAPI * FastAPI migration: - Use pydantic model classes as input parameters to the data/calculation classes. - Interface field names changed to constructor parameter names (for simplicity only during transition, should be updated in a followup PR). - Add basic interface requirements (e.g. some values > 0, etc.). * Update tests for new data format. * Python requirement down to 3.9 (TypeGuard no longer needed) * Makefile: Add helpful targets (e.g. development server with reload) * Move API doc from README to pydantic model classes (swagger) * Link to swagger.io with own openapi.yml. * Commit openapi.json and check with pytest for changes so the documentation is always up-to-date. * Streamline docker * FastAPI: Run startup action on dev server * Fix config for /strompreis, endpoint still broken however. * test_openapi: Compare against docs/.../openapi.json * Move fastapi to server/ submodule * See #187 for new repository structure.
This commit is contained in:
committed by
GitHub
parent
057f86d580
commit
2f5f844018
@@ -50,7 +50,7 @@ def server(xprocess, tmp_path: Path):
|
||||
# assure server to be installed
|
||||
try:
|
||||
subprocess.run(
|
||||
[sys.executable, "-c", "import akkudoktoreosserver"],
|
||||
[sys.executable, "-c", "import akkudoktoreos.server"],
|
||||
check=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
@@ -65,11 +65,11 @@ def server(xprocess, tmp_path: Path):
|
||||
)
|
||||
|
||||
# command to start server process
|
||||
args = [sys.executable, "-m", "akkudoktoreosserver.flask_server"]
|
||||
args = [sys.executable, "-m", "akkudoktoreos.server.fastapi_server"]
|
||||
env = {EOS_DIR: f"{tmp_path}", **os.environ.copy()}
|
||||
|
||||
# startup pattern
|
||||
pattern = "Debugger PIN:"
|
||||
pattern = "Application startup complete."
|
||||
# search the first 30 lines for the startup pattern, if not found
|
||||
# a RuntimeError will be raised informing the user
|
||||
max_read_lines = 30
|
||||
@@ -81,14 +81,14 @@ def server(xprocess, tmp_path: Path):
|
||||
terminate_on_interrupt = True
|
||||
|
||||
# ensure process is running and return its logfile
|
||||
logfile = xprocess.ensure("akkudoktoreosserver", Starter)
|
||||
logfile = xprocess.ensure("eos", Starter)
|
||||
|
||||
# create url/port info to the server
|
||||
url = "http://127.0.0.1:8503"
|
||||
yield url
|
||||
|
||||
# clean up whole process tree afterwards
|
||||
xprocess.getinfo("akkudoktoreosserver").terminate()
|
||||
xprocess.getinfo("eos").terminate()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
25
tests/generate_openapi.py
Normal file
25
tests/generate_openapi.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from fastapi.openapi.utils import get_openapi
|
||||
|
||||
from akkudoktoreos.server.fastapi_server import app
|
||||
|
||||
|
||||
def generate_openapi(filename: str | Path = "openapi.json"):
|
||||
with open(filename, "w") as f:
|
||||
json.dump(
|
||||
get_openapi(
|
||||
title=app.title,
|
||||
version=app.version,
|
||||
openapi_version=app.openapi_version,
|
||||
description=app.description,
|
||||
routes=app.routes,
|
||||
),
|
||||
f,
|
||||
indent=2,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
generate_openapi()
|
@@ -1,6 +1,6 @@
|
||||
import unittest
|
||||
|
||||
from akkudoktoreos.class_akku import PVAkku
|
||||
from akkudoktoreos.class_akku import PVAkku, PVAkkuParameters
|
||||
|
||||
|
||||
class TestPVAkku(unittest.TestCase):
|
||||
@@ -14,21 +14,25 @@ class TestPVAkku(unittest.TestCase):
|
||||
|
||||
def test_initial_state_of_charge(self):
|
||||
akku = PVAkku(
|
||||
self.kapazitaet_wh,
|
||||
PVAkkuParameters(
|
||||
kapazitaet_wh=self.kapazitaet_wh,
|
||||
start_soc_prozent=50,
|
||||
min_soc_prozent=self.min_soc_prozent,
|
||||
max_soc_prozent=self.max_soc_prozent,
|
||||
),
|
||||
hours=1,
|
||||
start_soc_prozent=50,
|
||||
min_soc_prozent=self.min_soc_prozent,
|
||||
max_soc_prozent=self.max_soc_prozent,
|
||||
)
|
||||
self.assertEqual(akku.ladezustand_in_prozent(), 50.0, "Initial SoC should be 50%")
|
||||
|
||||
def test_discharge_below_min_soc(self):
|
||||
akku = PVAkku(
|
||||
self.kapazitaet_wh,
|
||||
PVAkkuParameters(
|
||||
kapazitaet_wh=self.kapazitaet_wh,
|
||||
start_soc_prozent=50,
|
||||
min_soc_prozent=self.min_soc_prozent,
|
||||
max_soc_prozent=self.max_soc_prozent,
|
||||
),
|
||||
hours=1,
|
||||
start_soc_prozent=50,
|
||||
min_soc_prozent=self.min_soc_prozent,
|
||||
max_soc_prozent=self.max_soc_prozent,
|
||||
)
|
||||
akku.reset()
|
||||
# Try to discharge more energy than available above min_soc
|
||||
@@ -43,11 +47,13 @@ class TestPVAkku(unittest.TestCase):
|
||||
|
||||
def test_charge_above_max_soc(self):
|
||||
akku = PVAkku(
|
||||
self.kapazitaet_wh,
|
||||
PVAkkuParameters(
|
||||
kapazitaet_wh=self.kapazitaet_wh,
|
||||
start_soc_prozent=50,
|
||||
min_soc_prozent=self.min_soc_prozent,
|
||||
max_soc_prozent=self.max_soc_prozent,
|
||||
),
|
||||
hours=1,
|
||||
start_soc_prozent=50,
|
||||
min_soc_prozent=self.min_soc_prozent,
|
||||
max_soc_prozent=self.max_soc_prozent,
|
||||
)
|
||||
akku.reset()
|
||||
# Try to charge more energy than available up to max_soc
|
||||
@@ -62,11 +68,13 @@ class TestPVAkku(unittest.TestCase):
|
||||
|
||||
def test_charging_at_max_soc(self):
|
||||
akku = PVAkku(
|
||||
self.kapazitaet_wh,
|
||||
PVAkkuParameters(
|
||||
kapazitaet_wh=self.kapazitaet_wh,
|
||||
start_soc_prozent=80,
|
||||
min_soc_prozent=self.min_soc_prozent,
|
||||
max_soc_prozent=self.max_soc_prozent,
|
||||
),
|
||||
hours=1,
|
||||
start_soc_prozent=80,
|
||||
min_soc_prozent=self.min_soc_prozent,
|
||||
max_soc_prozent=self.max_soc_prozent,
|
||||
)
|
||||
akku.reset()
|
||||
# Try to charge when SoC is already at max_soc
|
||||
@@ -80,11 +88,13 @@ class TestPVAkku(unittest.TestCase):
|
||||
|
||||
def test_discharging_at_min_soc(self):
|
||||
akku = PVAkku(
|
||||
self.kapazitaet_wh,
|
||||
PVAkkuParameters(
|
||||
kapazitaet_wh=self.kapazitaet_wh,
|
||||
start_soc_prozent=20,
|
||||
min_soc_prozent=self.min_soc_prozent,
|
||||
max_soc_prozent=self.max_soc_prozent,
|
||||
),
|
||||
hours=1,
|
||||
start_soc_prozent=20,
|
||||
min_soc_prozent=self.min_soc_prozent,
|
||||
max_soc_prozent=self.max_soc_prozent,
|
||||
)
|
||||
akku.reset()
|
||||
# Try to discharge when SoC is already at min_soc
|
||||
@@ -99,11 +109,13 @@ class TestPVAkku(unittest.TestCase):
|
||||
def test_soc_limits(self):
|
||||
# Test to ensure that SoC never exceeds max_soc or drops below min_soc
|
||||
akku = PVAkku(
|
||||
self.kapazitaet_wh,
|
||||
PVAkkuParameters(
|
||||
kapazitaet_wh=self.kapazitaet_wh,
|
||||
start_soc_prozent=50,
|
||||
min_soc_prozent=self.min_soc_prozent,
|
||||
max_soc_prozent=self.max_soc_prozent,
|
||||
),
|
||||
hours=1,
|
||||
start_soc_prozent=50,
|
||||
min_soc_prozent=self.min_soc_prozent,
|
||||
max_soc_prozent=self.max_soc_prozent,
|
||||
)
|
||||
akku.reset()
|
||||
akku.soc_wh = (
|
||||
|
@@ -1,10 +1,16 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
from akkudoktoreos.class_akku import PVAkku
|
||||
from akkudoktoreos.class_ems import EnergieManagementSystem
|
||||
from akkudoktoreos.class_haushaltsgeraet import Haushaltsgeraet
|
||||
from akkudoktoreos.class_inverter import Wechselrichter
|
||||
from akkudoktoreos.class_akku import EAutoParameters, PVAkku, PVAkkuParameters
|
||||
from akkudoktoreos.class_ems import (
|
||||
EnergieManagementSystem,
|
||||
EnergieManagementSystemParameters,
|
||||
)
|
||||
from akkudoktoreos.class_haushaltsgeraet import (
|
||||
Haushaltsgeraet,
|
||||
HaushaltsgeraetParameters,
|
||||
)
|
||||
from akkudoktoreos.class_inverter import Wechselrichter, WechselrichterParameters
|
||||
from akkudoktoreos.config import AppConfig
|
||||
|
||||
prediction_hours = 48
|
||||
@@ -17,21 +23,30 @@ start_hour = 1
|
||||
def create_ems_instance(tmp_config: AppConfig) -> EnergieManagementSystem:
|
||||
"""Fixture to create an EnergieManagementSystem instance with given test parameters."""
|
||||
# Initialize the battery and the inverter
|
||||
akku = PVAkku(kapazitaet_wh=5000, start_soc_prozent=80, hours=48, min_soc_prozent=10)
|
||||
akku = PVAkku(
|
||||
PVAkkuParameters(kapazitaet_wh=5000, start_soc_prozent=80, min_soc_prozent=10),
|
||||
hours=prediction_hours,
|
||||
)
|
||||
akku.reset()
|
||||
wechselrichter = Wechselrichter(10000, akku)
|
||||
wechselrichter = Wechselrichter(WechselrichterParameters(max_leistung_wh=10000), akku)
|
||||
|
||||
# Household device (currently not used, set to None)
|
||||
home_appliance = Haushaltsgeraet(
|
||||
HaushaltsgeraetParameters(
|
||||
verbrauch_wh=2000,
|
||||
dauer_h=2,
|
||||
),
|
||||
hours=prediction_hours,
|
||||
verbrauch_wh=2000,
|
||||
dauer_h=2,
|
||||
)
|
||||
home_appliance.set_startzeitpunkt(2)
|
||||
|
||||
# Example initialization of electric car battery
|
||||
eauto = PVAkku(kapazitaet_wh=26400, start_soc_prozent=10, hours=48, min_soc_prozent=10)
|
||||
eauto.set_charge_per_hour(np.full(48, 1))
|
||||
eauto = PVAkku(
|
||||
EAutoParameters(kapazitaet_wh=26400, start_soc_prozent=10, min_soc_prozent=10),
|
||||
hours=prediction_hours,
|
||||
)
|
||||
eauto.set_charge_per_hour(np.full(prediction_hours, 1))
|
||||
|
||||
# Parameters based on previous example data
|
||||
pv_prognose_wh = [
|
||||
0,
|
||||
@@ -135,7 +150,8 @@ def create_ems_instance(tmp_config: AppConfig) -> EnergieManagementSystem:
|
||||
0.0002780,
|
||||
]
|
||||
|
||||
einspeiseverguetung_euro_pro_wh = [0.00007] * len(strompreis_euro_pro_wh)
|
||||
einspeiseverguetung_euro_pro_wh = 0.00007
|
||||
preis_euro_pro_wh_akku = 0.0001
|
||||
|
||||
gesamtlast = [
|
||||
676.71,
|
||||
@@ -190,12 +206,15 @@ def create_ems_instance(tmp_config: AppConfig) -> EnergieManagementSystem:
|
||||
|
||||
# Initialize the energy management system with the respective parameters
|
||||
ems = EnergieManagementSystem(
|
||||
config=tmp_config.eos,
|
||||
pv_prognose_wh=pv_prognose_wh,
|
||||
strompreis_euro_pro_wh=strompreis_euro_pro_wh,
|
||||
einspeiseverguetung_euro_pro_wh=einspeiseverguetung_euro_pro_wh,
|
||||
tmp_config.eos,
|
||||
EnergieManagementSystemParameters(
|
||||
pv_prognose_wh=pv_prognose_wh,
|
||||
strompreis_euro_pro_wh=strompreis_euro_pro_wh,
|
||||
einspeiseverguetung_euro_pro_wh=einspeiseverguetung_euro_pro_wh,
|
||||
preis_euro_pro_wh_akku=preis_euro_pro_wh_akku,
|
||||
gesamtlast=gesamtlast,
|
||||
),
|
||||
eauto=eauto,
|
||||
gesamtlast=gesamtlast,
|
||||
haushaltsgeraet=home_appliance,
|
||||
wechselrichter=wechselrichter,
|
||||
)
|
||||
@@ -249,7 +268,7 @@ def test_simulation(create_ems_instance):
|
||||
"akku_soc_pro_stunde",
|
||||
"Einnahmen_Euro_pro_Stunde",
|
||||
"Gesamtbilanz_Euro",
|
||||
"E-Auto_SoC_pro_Stunde",
|
||||
"EAuto_SoC_pro_Stunde",
|
||||
"Gesamteinnahmen_Euro",
|
||||
"Gesamtkosten_Euro",
|
||||
"Verluste_Pro_Stunde",
|
||||
|
@@ -1,10 +1,16 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
from akkudoktoreos.class_akku import PVAkku
|
||||
from akkudoktoreos.class_ems import EnergieManagementSystem
|
||||
from akkudoktoreos.class_haushaltsgeraet import Haushaltsgeraet
|
||||
from akkudoktoreos.class_inverter import Wechselrichter
|
||||
from akkudoktoreos.class_akku import EAutoParameters, PVAkku, PVAkkuParameters
|
||||
from akkudoktoreos.class_ems import (
|
||||
EnergieManagementSystem,
|
||||
EnergieManagementSystemParameters,
|
||||
)
|
||||
from akkudoktoreos.class_haushaltsgeraet import (
|
||||
Haushaltsgeraet,
|
||||
HaushaltsgeraetParameters,
|
||||
)
|
||||
from akkudoktoreos.class_inverter import Wechselrichter, WechselrichterParameters
|
||||
from akkudoktoreos.config import AppConfig
|
||||
|
||||
prediction_hours = 48
|
||||
@@ -17,20 +23,28 @@ start_hour = 0
|
||||
def create_ems_instance(tmp_config: AppConfig) -> EnergieManagementSystem:
|
||||
"""Fixture to create an EnergieManagementSystem instance with given test parameters."""
|
||||
# Initialize the battery and the inverter
|
||||
akku = PVAkku(kapazitaet_wh=5000, start_soc_prozent=80, hours=48, min_soc_prozent=10)
|
||||
akku = PVAkku(
|
||||
PVAkkuParameters(kapazitaet_wh=5000, start_soc_prozent=80, min_soc_prozent=10),
|
||||
hours=prediction_hours,
|
||||
)
|
||||
akku.reset()
|
||||
wechselrichter = Wechselrichter(10000, akku)
|
||||
wechselrichter = Wechselrichter(WechselrichterParameters(max_leistung_wh=10000), akku)
|
||||
|
||||
# Household device (currently not used, set to None)
|
||||
home_appliance = Haushaltsgeraet(
|
||||
HaushaltsgeraetParameters(
|
||||
verbrauch_wh=2000,
|
||||
dauer_h=2,
|
||||
),
|
||||
hours=prediction_hours,
|
||||
verbrauch_wh=2000,
|
||||
dauer_h=2,
|
||||
)
|
||||
home_appliance.set_startzeitpunkt(2)
|
||||
|
||||
# Example initialization of electric car battery
|
||||
eauto = PVAkku(kapazitaet_wh=26400, start_soc_prozent=100, hours=48, min_soc_prozent=100)
|
||||
eauto = PVAkku(
|
||||
EAutoParameters(kapazitaet_wh=26400, start_soc_prozent=100, min_soc_prozent=100),
|
||||
hours=prediction_hours,
|
||||
)
|
||||
|
||||
# Parameters based on previous example data
|
||||
pv_prognose_wh = np.full(prediction_hours, 0)
|
||||
@@ -97,12 +111,15 @@ def create_ems_instance(tmp_config: AppConfig) -> EnergieManagementSystem:
|
||||
|
||||
# Initialize the energy management system with the respective parameters
|
||||
ems = EnergieManagementSystem(
|
||||
config=tmp_config.eos,
|
||||
pv_prognose_wh=pv_prognose_wh,
|
||||
strompreis_euro_pro_wh=strompreis_euro_pro_wh,
|
||||
einspeiseverguetung_euro_pro_wh=einspeiseverguetung_euro_pro_wh,
|
||||
tmp_config.eos,
|
||||
EnergieManagementSystemParameters(
|
||||
pv_prognose_wh=pv_prognose_wh,
|
||||
strompreis_euro_pro_wh=strompreis_euro_pro_wh,
|
||||
einspeiseverguetung_euro_pro_wh=einspeiseverguetung_euro_pro_wh,
|
||||
preis_euro_pro_wh_akku=0,
|
||||
gesamtlast=gesamtlast,
|
||||
),
|
||||
eauto=eauto,
|
||||
gesamtlast=gesamtlast,
|
||||
haushaltsgeraet=home_appliance,
|
||||
wechselrichter=wechselrichter,
|
||||
)
|
||||
@@ -163,7 +180,7 @@ def test_simulation(create_ems_instance):
|
||||
"akku_soc_pro_stunde",
|
||||
"Einnahmen_Euro_pro_Stunde",
|
||||
"Gesamtbilanz_Euro",
|
||||
"E-Auto_SoC_pro_Stunde",
|
||||
"EAuto_SoC_pro_Stunde",
|
||||
"Gesamteinnahmen_Euro",
|
||||
"Gesamtkosten_Euro",
|
||||
"Verluste_Pro_Stunde",
|
||||
|
@@ -5,7 +5,11 @@ from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from akkudoktoreos.class_optimize import optimization_problem
|
||||
from akkudoktoreos.class_optimize import (
|
||||
OptimizationParameters,
|
||||
OptimizeResponse,
|
||||
optimization_problem,
|
||||
)
|
||||
from akkudoktoreos.config import AppConfig
|
||||
|
||||
DIR_TESTDATA = Path(__file__).parent / "testdata"
|
||||
@@ -46,7 +50,7 @@ def test_optimize(
|
||||
# Load input and output data
|
||||
file = DIR_TESTDATA / fn_in
|
||||
with file.open("r") as f_in:
|
||||
input_data = json.load(f_in)
|
||||
input_data = OptimizationParameters(**json.load(f_in))
|
||||
|
||||
file = DIR_TESTDATA / fn_out
|
||||
with file.open("r") as f_out:
|
||||
@@ -59,7 +63,7 @@ def test_optimize(
|
||||
pytest.skip()
|
||||
|
||||
# Call the optimization function
|
||||
ergebnis = opt_class.optimierung_ems(parameter=input_data, start_hour=start_hour, ngen=ngen)
|
||||
ergebnis = opt_class.optimierung_ems(parameters=input_data, start_hour=start_hour, ngen=ngen)
|
||||
# with open(f"new_{fn_out}", "w") as f_out:
|
||||
# from akkudoktoreos.class_numpy_encoder import NumpyEncoder
|
||||
# json_data_str = NumpyEncoder.dumps(ergebnis)
|
||||
@@ -72,3 +76,5 @@ def test_optimize(
|
||||
|
||||
# The function creates a visualization result PDF as a side-effect.
|
||||
visualisiere_ergebnisse_patch.assert_called_once()
|
||||
|
||||
OptimizeResponse(**ergebnis)
|
||||
|
19
tests/test_openapi.py
Normal file
19
tests/test_openapi.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from generate_openapi import generate_openapi
|
||||
|
||||
DIR_PROJECT_ROOT = Path(__file__).parent.parent
|
||||
DIR_TESTDATA = Path(__file__).parent / "testdata"
|
||||
|
||||
|
||||
def test_openapi_spec_current():
|
||||
"""Verify the openapi spec hasn´t changed."""
|
||||
old_spec_path = DIR_PROJECT_ROOT / "docs" / "akkudoktoreos" / "openapi.json"
|
||||
new_spec_path = DIR_TESTDATA / "openapi-new.json"
|
||||
generate_openapi(new_spec_path)
|
||||
with open(new_spec_path) as f_new:
|
||||
new_spec = json.load(f_new)
|
||||
with open(old_spec_path) as f_old:
|
||||
old_spec = json.load(f_old)
|
||||
assert new_spec == old_spec
|
82
tests/testdata/optimize_input_1.json
vendored
82
tests/testdata/optimize_input_1.json
vendored
@@ -1,52 +1,58 @@
|
||||
{
|
||||
"preis_euro_pro_wh_akku": 0.0001,
|
||||
"pv_soc": 80,
|
||||
"pv_akku_cap": 26400,
|
||||
"year_energy": 4100000,
|
||||
"einspeiseverguetung_euro_pro_wh": 0.00007,
|
||||
"max_heizleistung": 1000,
|
||||
"gesamtlast": [
|
||||
676.71, 876.19, 527.13, 468.88, 531.38, 517.95, 483.15, 472.28, 1011.68, 995.00,
|
||||
1053.07, 1063.91, 1320.56, 1132.03, 1163.67, 1176.82, 1216.22, 1103.78, 1129.12,
|
||||
1178.71, 1050.98, 988.56, 912.38, 704.61, 516.37, 868.05, 694.34, 608.79, 556.31,
|
||||
488.89, 506.91, 804.89, 1141.98, 1056.97, 992.46, 1155.99, 827.01, 1257.98, 1232.67,
|
||||
871.26, 860.88, 1158.03, 1222.72, 1221.04, 949.99, 987.01, 733.99, 592.97
|
||||
],
|
||||
"pv_forecast": [
|
||||
0, 0, 0, 0, 0, 0, 0, 8.05, 352.91, 728.51, 930.28, 1043.25, 1106.74, 1161.69,
|
||||
6018.82, 5519.07, 3969.88, 3017.96, 1943.07, 1007.17, 319.67, 7.88, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 5.04, 335.59, 705.32, 1121.12, 1604.79, 2157.38, 1433.25, 5718.49,
|
||||
4553.96, 3027.55, 2574.46, 1720.4, 963.4, 383.3, 0, 0, 0
|
||||
],
|
||||
"ems": {
|
||||
"preis_euro_pro_wh_akku": 0.0001,
|
||||
"einspeiseverguetung_euro_pro_wh": 0.00007,
|
||||
"gesamtlast": [
|
||||
676.71, 876.19, 527.13, 468.88, 531.38, 517.95, 483.15, 472.28, 1011.68, 995.00,
|
||||
1053.07, 1063.91, 1320.56, 1132.03, 1163.67, 1176.82, 1216.22, 1103.78, 1129.12,
|
||||
1178.71, 1050.98, 988.56, 912.38, 704.61, 516.37, 868.05, 694.34, 608.79, 556.31,
|
||||
488.89, 506.91, 804.89, 1141.98, 1056.97, 992.46, 1155.99, 827.01, 1257.98, 1232.67,
|
||||
871.26, 860.88, 1158.03, 1222.72, 1221.04, 949.99, 987.01, 733.99, 592.97
|
||||
],
|
||||
"pv_prognose_wh": [
|
||||
0, 0, 0, 0, 0, 0, 0, 8.05, 352.91, 728.51, 930.28, 1043.25, 1106.74, 1161.69,
|
||||
6018.82, 5519.07, 3969.88, 3017.96, 1943.07, 1007.17, 319.67, 7.88, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 5.04, 335.59, 705.32, 1121.12, 1604.79, 2157.38, 1433.25, 5718.49,
|
||||
4553.96, 3027.55, 2574.46, 1720.4, 963.4, 383.3, 0, 0, 0
|
||||
],
|
||||
"strompreis_euro_pro_wh": [
|
||||
0.0003384, 0.0003318, 0.0003284, 0.0003283, 0.0003289, 0.0003334, 0.0003290,
|
||||
0.0003302, 0.0003042, 0.0002430, 0.0002280, 0.0002212, 0.0002093, 0.0001879,
|
||||
0.0001838, 0.0002004, 0.0002198, 0.0002270, 0.0002997, 0.0003195, 0.0003081,
|
||||
0.0002969, 0.0002921, 0.0002780, 0.0003384, 0.0003318, 0.0003284, 0.0003283,
|
||||
0.0003289, 0.0003334, 0.0003290, 0.0003302, 0.0003042, 0.0002430, 0.0002280,
|
||||
0.0002212, 0.0002093, 0.0001879, 0.0001838, 0.0002004, 0.0002198, 0.0002270,
|
||||
0.0002997, 0.0003195, 0.0003081, 0.0002969, 0.0002921, 0.0002780
|
||||
]
|
||||
},
|
||||
"pv_akku": {
|
||||
"kapazitaet_wh": 26400,
|
||||
"max_ladeleistung_w": 5000,
|
||||
"start_soc_prozent": 80,
|
||||
"min_soc_prozent": 15
|
||||
},
|
||||
"wechselrichter": {
|
||||
"max_leistung_wh": 10000
|
||||
},
|
||||
"eauto": {
|
||||
"kapazitaet_wh": 60000,
|
||||
"lade_effizienz": 0.95,
|
||||
"entlade_effizienz": 1.0,
|
||||
"max_ladeleistung_w": 11040,
|
||||
"start_soc_prozent": 54,
|
||||
"min_soc_prozent": 0
|
||||
},
|
||||
"temperature_forecast": [
|
||||
18.3, 17.8, 16.9, 16.2, 15.6, 15.1, 14.6, 14.2, 14.3, 14.8, 15.7, 16.7, 17.4,
|
||||
18.0, 18.6, 19.2, 19.1, 18.7, 18.5, 17.7, 16.2, 14.6, 13.6, 13.0, 12.6, 12.2,
|
||||
11.7, 11.6, 11.3, 11.0, 10.7, 10.2, 11.4, 14.4, 16.4, 18.3, 19.5, 20.7, 21.9,
|
||||
22.7, 23.1, 23.1, 22.8, 21.8, 20.2, 19.1, 18.0, 17.4
|
||||
],
|
||||
"strompreis_euro_pro_wh": [
|
||||
0.0003384, 0.0003318, 0.0003284, 0.0003283, 0.0003289, 0.0003334, 0.0003290,
|
||||
0.0003302, 0.0003042, 0.0002430, 0.0002280, 0.0002212, 0.0002093, 0.0001879,
|
||||
0.0001838, 0.0002004, 0.0002198, 0.0002270, 0.0002997, 0.0003195, 0.0003081,
|
||||
0.0002969, 0.0002921, 0.0002780, 0.0003384, 0.0003318, 0.0003284, 0.0003283,
|
||||
0.0003289, 0.0003334, 0.0003290, 0.0003302, 0.0003042, 0.0002430, 0.0002280,
|
||||
0.0002212, 0.0002093, 0.0001879, 0.0001838, 0.0002004, 0.0002198, 0.0002270,
|
||||
0.0002997, 0.0003195, 0.0003081, 0.0002969, 0.0002921, 0.0002780
|
||||
],
|
||||
"eauto_min_soc": 0,
|
||||
"eauto_cap": 60000,
|
||||
"eauto_charge_efficiency": 0.95,
|
||||
"eauto_charge_power": 11040,
|
||||
"eauto_soc": 54,
|
||||
"pvpowernow": 211.137503624,
|
||||
"start_solution": [
|
||||
1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
|
||||
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
|
||||
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
||||
],
|
||||
"haushaltsgeraet_wh": 937,
|
||||
"haushaltsgeraet_dauer": 0,
|
||||
"min_soc_prozent": 15
|
||||
]
|
||||
}
|
||||
|
84
tests/testdata/optimize_input_2.json
vendored
84
tests/testdata/optimize_input_2.json
vendored
@@ -1,47 +1,51 @@
|
||||
{
|
||||
"preis_euro_pro_wh_akku": 0.0001,
|
||||
"pv_soc": 80,
|
||||
"pv_akku_cap": 26400,
|
||||
"year_energy": 4100000,
|
||||
"einspeiseverguetung_euro_pro_wh": 0.00007,
|
||||
"max_heizleistung": 1000,
|
||||
"gesamtlast": [
|
||||
676.71, 876.19, 527.13, 468.88, 531.38, 517.95, 483.15, 472.28, 1011.68, 995.00,
|
||||
1053.07, 1063.91, 1320.56, 1132.03, 1163.67, 1176.82, 1216.22, 1103.78, 1129.12,
|
||||
1178.71, 1050.98, 988.56, 912.38, 704.61, 516.37, 868.05, 694.34, 608.79, 556.31,
|
||||
488.89, 506.91, 804.89, 1141.98, 1056.97, 992.46, 1155.99, 827.01, 1257.98, 1232.67,
|
||||
871.26, 860.88, 1158.03, 1222.72, 1221.04, 949.99, 987.01, 733.99, 592.97
|
||||
],
|
||||
"pv_forecast": [
|
||||
0, 0, 0, 0, 0, 0, 0, 8.05, 352.91, 728.51, 930.28, 1043.25, 1106.74, 1161.69,
|
||||
6018.82, 5519.07, 3969.88, 3017.96, 1943.07, 1007.17, 319.67, 7.88, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 5.04, 335.59, 705.32, 1121.12, 1604.79, 2157.38, 1433.25, 5718.49,
|
||||
4553.96, 3027.55, 2574.46, 1720.4, 963.4, 383.3, 0, 0, 0
|
||||
],
|
||||
"ems": {
|
||||
"preis_euro_pro_wh_akku": 0.0001,
|
||||
"einspeiseverguetung_euro_pro_wh": 0.00007,
|
||||
"gesamtlast": [
|
||||
676.71, 876.19, 527.13, 468.88, 531.38, 517.95, 483.15, 472.28, 1011.68, 995.00,
|
||||
1053.07, 1063.91, 1320.56, 1132.03, 1163.67, 1176.82, 1216.22, 1103.78, 1129.12,
|
||||
1178.71, 1050.98, 988.56, 912.38, 704.61, 516.37, 868.05, 694.34, 608.79, 556.31,
|
||||
488.89, 506.91, 804.89, 1141.98, 1056.97, 992.46, 1155.99, 827.01, 1257.98, 1232.67,
|
||||
871.26, 860.88, 1158.03, 1222.72, 1221.04, 949.99, 987.01, 733.99, 592.97
|
||||
],
|
||||
"pv_prognose_wh": [
|
||||
0, 0, 0, 0, 0, 0, 0, 8.05, 352.91, 728.51, 930.28, 1043.25, 1106.74, 1161.69,
|
||||
6018.82, 5519.07, 3969.88, 3017.96, 1943.07, 1007.17, 319.67, 7.88, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 5.04, 335.59, 705.32, 1121.12, 1604.79, 2157.38, 1433.25, 5718.49,
|
||||
4553.96, 3027.55, 2574.46, 1720.4, 963.4, 383.3, 0, 0, 0
|
||||
],
|
||||
"strompreis_euro_pro_wh": [
|
||||
0.0003384, 0.0003318, 0.0003284, 0.0003283, 0.0003289, 0.0003334, 0.0003290,
|
||||
0.0003302, 0.0003042, 0.0002430, 0.0002280, 0.0002212, 0.0002093, 0.0001879,
|
||||
0.0001838, 0.0002004, 0.0002198, 0.0002270, 0.0002997, 0.0003195, 0.0003081,
|
||||
0.0002969, 0.0002921, 0.0002780, 0.0003384, 0.0003318, 0.0003284, 0.0003283,
|
||||
0.0003289, 0.0003334, 0.0003290, 0.0003302, 0.0003042, 0.0002430, 0.0002280,
|
||||
0.0002212, 0.0002093, 0.0001879, 0.0001838, 0.0002004, 0.0002198, 0.0002270,
|
||||
0.0002997, 0.0003195, 0.0003081, 0.0002969, 0.0002921, 0.0002780
|
||||
]
|
||||
},
|
||||
"pv_akku": {
|
||||
"kapazitaet_wh": 26400,
|
||||
"start_soc_prozent": 80,
|
||||
"min_soc_prozent": 15
|
||||
},
|
||||
"eauto": {
|
||||
"kapazitaet_wh": 60000,
|
||||
"lade_effizienz": 0.95,
|
||||
"max_ladeleistung_w": 11040,
|
||||
"start_soc_prozent": 5,
|
||||
"min_soc_prozent": 80
|
||||
},
|
||||
"spuelmaschine" :{
|
||||
"verbrauch_wh": 5000,
|
||||
"dauer_h": 2
|
||||
},
|
||||
"temperature_forecast": [
|
||||
18.3, 17.8, 16.9, 16.2, 15.6, 15.1, 14.6, 14.2, 14.3, 14.8, 15.7, 16.7, 17.4,
|
||||
18.0, 18.6, 19.2, 19.1, 18.7, 18.5, 17.7, 16.2, 14.6, 13.6, 13.0, 12.6, 12.2,
|
||||
11.7, 11.6, 11.3, 11.0, 10.7, 10.2, 11.4, 14.4, 16.4, 18.3, 19.5, 20.7, 21.9,
|
||||
22.7, 23.1, 23.1, 22.8, 21.8, 20.2, 19.1, 18.0, 17.4
|
||||
],
|
||||
"strompreis_euro_pro_wh": [
|
||||
0.0003384, 0.0003318, 0.0003284, 0.0003283, 0.0003289, 0.0003334, 0.0003290,
|
||||
0.0003302, 0.0003042, 0.0002430, 0.0002280, 0.0002212, 0.0002093, 0.0001879,
|
||||
0.0001838, 0.0002004, 0.0002198, 0.0002270, 0.0002997, 0.0003195, 0.0003081,
|
||||
0.0002969, 0.0002921, 0.0002780, 0.0003384, 0.0003318, 0.0003284, 0.0003283,
|
||||
0.0003289, 0.0003334, 0.0003290, 0.0003302, 0.0003042, 0.0002430, 0.0002280,
|
||||
0.0002212, 0.0002093, 0.0001879, 0.0001838, 0.0002004, 0.0002198, 0.0002270,
|
||||
0.0002997, 0.0003195, 0.0003081, 0.0002969, 0.0002921, 0.0002780
|
||||
],
|
||||
"eauto_min_soc": 80,
|
||||
"eauto_cap": 60000,
|
||||
"eauto_charge_efficiency": 0.95,
|
||||
"eauto_charge_power": 11040,
|
||||
"eauto_soc": 5,
|
||||
"pvpowernow": 211.137503624,
|
||||
"start_solution": null,
|
||||
"haushaltsgeraet_wh": 5000,
|
||||
"haushaltsgeraet_dauer": 2,
|
||||
"min_soc_prozent": 15
|
||||
}
|
||||
|
||||
"start_solution": null
|
||||
}
|
370
tests/testdata/optimize_result_1.json
vendored
370
tests/testdata/optimize_result_1.json
vendored
@@ -392,7 +392,7 @@
|
||||
0.0
|
||||
],
|
||||
"Gesamtbilanz_Euro": 1.3505190567851246,
|
||||
"E-Auto_SoC_pro_Stunde": [
|
||||
"EAuto_SoC_pro_Stunde": [
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
@@ -727,371 +727,5 @@
|
||||
1,
|
||||
1
|
||||
],
|
||||
"spuelstart": null,
|
||||
"simulation_data": {
|
||||
"Last_Wh_pro_Stunde": [
|
||||
1053.07,
|
||||
1063.91,
|
||||
1320.56,
|
||||
1132.03,
|
||||
1163.67,
|
||||
1176.82,
|
||||
1216.22,
|
||||
1103.78,
|
||||
1129.12,
|
||||
1178.71,
|
||||
1050.98,
|
||||
988.56,
|
||||
912.38,
|
||||
704.61,
|
||||
516.37,
|
||||
868.05,
|
||||
694.34,
|
||||
608.79,
|
||||
556.31,
|
||||
488.89,
|
||||
506.91,
|
||||
804.89,
|
||||
1141.98,
|
||||
1056.97,
|
||||
992.46,
|
||||
1155.99,
|
||||
827.01,
|
||||
1257.98,
|
||||
1232.67,
|
||||
871.26,
|
||||
860.88,
|
||||
1158.03,
|
||||
1222.72,
|
||||
1221.04,
|
||||
949.99,
|
||||
987.01,
|
||||
733.99,
|
||||
592.97
|
||||
],
|
||||
"Netzeinspeisung_Wh_pro_Stunde": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
2792.3879958677676,
|
||||
2753.66,
|
||||
1914.18,
|
||||
813.95,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
2738.2769214876007,
|
||||
3682.7,
|
||||
2166.67,
|
||||
1416.43,
|
||||
497.68000000000006,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"Netzbezug_Wh_pro_Stunde": [
|
||||
0.0,
|
||||
20.660000000000082,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
171.54000000000008,
|
||||
0.0,
|
||||
980.68,
|
||||
0.0,
|
||||
704.61,
|
||||
0.0,
|
||||
868.05,
|
||||
694.34,
|
||||
608.79,
|
||||
556.31,
|
||||
488.89,
|
||||
506.91,
|
||||
799.85,
|
||||
0.0,
|
||||
351.65,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
257.64,
|
||||
0.0,
|
||||
987.01,
|
||||
0.0,
|
||||
592.97
|
||||
],
|
||||
"Kosten_Euro_pro_Stunde": [
|
||||
0.0,
|
||||
0.004569992000000018,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.05480703000000003,
|
||||
0.0,
|
||||
0.291163892,
|
||||
0.0,
|
||||
0.19588158,
|
||||
0.0,
|
||||
0.28801899,
|
||||
0.22802125600000003,
|
||||
0.199865757,
|
||||
0.182970359,
|
||||
0.162995926,
|
||||
0.16677339,
|
||||
0.26411047,
|
||||
0.0,
|
||||
0.08545095,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.08231598,
|
||||
0.0,
|
||||
0.293043269,
|
||||
0.0,
|
||||
0.16484566
|
||||
],
|
||||
"akku_soc_pro_stunde": [
|
||||
79.4714617768595,
|
||||
79.4714617768595,
|
||||
78.55109331955923,
|
||||
78.6499599862259,
|
||||
94.83379331955922,
|
||||
100.0,
|
||||
100.0,
|
||||
100.0,
|
||||
100.0,
|
||||
100.0,
|
||||
96.85214359504131,
|
||||
96.85214359504131,
|
||||
92.92488808539943,
|
||||
92.92488808539943,
|
||||
90.70222107438015,
|
||||
90.70222107438015,
|
||||
90.70222107438015,
|
||||
90.70222107438015,
|
||||
90.70222107438015,
|
||||
90.70222107438015,
|
||||
90.70222107438015,
|
||||
90.70222107438015,
|
||||
87.231189738292,
|
||||
87.231189738292,
|
||||
87.66005640495867,
|
||||
89.15605640495866,
|
||||
93.59062307162533,
|
||||
94.17485640495867,
|
||||
100.0,
|
||||
100.0,
|
||||
100.0,
|
||||
100.0,
|
||||
100.0,
|
||||
100.0,
|
||||
97.56073519283747,
|
||||
97.56073519283747,
|
||||
94.40134297520663,
|
||||
94.40134297520663
|
||||
],
|
||||
"Einnahmen_Euro_pro_Stunde": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.19546715971074372,
|
||||
0.19275619999999996,
|
||||
0.1339926,
|
||||
0.0569765,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.19167938450413202,
|
||||
0.257789,
|
||||
0.1516669,
|
||||
0.09915009999999999,
|
||||
0.0348376,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"Gesamtbilanz_Euro": 1.3505190567851246,
|
||||
"E-Auto_SoC_pro_Stunde": [
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0,
|
||||
54.0
|
||||
],
|
||||
"Gesamteinnahmen_Euro": 1.3143154442148755,
|
||||
"Gesamtkosten_Euro": 2.664834501,
|
||||
"Verluste_Pro_Stunde": [
|
||||
16.744090909090914,
|
||||
0.0,
|
||||
29.157272727272726,
|
||||
3.5592000000000112,
|
||||
582.6179999999995,
|
||||
185.98344049586785,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
99.72409090909093,
|
||||
0.0,
|
||||
124.41545454545451,
|
||||
0.0,
|
||||
70.41409090909087,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
109.96227272727276,
|
||||
0.0,
|
||||
15.439199999999985,
|
||||
53.855999999999995,
|
||||
159.6443999999999,
|
||||
21.032399999999996,
|
||||
209.70516942148788,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
77.27590909090907,
|
||||
0.0,
|
||||
100.08954545454549,
|
||||
0.0
|
||||
],
|
||||
"Gesamt_Verluste": 1859.6205371900821,
|
||||
"Haushaltsgeraet_wh_pro_stunde": [
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
"spuelstart": null
|
||||
}
|
37
tests/testdata/optimize_result_2.json
vendored
37
tests/testdata/optimize_result_2.json
vendored
@@ -31,7 +31,7 @@
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0569765, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.009006199999999989, 0.03141599999999999, 0.0931259, 0.012268899999999998, 0.31400739999999994, 0.257789, 0.1516669, 0.09915009999999999, 0.0348376, 0.0, 0.0, 0.0, 0.0, 0.0
|
||||
],
|
||||
"Gesamtbilanz_Euro": 13.525878719636365,
|
||||
"E-Auto_SoC_pro_Stunde": [
|
||||
"EAuto_SoC_pro_Stunde": [
|
||||
13.74, 20.294999999999998, 37.775, 53.06999999999999, 70.55, 81.475, 90.215, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0
|
||||
],
|
||||
"Gesamteinnahmen_Euro": 1.0602444999999998,
|
||||
@@ -62,38 +62,5 @@
|
||||
"start_solution": [
|
||||
0, 0, 4, 3, 1, 3, 1, 5, 6, 4, 1, 3, 6, 4, 6, 0, 6, 6, 0, 0, 3, 4, 1, 3, 2, 4, 4, 2, 3, 2, 1, 0, 2, 4, 1, 0, 6, 6, 2, 0, 4, 3, 3, 2, 6, 4, 1, 1, 0, 1, 5, 1, 2, 4, 6, 6, 5, 0, 2, 1, 6, 5, 6, 3, 2, 6, 6, 1, 1, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13
|
||||
],
|
||||
"spuelstart": 13,
|
||||
"simulation_data": {
|
||||
"Last_Wh_pro_Stunde": [
|
||||
6297.07, 6756.91, 16208.56, 15449.029999999999, 16313.488181818184, 7731.82, 6460.22, 6974.78, 1129.12, 1178.71, 1050.98, 988.56, 912.38, 1741.405454545456, 516.37, 868.05, 694.34, 608.79, 556.31, 488.89, 506.91, 804.89, 1718.014090909092, 1056.97, 992.46, 1155.99, 827.01, 1257.98, 1232.67, 871.26, 860.88, 1158.03, 1222.72, 1221.04, 949.99, 987.01, 733.99, 592.97
|
||||
],
|
||||
"Netzeinspeisung_Wh_pro_Stunde": [
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 813.95, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 128.65999999999985, 448.79999999999995, 1330.3700000000001, 175.26999999999998, 4485.82, 3682.7, 2166.67, 1416.43, 497.68000000000006, 0.0, 0.0, 0.0, 0.0, 0.0
|
||||
],
|
||||
"Netzbezug_Wh_pro_Stunde": [
|
||||
366.78999999999996, 5713.66, 15101.82, 14287.339999999998, 10294.668181818184, 2212.75, 2490.34, 3956.8199999999997, 0.0, 171.54000000000008, 731.31, 980.68, 0.0, 1741.405454545456, 516.37, 868.05, 694.34, 608.79, 556.31, 488.89, 0.0, 799.85, 1382.424090909092, 351.65, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 257.64, 566.69, 987.01, 0.0, 0.0
|
||||
],
|
||||
"Kosten_Euro_pro_Stunde": [
|
||||
0.08362812, 1.263861592, 3.160810926, 2.6845911859999996, 1.8921600118181823, 0.44343509999999997, 0.547376732, 0.8981981399999999, 0.0, 0.05480703000000003, 0.225316611, 0.291163892, 0.0, 0.48411071636363673, 0.174739608, 0.28801899, 0.22802125600000003, 0.199865757, 0.182970359, 0.162995926, 0.0, 0.26411047, 0.42053340845454584, 0.08545095, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.08231598, 0.174597189, 0.293043269, 0.0, 0.0
|
||||
],
|
||||
"akku_soc_pro_stunde": [
|
||||
58.47796143250689, 65.14462809917354, 81.81129476584022, 91.81129476584022, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 96.07274449035812, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 97.8180526859504, 97.8180526859504, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 96.84060778236915, 94.28822314049587
|
||||
],
|
||||
"Einnahmen_Euro_pro_Stunde": [
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0569765, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.009006199999999989, 0.03141599999999999, 0.0931259, 0.012268899999999998, 0.31400739999999994, 0.257789, 0.1516669, 0.09915009999999999, 0.0348376, 0.0, 0.0, 0.0, 0.0, 0.0
|
||||
],
|
||||
"Gesamtbilanz_Euro": 13.525878719636365,
|
||||
"E-Auto_SoC_pro_Stunde": [
|
||||
13.74, 20.294999999999998, 37.775, 53.06999999999999, 70.55, 81.475, 90.215, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0
|
||||
],
|
||||
"Gesamteinnahmen_Euro": 1.0602444999999998,
|
||||
"Gesamtkosten_Euro": 14.586123219636365,
|
||||
"Verluste_Pro_Stunde": [
|
||||
957.818181818182, 447.0, 1152.0, 843.0, 846.7933884297522, 345.0, 276.0, 309.0, 0.0, 0.0, 0.0, 0.0, 124.41545454545451, 141.38119834710756, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 69.12409090909085, 0.0, 78.55010330578523, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100.08954545454549, 80.85954545454547
|
||||
],
|
||||
"Gesamt_Verluste": 5771.031508264463,
|
||||
"Haushaltsgeraet_wh_pro_stunde": [
|
||||
0.0, 0.0, 0.0, 2500.0, 2500.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
|
||||
]
|
||||
}
|
||||
"spuelstart": 13
|
||||
}
|
37
tests/testdata/optimize_result_2_full.json
vendored
37
tests/testdata/optimize_result_2_full.json
vendored
@@ -31,7 +31,7 @@
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.013086500000000003, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.257789, 0.1516669, 0.09915009999999999, 0.0348376, 0.0, 0.0, 0.0, 0.0, 0.0
|
||||
],
|
||||
"Gesamtbilanz_Euro": 11.315688587156364,
|
||||
"E-Auto_SoC_pro_Stunde": [
|
||||
"EAuto_SoC_pro_Stunde": [
|
||||
13.74, 13.74, 31.22, 48.699999999999996, 66.18, 81.475, 90.215, 98.955, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0
|
||||
],
|
||||
"Gesamteinnahmen_Euro": 0.5565300999999999,
|
||||
@@ -62,38 +62,5 @@
|
||||
"start_solution": [
|
||||
3, 2, 6, 3, 5, 4, 1, 5, 4, 6, 1, 1, 2, 6, 6, 6, 6, 6, 1, 2, 2, 6, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 6, 2, 2, 2, 6, 1, 1, 1, 1, 1, 0, 5, 3, 1, 1, 2, 0, 1, 0, 6, 2, 0, 6, 6, 6, 5, 2, 2, 3, 6, 1, 5, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13
|
||||
],
|
||||
"spuelstart": 13,
|
||||
"simulation_data": {
|
||||
"Last_Wh_pro_Stunde": [
|
||||
6297.07, 1063.91, 12688.56, 18520.03, 18551.67, 11659.115454545456, 6460.22, 6347.78, 1756.12, 1178.71, 1050.98, 988.56, 912.38, 704.61, 516.37, 868.05, 694.34, 608.79, 556.31, 488.89, 506.91, 804.89, 1141.98, 1056.97, 992.46, 1155.99, 827.01, 1257.98, 2494.6908545454626, 871.26, 860.88, 1158.03, 1222.72, 1221.04, 949.99, 987.01, 733.99, 592.97
|
||||
],
|
||||
"Netzeinspeisung_Wh_pro_Stunde": [
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 186.95000000000005, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3682.7, 2166.67, 1416.43, 497.68000000000006, 0.0, 0.0, 0.0, 0.0, 0.0
|
||||
],
|
||||
"Netzbezug_Wh_pro_Stunde": [
|
||||
366.78999999999996, 0.0, 11581.82, 17358.339999999997, 12532.85, 6140.045454545456, 2490.34, 3329.8199999999997, 0.0, 171.54000000000008, 731.31, 980.68, 912.38, 704.61, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1262.0208545454625, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
|
||||
],
|
||||
"Kosten_Euro_pro_Stunde": [
|
||||
0.08362812, 0.0, 2.424074926, 3.261632085999999, 2.30353783, 1.2304651090909093, 0.547376732, 0.7558691399999999, 0.0, 0.05480703000000003, 0.225316611, 0.291163892, 0.26650619799999997, 0.19588158, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.231959433065456, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
|
||||
],
|
||||
"akku_soc_pro_stunde": [
|
||||
58.47796143250689, 58.38903236914601, 61.722365702479344, 78.38903236914601, 95.05569903581267, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 97.77733298898072, 94.04089187327823, 91.05216942148759, 88.43168904958677, 86.03710399449034, 83.93272210743798, 81.75077479338839, 78.30789428374652, 74.83686294765836, 73.32321797520657, 73.75208464187324, 75.24808464187323, 79.6826513085399, 80.26688464187325, 100.0, 100.0, 100.0, 100.0, 100.0, 98.89101239669421, 96.45174758953168, 92.20325413223141, 89.04386191460057, 86.4914772727273
|
||||
],
|
||||
"Einnahmen_Euro_pro_Stunde": [
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.013086500000000003, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.257789, 0.1516669, 0.09915009999999999, 0.0348376, 0.0, 0.0, 0.0, 0.0, 0.0
|
||||
],
|
||||
"Gesamtbilanz_Euro": 11.315688587156364,
|
||||
"E-Auto_SoC_pro_Stunde": [
|
||||
13.74, 13.74, 31.22, 48.699999999999996, 66.18, 81.475, 90.215, 98.955, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0
|
||||
],
|
||||
"Gesamteinnahmen_Euro": 0.5565300999999999,
|
||||
"Gesamtkosten_Euro": 11.872218687156364,
|
||||
"Verluste_Pro_Stunde": [
|
||||
957.818181818182, 2.817272727272737, 672.0, 1152.0, 1152.0, 660.994834710744, 276.0, 276.0, 33.0, 0.0, 0.0, 0.0, 0.0, 0.0, 70.41409090909087, 118.37045454545455, 94.68272727272722, 83.01681818181817, 75.86045454545456, 66.66681818181814, 69.12409090909085, 109.0704545454546, 109.96227272727276, 47.952272727272714, 15.439199999999985, 53.855999999999995, 159.6443999999999, 21.032399999999996, 710.3921528925632, 0.0, 0.0, 0.0, 0.0, 35.132727272727266, 77.27590909090907, 134.59227272727276, 100.08954545454549, 80.85954545454547
|
||||
],
|
||||
"Gesamt_Verluste": 7416.064896694217,
|
||||
"Haushaltsgeraet_wh_pro_stunde": [
|
||||
0.0, 0.0, 0.0, 2500.0, 2500.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
|
||||
]
|
||||
}
|
||||
"spuelstart": 13
|
||||
}
|
2
tests/testdata/visualize_input_1.json
vendored
2
tests/testdata/visualize_input_1.json
vendored
@@ -72,7 +72,7 @@
|
||||
0.0, 0.0, 0.0, 0.0, 0.0
|
||||
],
|
||||
"Gesamtbilanz_Euro": 27.732796636363638,
|
||||
"E-Auto_SoC_pro_Stunde": [
|
||||
"EAuto_SoC_pro_Stunde": [
|
||||
30.294999999999998, 43.405, 60.885, 78.365, 93.66, 93.66, 100.0, 100.0,
|
||||
100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
|
||||
100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
|
||||
|
Reference in New Issue
Block a user