Files
EOS/tests/testdata/optimize_result_2.json
T
Andreas 1c10ab83ad feat(optimization): concave terminal value for the energy left in the battery
The energy still stored when the horizon ends keeps its worth: it replaces
grid imports that are paid for afterwards. Crediting that with a single
price per kWh cannot describe it, because the value is not linear in the
amount stored. The first kWh replaces the most expensive hour that PV
cannot cover, the next one the second most expensive, and once every such
hour is served, further energy replaces nothing.

A scalar has to pick one slope for all of it. High enough for the first kWh
means hoarding a full battery; low enough for the last kWh means running it
empty by the end of the horizon - which is exactly what the previous default
of 0 EUR/kWh did.

terminal_value_mode = AUTO (the new default) builds the curve instead. There
is no forecast beyond the horizon, so its trailing window stands in for the
day that follows: residual load max(load - PV, 0) per slot, priced at its
import price, sorted and accumulated. LCOS is subtracted from every marginal
value so stored energy is not credited twice, and the tail beyond the
residual load is only credited when direct marketing allows an export. The
curve is built once per run; the search only interpolates on it.

The solution reports what a run used as terminal_value, curve included, so
the shape can be inspected instead of guessed. FIXED restores the previous
scalar behaviour.

In a 48 h scenario with two cheap slots at the end, AUTO keeps the battery
at 50 % and credits 3.85 EUR where FIXED with 0 EUR/kWh drains it to empty.
The stored optimization results move accordingly - the objective changed.
2026-09-04 10:37:48 +02:00

969 lines
18 KiB
JSON

{
"ac_charge": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"dc_charge": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.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.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.0,
1.0,
1.0
],
"discharge_allowed": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
0,
0,
0,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
0,
0
],
"battery_grid_export_allowed": [],
"terminal_value": {
"mode": "AUTO",
"battery_energy_wh": 10043.348787942483,
"credited_euro": 2.9274511210000003,
"curve": {
"energy_wh": [
0.0,
516.37,
1005.26,
1873.31,
2673.16,
3180.0699999999997,
3736.3799999999997,
4430.719999999999,
5039.509999999999,
5297.15,
5863.84,
6670.2300000000005,
7657.240000000001,
8391.230000000001,
8984.2,
9335.85
],
"value_euro": [
0.0,
0.174739608,
0.337735534,
0.625754524,
0.889864994,
1.056638384,
1.239608743,
1.4676299990000001,
1.667495756,
1.749811736,
1.924408925,
2.169712763,
2.462756032,
2.6771545110000003,
2.8420001710000005,
2.9274511210000003
],
"marginal_euro_per_kwh": [
0.3384,
0.33340000000000003,
0.3318,
0.3302,
0.32899999999999996,
0.3289,
0.3284,
0.32830000000000004,
0.3195,
0.3081,
0.3042,
0.2969,
0.2921,
0.27799999999999997,
0.243
],
"window_slots": 24
}
},
"battery_grid_export_factor": [],
"eautocharge_hours_float": [
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.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.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.375,
0.875,
0.625,
0.5,
0.375,
0.875,
0.1,
0.0,
0.0
],
"result": {
"Last_Wh_pro_Stunde": [
1053.07,
10723.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,
11607.01,
3757.98,
1232.67,
5011.26,
10520.88,
8058.03,
6742.72,
5361.04,
10609.99,
2091.01,
733.99,
592.97
],
"EAuto_SoC_pro_Stunde": [
5.0,
5.0,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
20.294999999999998,
33.405,
33.405,
33.405,
39.96,
55.254999999999995,
66.18,
74.92,
81.475,
96.77,
98.518,
98.518
],
"Einnahmen_Euro_pro_Stunde": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.29947942211993916,
0.19320652266312205,
0.1358062627100041,
0.0692592282596561,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"Gesamt_Verluste": 7016.419901387913,
"Gesamtbilanz_Euro": 11.897504510077836,
"Gesamteinnahmen_Euro": 0.6977514357527215,
"Gesamtkosten_Euro": 12.595255945830557,
"Home_appliance_wh_per_hour": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
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
],
"home_appliance_energy_wh": {
"dishwasher1": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
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
]
},
"Kosten_Euro_pro_Stunde": [
0.10013413727316416,
2.141361992,
0.11436917344552285,
0.07557452231671152,
0.0,
4.55656845588237e-17,
0.001414013162203277,
0.005881449073870462,
0.05258762370598476,
0.0,
0.0,
0.0,
0.26650619799999997,
0.19588158,
0.174739608,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.1306329312971816,
0.07362195915902499,
0.060401289430882174,
1.9781208038728355,
0.4410873661898387,
4.179128154646605e-17,
0.19837609024735353,
1.6519184206056259,
1.2504841688205104,
1.5077152912298486,
0.0,
1.7952031890000002,
0.0,
0.214398479,
0.16484566
],
"Netzbezug_Wh_pro_Stunde": [
439.1848126015972,
9680.66,
546.436566868241,
402.20607938643707,
0.0,
2.2737367544323206e-13,
6.433180901743754,
25.909467285772962,
175.4675465665157,
0.0,
0.0,
0.0,
912.38,
704.61,
516.37,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
537.58407941227,
322.9033296448464,
273.0618871197205,
9451.12663102167,
2347.45804252176,
2.2737367544323206e-13,
989.9006499368938,
7515.552414038334,
5508.740831808416,
5030.748385818647,
0.0,
5826.6900000000005,
0.0,
733.99,
592.97
],
"Netzeinspeisung_Wh_pro_Stunde": [
0.0,
0.0,
0.0,
0.0,
0.0,
4278.277458856274,
2760.093180901744,
1940.089467285773,
989.4175465665157,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"Verluste_Pro_Stunde": [
37.96737751219166,
483.0,
39.91398802418894,
51.82392952637247,
582.6179999999995,
7.676704937247038,
0.0,
0.0,
0.0,
108.98319763338179,
106.80230977350088,
133.7321802766326,
0.0,
0.0,
0.0,
118.37045454545455,
94.68272727272722,
83.01681818181817,
75.86045454545456,
66.66681818181814,
69.12409090909085,
109.07302361034766,
116.99491129525349,
22.312089529472388,
54.18759955738153,
86.6234264543665,
414.1795957226005,
2.727365102611202,
538.2984000000001,
270.9120779924272,
485.6666896846002,
348.0204998170099,
277.01140629823766,
806.8360377309995,
1083.0,
340.3377272727273,
0.0,
0.0
],
"akku_soc_pro_stunde": [
80.0,
81.05464937533866,
81.05464937533866,
82.16337126489945,
83.60292486285425,
99.78675819618759,
100.0,
100.0,
100.0,
100.0,
98.93741213017658,
95.76274429012544,
91.54148603150185,
91.54148603150185,
91.54148603150185,
91.54148603150185,
87.80504491579936,
84.81632246400872,
82.1958420921079,
79.80125703701147,
77.69687514995913,
75.51492783590953,
72.07203759496124,
68.5743674764186,
69.19414774112617,
70.69935883994233,
73.1055651303414,
73.11055390041365,
73.18631404215284,
88.13904737548619,
89.91438287527582,
89.98845758873692,
90.07236036143165,
90.10045498082714,
71.17062150457336,
52.23122756517942,
43.23066799217666,
43.23066799217666
],
"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
],
"Feed_in_tariff": [
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05,
7e-05
]
},
"eauto_obj": {
"device_id": "ev1",
"hours": 48,
"charge_array": [
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.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.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.375,
0.875,
0.625,
0.5,
0.375,
0.875,
0.1,
0.0,
0.0
],
"discharge_array": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"discharging_efficiency": 1.0,
"capacity_wh": 60000,
"charging_efficiency": 0.95,
"max_charge_power_w": 11040,
"soc_wh": 59110.8,
"initial_soc_percentage": 5
},
"start_solution": [
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.0,
1.0,
1.0,
1.0,
0.0,
0.0,
0.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
1.0,
1.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,
5.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
4.0,
0.0,
0.0,
1.0,
5.0,
3.0,
2.0,
1.0,
5.0,
2.0,
3.0,
4.0,
26.0
],
"washingstart": 36,
"appliance_starts": {
"dishwasher1": [
"2025-01-16 12:00:00+01:00"
]
},
"appliance_deadline_missed": {}
}