diff --git a/docs/akkudoktoreos/openapi.json b/docs/akkudoktoreos/openapi.json index 29299bb..0925c8d 100644 --- a/docs/akkudoktoreos/openapi.json +++ b/docs/akkudoktoreos/openapi.json @@ -307,9 +307,7 @@ } }, "type": "object", - "required": [ - "kapazitaet_wh" - ], + "required": ["kapazitaet_wh"], "title": "EAutoParameters" }, "EAutoResult": { @@ -455,10 +453,7 @@ } }, "type": "object", - "required": [ - "temperature", - "pvpower" - ], + "required": ["temperature", "pvpower"], "title": "ForecastResponse" }, "GesamtlastRequest": { @@ -480,11 +475,7 @@ } }, "type": "object", - "required": [ - "year_energy", - "measured_data", - "hours" - ], + "required": ["year_energy", "measured_data", "hours"], "title": "GesamtlastRequest" }, "HTTPValidationError": { @@ -516,10 +507,7 @@ } }, "type": "object", - "required": [ - "consumption_wh", - "duration_h" - ], + "required": ["consumption_wh", "duration_h"], "title": "HomeApplianceParameters" }, "OptimizationParameters": { @@ -588,11 +576,7 @@ } }, "type": "object", - "required": [ - "ems", - "pv_akku", - "eauto" - ], + "required": ["ems", "pv_akku", "eauto"], "title": "OptimizationParameters" }, "OptimizeResponse": { @@ -751,9 +735,7 @@ } }, "type": "object", - "required": [ - "kapazitaet_wh" - ], + "required": ["kapazitaet_wh"], "title": "PVAkkuParameters" }, "SimulationResult": { @@ -912,6 +894,21 @@ "type": "array", "title": "Akku Soc Pro Stunde", "description": "The state of charge of the battery (not the EV) in percentage per hour." + }, + "Electricity_price": { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array", + "title": "Electricity Price", + "description": "Used Electricity Price, including predictions" } }, "type": "object", @@ -928,7 +925,8 @@ "Netzbezug_Wh_pro_Stunde", "Netzeinspeisung_Wh_pro_Stunde", "Verluste_Pro_Stunde", - "akku_soc_pro_stunde" + "akku_soc_pro_stunde", + "Electricity_price" ], "title": "SimulationResult", "description": "This object contains the results of the simulation and provides insights into various parameters over the entire forecast period." @@ -959,11 +957,7 @@ } }, "type": "object", - "required": [ - "loc", - "msg", - "type" - ], + "required": ["loc", "msg", "type"], "title": "ValidationError" }, "WechselrichterParameters": { @@ -980,4 +974,4 @@ } } } -} \ No newline at end of file +} diff --git a/tests/test_class_ems.py b/tests/test_class_ems.py index fc28d3c..52867b1 100644 --- a/tests/test_class_ems.py +++ b/tests/test_class_ems.py @@ -312,21 +312,21 @@ def test_simulation(create_ems_instance): # Verify the total balance assert ( - abs(result["Gesamtbilanz_Euro"] - 1.7880374129090917) < 1e-5 - ), "Total balance should be 1.7880374129090917." + abs(result["Gesamtbilanz_Euro"] - 1.958185274567674) < 1e-5 + ), "Total balance should be 1.958185274567674." # Check total revenue and total costs assert ( - abs(result["Gesamteinnahmen_Euro"] - 1.3169784090909087) < 1e-5 - ), "Total revenue should be 1.3169784090909087." + abs(result["Gesamteinnahmen_Euro"] - 1.168863124510214) < 1e-5 + ), "Total revenue should be 1.168863124510214." assert ( - abs(result["Gesamtkosten_Euro"] - 3.1050158220000004) < 1e-5 - ), "Total costs should be 3.1050158220000004 ." + abs(result["Gesamtkosten_Euro"] - 3.127048399077888) < 1e-5 + ), "Total costs should be 3.127048399077888 ." # Check the losses assert ( - abs(result["Gesamt_Verluste"] - 2615.222727272727) < 1e-5 - ), "Total losses should be 2615.222727272727 ." + abs(result["Gesamt_Verluste"] - 2871.5330639359036) < 1e-5 + ), "Total losses should be 2871.5330639359036 ." # Check the values in 'akku_soc_pro_stunde' assert ( diff --git a/tests/testdata/optimize_result_1.json b/tests/testdata/optimize_result_1.json index fc823d0..6241fb2 100644 --- a/tests/testdata/optimize_result_1.json +++ b/tests/testdata/optimize_result_1.json @@ -1,52 +1,52 @@ { "ac_charge": [ - 0.75, - 0.75, - 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.75, - 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.875, 0.0, + 0.875, + 0.0, + 0.625, + 0.75, + 0.0, + 0.375, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, + 1.0, + 0.0, + 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.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.375, + 0.0, + 0.0, + 0.625, + 0.0, + 0.0, + 0.375, + 0.75, + 1.0, + 0.0, 0.0 ], "dc_charge": [ @@ -102,35 +102,6 @@ "discharge_allowed": [ 0, 0, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 0, 0, 1, 0, @@ -138,8 +109,6 @@ 0, 0, 0, - 1, - 0, 0, 0, 1, @@ -147,7 +116,38 @@ 0, 1, 1, - 1 + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0 ], "eautocharge_hours_float": null, "result": { @@ -179,7 +179,7 @@ 992.46, 1155.99, 827.01, - 1257.98, + 3132.98, 1232.67, 871.26, 860.88, @@ -237,10 +237,10 @@ 0.0, 0.0, 0.0, - 0.212927386983471, - 0.19275619999999996, - 0.1339926, - 0.0569765, + 0.22334747537370364, + 0.19016535126346096, + 0.12880892587597292, + 0.04260510586128589, 0.0, 0.0, 0.0, @@ -260,21 +260,21 @@ 0.0, 0.0, 0.0, - 0.1512260012396691, - 0.257789, - 0.1516669, - 0.09915009999999999, - 0.0348376, + 0.059176154400016855, + 0.25751345302450973, + 0.14923279815365575, + 0.07926913850394514, + 0.024174420063375994, 0.0, 0.0, 0.0, 0.0, 0.0 ], - "Gesamt_Verluste": 2071.900103305785, - "Gesamtbilanz_Euro": 0.9349588927768602, - "Gesamteinnahmen_Euro": 1.2913222882231399, - "Gesamtkosten_Euro": 2.226281181, + "Gesamt_Verluste": 2500.030611233429, + "Gesamtbilanz_Euro": 1.4988843060949502, + "Gesamteinnahmen_Euro": 1.1542928225199272, + "Gesamtkosten_Euro": 2.6531771286148773, "Home_appliance_wh_per_hour": [ null, null, @@ -316,84 +316,84 @@ null ], "Kosten_Euro_pro_Stunde": [ - 0.0, + 0.027996119999999992, 0.0, 0.04475252599999999, + 0.0018232052307313393, 0.0, 0.0, - 0.0, - 0.0, - 0.0, - 0.0, + 0.008135265032732555, + 0.016809914659344942, + 0.061530097476751734, 0.05480703000000003, - 0.225316611, - 0.291163892, - 0.26650619799999997, + 0.0, + 0.0, + 0.0, 0.19588158, 0.174739608, 0.0, - 0.0, - 0.199865757, + 0.22802125600000003, 0.0, 0.0, + 0.162995926, 0.16677339, 0.26411047, 0.0, 0.08545095, 0.0, + 0.028255713342252034, + 0.0, + 0.3629952558325975, 0.0, 0.0, + 0.0076430797975209205, 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, + 0.04565364324294593, 0.08231598, 0.174597189, + 0.293043269, 0.0, - 0.0, - 0.0 + 0.16484566 ], "Netzbezug_Wh_pro_Stunde": [ - 0.0, + 122.78999999999996, 0.0, 213.81999999999994, + 9.703061366318996, 0.0, 0.0, - 0.0, - 0.0, - 0.0, - 0.0, + 37.01212480770043, + 74.05248748610107, + 205.30563055305882, 171.54000000000008, - 731.31, - 980.68, - 912.38, + 0.0, + 0.0, + 0.0, 704.61, 516.37, 0.0, - 0.0, - 608.79, + 694.34, 0.0, 0.0, + 488.89, 506.91, 799.85, 0.0, 351.65, 0.0, + 127.73830624887898, + 0.0, + 1931.853410498124, 0.0, 0.0, + 34.77288351920346, 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, + 152.3311419517715, 257.64, 566.69, + 987.01, 0.0, - 0.0, - 0.0 + 592.97 ], "Netzeinspeisung_Wh_pro_Stunde": [ 0.0, @@ -401,10 +401,10 @@ 0.0, 0.0, 0.0, - 3041.819814049586, - 2753.66, - 1914.18, - 813.95, + 3190.678219624338, + 2716.6478751922996, + 1840.127512513899, + 608.6443694469413, 0.0, 0.0, 0.0, @@ -424,11 +424,11 @@ 0.0, 0.0, 0.0, - 2160.371446280987, - 3682.7, - 2166.67, - 1416.43, - 497.68000000000006, + 845.3736342859552, + 3678.7636146358536, + 2131.8971164807967, + 1132.4162643420734, + 345.3488580482285, 0.0, 0.0, 0.0, @@ -436,51 +436,74 @@ 0.0 ], "Verluste_Pro_Stunde": [ - 16.744090909090914, + 0.0, 2.817272727272737, 0.0, - 3.5592000000000112, - 582.6179999999995, - 156.0516223140496, - 0.0, - 0.0, - 0.0, + 2.3948326360417305, + 582.6180000000041, + 138.18861364508305, 0.0, 0.0, 0.0, 0.0, + 99.72409090909093, + 133.72909090909081, + 124.41545454545451, 0.0, 0.0, 118.37045454545455, - 94.68272727272722, 0.0, + 83.01681818181817, 75.86045454545456, - 66.66681818181814, + 0.0, 0.0, 0.0, 109.96227272727276, 0.0, - 15.439199999999985, - 53.855999999999995, - 159.6443999999999, - 21.032399999999996, - 279.0538264462814, + 16.01263877609336, + 38.52740325013451, + 161.62968357967037, + 239.20999074022512, + 436.85356388568886, + 0.5004782113116364, + 0.0, + 36.109951963721926, 0.0, 0.0, 0.0, 0.0, - 0.0, - 0.0, - 134.59227272727276, 100.08954545454549, - 80.85954545454547 + 0.0 ], "akku_soc_pro_stunde": [ - 79.4714617768595, - 79.38253271349862, - 79.38253271349862, - 79.48139938016529, - 95.66523271349861, + 80.0, + 79.91107093663912, + 79.91107093663912, + 79.97759406541806, + 96.1614273987495, + 100.0, + 100.0, + 100.0, + 100.0, + 100.0, + 96.85214359504131, + 92.63089703856748, + 88.7036415289256, + 88.7036415289256, + 88.7036415289256, + 84.96720041322313, + 84.96720041322313, + 82.34672004132229, + 79.95213498622587, + 79.95213498622587, + 79.95213498622587, + 79.95213498622587, + 76.48110365013771, + 76.48110365013771, + 76.64231728537023, + 77.71252293120729, + 81.22045681594867, + 87.86517878095492, 100.0, 100.0, 100.0, @@ -489,31 +512,48 @@ 100.0, 100.0, 100.0, - 100.0, - 100.0, - 96.26355888429752, - 93.27483643250687, - 93.27483643250687, - 90.88025137741046, - 88.7758694903581, - 88.7758694903581, - 88.7758694903581, - 85.30483815426996, - 85.30483815426996, - 85.73370482093662, - 87.22970482093662, - 91.66427148760329, - 92.24850482093663, - 100.0, - 100.0, - 100.0, - 100.0, - 100.0, - 100.0, - 100.0, - 95.75150654269973, - 92.59211432506888, - 90.0397296831956 + 96.84060778236915, + 96.84060778236915 + ], + "Electricity_price": [ + 0.000228, + 0.0002212, + 0.0002093, + 0.0001879, + 0.0001838, + 0.0002004, + 0.0002198, + 0.000227, + 0.0002997, + 0.0003195, + 0.0003081, + 0.0002969, + 0.0002921, + 0.000278, + 0.0003384, + 0.0003318, + 0.0003284, + 0.0003283, + 0.0003289, + 0.0003334, + 0.000329, + 0.0003302, + 0.0003042, + 0.000243, + 0.000228, + 0.0002212, + 0.0002093, + 0.0001879, + 0.0001838, + 0.0002004, + 0.0002198, + 0.000227, + 0.0002997, + 0.0003195, + 0.0003081, + 0.0002969, + 0.0002921, + 0.000278 ] }, "eauto_obj": { @@ -626,54 +666,54 @@ "start_soc_prozent": 54 }, "start_solution": [ - 18.0, - 18.0, - 9.0, - 13.0, - 4.0, - 7.0, - 9.0, - 8.0, - 0.0, - 12.0, - 10.0, - 10.0, - 14.0, - 8.0, - 7.0, - 11.0, - 6.0, - 4.0, - 18.0, - 3.0, - 4.0, - 3.0, - 5.0, - 14.0, - 14.0, - 10.0, - 13.0, - 3.0, - 7.0, - 11.0, - 6.0, - 14.0, - 9.0, - 14.0, - 8.0, - 3.0, - 2.0, - 5.0, - 9.0, - 19.0, 1.0, - 6.0, + 5.0, + 19.0, 10.0, - 4.0, - 2.0, + 19.0, 7.0, + 17.0, + 18.0, + 3.0, + 15.0, + 4.0, + 10.0, + 2.0, + 3.0, 11.0, - 10.0 + 10.0, + 5.0, + 20.0, + 2.0, + 20.0, + 11.0, + 13.0, + 11.0, + 0.0, + 1.0, + 8.0, + 4.0, + 11.0, + 8.0, + 3.0, + 0.0, + 1.0, + 12.0, + 14.0, + 13.0, + 0.0, + 13.0, + 15.0, + 12.0, + 11.0, + 17.0, + 12.0, + 3.0, + 15.0, + 18.0, + 20.0, + 7.0, + 5.0 ], "washingstart": null } \ No newline at end of file diff --git a/tests/testdata/optimize_result_2.json b/tests/testdata/optimize_result_2.json index 4c3b3a8..1e4999c 100644 --- a/tests/testdata/optimize_result_2.json +++ b/tests/testdata/optimize_result_2.json @@ -1,47 +1,47 @@ { "ac_charge": [ + 0.5, + 0.0, + 0.0, + 0.0, + 0.0, + 0.75, + 0.0, + 0.5, + 0.0, + 1.0, + 0.0, + 0.0, + 0.75, + 0.75, + 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.75, + 0.0, + 0.0, 0.0, 0.0, 0.0, - 0.625, 0.0, 0.0, 0.0, 0.0, 0.625, 0.0, - 0.375, - 0.0, - 0.0, - 0.75, - 0.0, - 0.75, - 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.75, 0.0, 0.0, 0.0, @@ -101,17 +101,15 @@ ], "discharge_allowed": [ 0, - 0, + 1, 1, 0, 0, - 1, - 1, - 1, 0, - 1, 0, - 1, + 0, + 0, + 0, 1, 0, 0, @@ -124,15 +122,14 @@ 1, 1, 1, + 1, + 1, 0, 1, 1, 0, 0, 0, - 1, - 1, - 1, 0, 0, 0, @@ -141,76 +138,79 @@ 0, 0, 1, + 1, + 0, 0, 1, 0, 0, 0, - 1, + 0, + 0, 0 ], "eautocharge_hours_float": [ - 0.0, - 0.5, - 0.0, - 0.5, - 0.375, - 1.0, - 0.875, - 0.375, - 0.5, - 1.0, - 0.875, - 0.875, - 0.875, - 0.75, - 0.5, - 0.625, - 0.875, - 0.75, - 0.5, - 0.0, - 0.625, - 0.5, - 0.0, - 1.0, - 0.625, - 0.0, - 1.0, - 0.625, - 0.875, - 0.375, - 1.0, - 0.375, - 0.625, - 0.75, - 0.75, - 0.0, - 0.5, - 0.875, 0.875, 0.75, 0.875, 0.5, + 0.375, + 0.75, + 0.875, + 0.625, + 0.375, + 0.5, + 0.375, + 0.0, + 0.875, + 0.5, + 0.75, + 0.625, 0.875, 0.0, - 0.375, - 0.875, - 1.0, - 0.5 + 0.5, + 0.625, + 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 ], "result": { "Last_Wh_pro_Stunde": [ - 12105.07, - 10240.91, - 10497.56, - 12748.03, - 8907.67, - 13981.82, + 4986.07, + 1063.91, + 14247.56, + 12626.029999999999, + 11529.67, + 7731.82, 10393.22, - 1730.78, - 1129.12, - 1178.71, + 1103.78, + 6373.12, + 7733.71, 1050.98, 988.56, 912.38, @@ -221,7 +221,7 @@ 608.79, 556.31, 488.89, - 506.91, + 4256.91, 804.89, 1141.98, 1056.97, @@ -231,8 +231,8 @@ 1257.98, 1232.67, 871.26, - 860.88, - 4027.009545454555, + 3985.88, + 1158.03, 1222.72, 1221.04, 949.99, @@ -241,44 +241,44 @@ 592.97 ], "EAuto_SoC_pro_Stunde": [ - 20.294999999999998, + 11.555, + 11.555, + 26.85, 35.589999999999996, - 50.885000000000005, - 63.995000000000005, - 72.735, + 48.699999999999996, + 59.62499999999999, + 74.92, + 74.92, 83.66, - 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, - 100.0 + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585 ], "Einnahmen_Euro_pro_Stunde": [ 0.0, @@ -313,24 +313,24 @@ 0.0, 0.0, 0.0, - 0.0348376, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], - "Gesamt_Verluste": 8823.859090909093, - "Gesamtbilanz_Euro": 12.348447740818184, - "Gesamteinnahmen_Euro": 0.0348376, - "Gesamtkosten_Euro": 12.383285340818183, + "Gesamt_Verluste": 9258.73062020124, + "Gesamtbilanz_Euro": 12.332782378812306, + "Gesamteinnahmen_Euro": 0.0, + "Gesamtkosten_Euro": 12.332782378812306, "Home_appliance_wh_per_hour": [ 0.0, 0.0, 0.0, + 2500.0, + 2500.0, 0.0, - 2500.0, - 2500.0, 0.0, 0.0, 0.0, @@ -365,16 +365,16 @@ 0.0 ], "Kosten_Euro_pro_Stunde": [ - 2.54785212, - 0.928522392, - 0.9189986259999999, - 2.1770732859999997, - 0.53097063, - 1.6959351, + 0.0, + 0.004569992000000018, + 2.750373626, + 2.1541494859999997, + 1.0128942300000001, + 0.0, 1.4118501319999999, 0.0, 0.0, - 0.0, + 0.55162953, 0.0, 0.0, 0.0, @@ -385,36 +385,36 @@ 0.199865757, 0.182970359, 0.162995926, - 0.0, - 0.0, - 0.0, + 1.4005233899999998, + 0.26411047, + 0.24530383800000005, 0.08545095, + 0.007989913613567745, + 0.028255713342252034, + 0.025392879919306634, 0.0, 0.0, + 0.0003442778967139274, + 0.6945180797975209, 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.651258356818184, - 0.0, + 0.04565364324294593, 0.08231598, 0.174597189, 0.293043269, - 0.0, + 0.214398479, 0.16484566 ], "Netzbezug_Wh_pro_Stunde": [ - 11174.789999999999, - 4197.66, - 4390.82, - 11586.34, - 2888.8500000000004, - 8462.75, + 0.0, + 20.660000000000082, + 13140.82, + 11464.339999999998, + 5510.85, + 0.0, 6423.339999999999, 0.0, 0.0, - 0.0, + 1726.54, 0.0, 0.0, 0.0, @@ -425,23 +425,23 @@ 608.79, 556.31, 488.89, - 0.0, - 0.0, - 0.0, + 4256.91, + 799.85, + 806.3900000000001, 351.65, + 35.04348076126204, + 127.73830624887898, + 121.32288542430308, 0.0, 0.0, + 1.7179535764168035, + 3159.7728835192033, 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 2868.979545454555, - 0.0, + 152.3311419517715, 257.64, 566.69, 987.01, - 0.0, + 733.99, 592.97 ], "Netzeinspeisung_Wh_pro_Stunde": [ @@ -477,7 +477,7 @@ 0.0, 0.0, 0.0, - 497.68000000000006, + 0.0, 0.0, 0.0, 0.0, @@ -485,16 +485,16 @@ 0.0 ], "Verluste_Pro_Stunde": [ - 708.0, - 1164.818181818182, - 1164.818181818182, - 864.0, - 276.0, - 795.0, + 760.062272727273, + 0.0, + 933.0, + 726.0, + 414.0, + 646.7386363636365, 483.0, - 187.4616000000001, - 97.67399999999998, - 23.391818181818195, + 230.91336797704525, + 880.0977272727268, + 1026.818181818182, 99.72409090909093, 133.72909090909081, 124.41545454545451, @@ -505,64 +505,104 @@ 0.0, 0.0, 0.0, - 69.12409090909085, - 109.0704545454546, - 109.96227272727276, + 450.0, 0.0, - 15.439199999999985, - 53.855999999999995, - 159.6443999999999, - 21.032399999999996, - 538.2984000000001, - 441.924, - 260.0003999999999, - 514.2491454545468, + 0.0, + 0.0, + 11.233982308648535, + 38.52740325013451, + 145.08565374908358, + 21.962728535423857, + 538.2984000000038, + 441.7178455708299, + 630.8276539776955, + 171.99990368477063, + 41.441862965787436, 0.0, 0.0, 0.0, 0.0, - 100.08954545454549, 0.0 ], "akku_soc_pro_stunde": [ - 86.25, - 64.72796143250687, - 43.20592286501377, - 55.70592286501377, - 55.70592286501377, - 68.20592286501376, - 68.20592286501376, - 72.49652286501377, - 75.20968953168044, - 74.47131143250688, - 71.32345502754819, - 67.10220847107436, - 63.17495296143248, - 60.14202424242422, - 60.14202424242422, - 56.40558312672175, - 53.41686067493111, - 53.41686067493111, - 53.41686067493111, - 53.41686067493111, - 51.23491336088152, - 47.792032851239654, - 44.3210015151515, - 44.3210015151515, - 44.749868181818165, - 46.24586818181816, - 50.68043484848482, - 51.264668181818166, - 66.21740151515148, - 78.49306818181815, - 85.71530151515148, - 100.0, - 100.0, - 100.0, - 100.0, - 100.0, - 96.84060778236915, - 96.84060778236915 + 62.54222623966943, + 62.54222623966943, + 75.04222623966943, + 87.54222623966943, + 87.54222623966943, + 78.01764807162535, + 78.01764807162535, + 83.83265434833275, + 64.76391295714818, + 43.24187438965506, + 40.094017984696386, + 35.87277142822256, + 31.945515918580686, + 28.912587199572425, + 28.912587199572425, + 25.176146083869945, + 22.187423632079316, + 22.187423632079316, + 22.187423632079316, + 22.187423632079316, + 34.68742363207931, + 34.68742363207931, + 34.68742363207931, + 34.68742363207931, + 34.99947869620843, + 36.0696843420455, + 40.099841390631155, + 40.249843096950585, + 55.20257643028218, + 67.47251658502745, + 84.99550697329678, + 88.77022785443704, + 89.9213907145978, + 89.9213907145978, + 89.9213907145978, + 89.9213907145978, + 89.9213907145978, + 89.9213907145978 + ], + "Electricity_price": [ + 0.000228, + 0.0002212, + 0.0002093, + 0.0001879, + 0.0001838, + 0.0002004, + 0.0002198, + 0.000227, + 0.0002997, + 0.0003195, + 0.0003081, + 0.0002969, + 0.0002921, + 0.000278, + 0.0003384, + 0.0003318, + 0.0003284, + 0.0003283, + 0.0003289, + 0.0003334, + 0.000329, + 0.0003302, + 0.0003042, + 0.000243, + 0.000228, + 0.0002212, + 0.0002093, + 0.0001879, + 0.0001838, + 0.0002004, + 0.0002198, + 0.000227, + 0.0002997, + 0.0003195, + 0.0003081, + 0.0002969, + 0.0002921, + 0.000278 ] }, "eauto_obj": { @@ -671,107 +711,107 @@ "kapazitaet_wh": 60000, "lade_effizienz": 0.95, "max_ladeleistung_w": 11040, - "soc_wh": 60000.0, + "soc_wh": 56751.0, "start_soc_prozent": 5 }, "start_solution": [ - 0.0, - 4.0, + 16.0, 13.0, - 17.0, - 14.0, - 12.0, - 9.0, - 9.0, - 17.0, - 13.0, - 15.0, - 12.0, - 9.0, - 18.0, - 14.0, - 18.0, - 14.0, - 9.0, - 2.0, - 8.0, - 10.0, - 12.0, - 10.0, - 10.0, - 14.0, - 8.0, - 7.0, - 2.0, - 6.0, - 4.0, - 7.0, - 10.0, - 8.0, - 2.0, - 5.0, - 0.0, - 2.0, - 4.0, - 5.0, - 14.0, - 10.0, - 18.0, 11.0, + 14.0, + 2.0, + 18.0, + 3.0, + 16.0, + 4.0, + 20.0, + 12.0, + 2.0, + 18.0, + 18.0, 1.0, - 0.0, - 5.0, 13.0, - 1.0, - 0.0, - 2.0, - 0.0, - 2.0, - 1.0, - 6.0, - 5.0, - 1.0, - 2.0, - 6.0, - 5.0, - 5.0, - 5.0, 4.0, + 7.0, + 9.0, + 8.0, + 10.0, + 12.0, + 10.0, + 10.0, + 14.0, + 8.0, + 7.0, + 2.0, + 6.0, + 4.0, + 18.0, + 3.0, + 4.0, + 3.0, + 5.0, + 14.0, + 14.0, + 10.0, + 13.0, + 3.0, + 17.0, + 11.0, + 6.0, + 14.0, + 14.0, + 14.0, 2.0, 3.0, 5.0, 4.0, - 2.0, - 0.0, - 3.0, - 2.0, - 0.0, - 6.0, - 3.0, - 0.0, - 6.0, - 3.0, 5.0, + 2.0, 1.0, - 6.0, - 1.0, - 3.0, - 4.0, - 4.0, - 0.0, - 2.0, - 5.0, - 5.0, 4.0, 5.0, + 3.0, + 1.0, 2.0, + 1.0, + 0.0, + 5.0, + 2.0, + 4.0, + 3.0, 5.0, 0.0, - 1.0, - 5.0, - 6.0, 2.0, - 14.0 + 3.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, + 13.0 ], - "washingstart": 14 + "washingstart": 13 } \ No newline at end of file diff --git a/tests/testdata/optimize_result_2_full.json b/tests/testdata/optimize_result_2_full.json index ad0bef1..1e4999c 100644 --- a/tests/testdata/optimize_result_2_full.json +++ b/tests/testdata/optimize_result_2_full.json @@ -1,21 +1,19 @@ { "ac_charge": [ + 0.5, 0.0, 0.0, - 0.875, + 0.0, + 0.0, + 0.75, + 0.0, + 0.5, 0.0, 1.0, 0.0, 0.0, - 0.0, - 0.0, - 0.875, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, + 0.75, + 0.75, 0.0, 0.0, 0.0, @@ -32,6 +30,7 @@ 0.0, 0.0, 0.0, + 0.75, 0.0, 0.0, 0.0, @@ -41,6 +40,7 @@ 0.0, 0.0, 0.0, + 0.625, 0.0, 0.0, 0.0, @@ -100,16 +100,16 @@ 1.0 ], "discharge_allowed": [ - 1, - 0, - 0, - 1, - 0, - 0, 0, 1, 1, 0, + 0, + 0, + 0, + 0, + 0, + 0, 1, 0, 0, @@ -124,56 +124,56 @@ 1, 1, 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, 0, 1, 1, 0, - 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, 0, 1, 1, + 0, + 0, 1, - 1, - 1, - 1 + 0, + 0, + 0, + 0, + 0, + 0 ], "eautocharge_hours_float": [ - 0.75, - 0.75, - 0.5, - 0.0, - 1.0, - 0.625, - 0.0, 0.875, 0.75, - 1.0, - 0.0, - 0.75, - 1.0, - 1.0, - 1.0, + 0.875, + 0.5, 0.375, 0.75, - 0.5, - 0.5, - 1.0, - 0.625, 0.875, 0.625, - 1.0, + 0.375, + 0.5, + 0.375, + 0.0, + 0.875, + 0.5, + 0.75, + 0.625, + 0.875, + 0.0, + 0.5, + 0.625, + 0.0, + 0.0, + 0.0, + 0.0, 0.0, 0.0, 0.0, @@ -201,16 +201,16 @@ ], "result": { "Last_Wh_pro_Stunde": [ - 1053.07, - 8929.91, - 11808.56, - 11620.03, - 14151.67, - 7609.82, - 9082.22, - 6347.78, - 1756.12, - 1178.71, + 4986.07, + 1063.91, + 14247.56, + 12626.029999999999, + 11529.67, + 7731.82, + 10393.22, + 1103.78, + 6373.12, + 7733.71, 1050.98, 988.56, 912.38, @@ -221,7 +221,7 @@ 608.79, 556.31, 488.89, - 506.91, + 4256.91, 804.89, 1141.98, 1056.97, @@ -231,7 +231,7 @@ 1257.98, 1232.67, 871.26, - 860.88, + 3985.88, 1158.03, 1222.72, 1221.04, @@ -241,44 +241,44 @@ 592.97 ], "EAuto_SoC_pro_Stunde": [ - 5.0, - 18.11, + 11.555, + 11.555, + 26.85, 35.589999999999996, - 53.06999999999999, - 70.55, - 77.105, - 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 + 48.699999999999996, + 59.62499999999999, + 74.92, + 74.92, + 83.66, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585, + 94.585 ], "Einnahmen_Euro_pro_Stunde": [ 0.0, @@ -320,17 +320,17 @@ 0.0, 0.0 ], - "Gesamt_Verluste": 7248.648818181819, - "Gesamtbilanz_Euro": 8.568052366, + "Gesamt_Verluste": 9258.73062020124, + "Gesamtbilanz_Euro": 12.332782378812306, "Gesamteinnahmen_Euro": 0.0, - "Gesamtkosten_Euro": 8.568052366, + "Gesamtkosten_Euro": 12.332782378812306, "Home_appliance_wh_per_hour": [ 0.0, 0.0, 0.0, + 2500.0, + 2500.0, 0.0, - 2500.0, - 2500.0, 0.0, 0.0, 0.0, @@ -366,83 +366,83 @@ ], "Kosten_Euro_pro_Stunde": [ 0.0, - 1.7445291920000001, - 2.2398909259999997, - 1.9651220859999998, - 1.4948178300000001, + 0.004569992000000018, + 2.750373626, + 2.1541494859999997, + 1.0128942300000001, 0.0, - 1.1236923319999998, + 1.4118501319999999, + 0.0, + 0.0, + 0.55162953, 0.0, 0.0, 0.0, 0.0, + 0.174739608, 0.0, 0.0, + 0.199865757, + 0.182970359, + 0.162995926, + 1.4005233899999998, + 0.26411047, + 0.24530383800000005, + 0.08545095, + 0.007989913613567745, + 0.028255713342252034, + 0.025392879919306634, 0.0, 0.0, + 0.0003442778967139274, + 0.6945180797975209, 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.04565364324294593, + 0.08231598, + 0.174597189, + 0.293043269, + 0.214398479, + 0.16484566 ], "Netzbezug_Wh_pro_Stunde": [ 0.0, - 7886.66, - 10701.82, - 10458.34, - 8132.85, + 20.660000000000082, + 13140.82, + 11464.339999999998, + 5510.85, 0.0, - 5112.339999999999, + 6423.339999999999, + 0.0, + 0.0, + 1726.54, 0.0, 0.0, 0.0, 0.0, + 516.37, 0.0, 0.0, + 608.79, + 556.31, + 488.89, + 4256.91, + 799.85, + 806.3900000000001, + 351.65, + 35.04348076126204, + 127.73830624887898, + 121.32288542430308, 0.0, 0.0, + 1.7179535764168035, + 3159.7728835192033, 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 + 152.3311419517715, + 257.64, + 566.69, + 987.01, + 733.99, + 592.97 ], "Netzeinspeisung_Wh_pro_Stunde": [ 0.0, @@ -485,84 +485,124 @@ 0.0 ], "Verluste_Pro_Stunde": [ - 16.744090909090914, + 760.062272727273, + 0.0, + 933.0, + 726.0, 414.0, - 552.0, - 552.0, - 552.0, - 492.1022727272725, - 414.0, - 730.0663636363638, - 55.434, - 23.391818181818195, + 646.7386363636365, + 483.0, + 230.91336797704525, + 880.0977272727268, + 1026.818181818182, 99.72409090909093, 133.72909090909081, 124.41545454545451, 96.08318181818186, - 70.41409090909087, + 0.0, 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, - 538.2984000000001, - 441.924, - 260.0003999999999, - 169.97160000000008, - 59.721600000000024, - 35.132727272727266, - 77.27590909090907, - 134.59227272727276, - 100.08954545454549, - 80.85954545454547 + 0.0, + 0.0, + 0.0, + 450.0, + 0.0, + 0.0, + 0.0, + 11.233982308648535, + 38.52740325013451, + 145.08565374908358, + 21.962728535423857, + 538.2984000000038, + 441.7178455708299, + 630.8276539776955, + 171.99990368477063, + 41.441862965787436, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 ], "akku_soc_pro_stunde": [ - 79.4714617768595, - 79.4714617768595, - 79.4714617768595, - 79.4714617768595, - 79.4714617768595, - 70.47202134986226, - 70.47202134986226, - 56.13911845730028, - 56.76228512396694, - 56.02390702479339, - 52.876050619834714, - 48.654804063360885, - 44.72754855371902, - 41.69461983471075, - 39.47195282369147, - 35.73551170798899, - 32.746789256198355, - 30.126308884297526, - 27.731723829201112, - 25.627341942148767, - 23.445394628099184, - 20.002514118457306, - 16.531482782369153, - 15.017837809917364, - 15.446704476584031, - 16.94270447658403, - 21.377271143250695, - 21.961504476584032, - 36.91423780991737, - 49.189904476584026, - 56.41213780991736, - 61.133571143250684, - 62.79250447658402, - 61.68351687327823, - 59.2442520661157, - 54.99575860881543, - 51.836366391184576, - 49.28398174931129 + 62.54222623966943, + 62.54222623966943, + 75.04222623966943, + 87.54222623966943, + 87.54222623966943, + 78.01764807162535, + 78.01764807162535, + 83.83265434833275, + 64.76391295714818, + 43.24187438965506, + 40.094017984696386, + 35.87277142822256, + 31.945515918580686, + 28.912587199572425, + 28.912587199572425, + 25.176146083869945, + 22.187423632079316, + 22.187423632079316, + 22.187423632079316, + 22.187423632079316, + 34.68742363207931, + 34.68742363207931, + 34.68742363207931, + 34.68742363207931, + 34.99947869620843, + 36.0696843420455, + 40.099841390631155, + 40.249843096950585, + 55.20257643028218, + 67.47251658502745, + 84.99550697329678, + 88.77022785443704, + 89.9213907145978, + 89.9213907145978, + 89.9213907145978, + 89.9213907145978, + 89.9213907145978, + 89.9213907145978 + ], + "Electricity_price": [ + 0.000228, + 0.0002212, + 0.0002093, + 0.0001879, + 0.0001838, + 0.0002004, + 0.0002198, + 0.000227, + 0.0002997, + 0.0003195, + 0.0003081, + 0.0002969, + 0.0002921, + 0.000278, + 0.0003384, + 0.0003318, + 0.0003284, + 0.0003283, + 0.0003289, + 0.0003334, + 0.000329, + 0.0003302, + 0.0003042, + 0.000243, + 0.000228, + 0.0002212, + 0.0002093, + 0.0001879, + 0.0001838, + 0.0002004, + 0.0002198, + 0.000227, + 0.0002997, + 0.0003195, + 0.0003081, + 0.0002969, + 0.0002921, + 0.000278 ] }, "eauto_obj": { @@ -671,82 +711,78 @@ "kapazitaet_wh": 60000, "lade_effizienz": 0.95, "max_ladeleistung_w": 11040, - "soc_wh": 60000.0, + "soc_wh": 56751.0, "start_soc_prozent": 5 }, "start_solution": [ - 12.0, + 16.0, + 13.0, + 11.0, + 14.0, + 2.0, + 18.0, + 3.0, + 16.0, 4.0, - 19.0, - 9.0, 20.0, - 14.0, - 6.0, - 9.0, - 8.0, - 19.0, - 7.0, - 2.0, + 12.0, 2.0, + 18.0, + 18.0, 1.0, - 3.0, - 8.0, - 14.0, - 11.0, - 10.0, + 13.0, + 4.0, + 7.0, 9.0, + 8.0, 10.0, 12.0, - 11.0, - 13.0, - 11.0, - 8.0, 10.0, 10.0, - 9.0, - 11.0, - 13.0, - 7.0, - 8.0, - 7.0, - 1.0, - 7.0, - 2.0, - 11.0, - 11.0, 14.0, - 11.0, - 5.0, - 10.0, - 9.0, - 13.0, - 10.0, - 9.0, 8.0, - 4.0, - 4.0, + 7.0, 2.0, - 0.0, 6.0, + 4.0, + 18.0, + 3.0, + 4.0, + 3.0, + 5.0, + 14.0, + 14.0, + 10.0, + 13.0, + 3.0, + 17.0, + 11.0, + 6.0, + 14.0, + 14.0, + 14.0, + 2.0, 3.0, - 0.0, 5.0, 4.0, - 6.0, - 0.0, - 4.0, - 6.0, - 6.0, - 6.0, + 5.0, + 2.0, 1.0, 4.0, - 2.0, - 2.0, - 6.0, - 3.0, 5.0, 3.0, - 6.0, + 1.0, + 2.0, + 1.0, + 0.0, + 5.0, + 2.0, + 4.0, + 3.0, + 5.0, + 0.0, + 2.0, + 3.0, 0.0, 0.0, 0.0, @@ -771,7 +807,11 @@ 0.0, 0.0, 0.0, - 14.0 + 0.0, + 0.0, + 0.0, + 0.0, + 13.0 ], - "washingstart": 14 + "washingstart": 13 } \ No newline at end of file