Files
Thesis/Result-Reports/Policies.md

204 lines
20 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Policies for battery charging
## Battery
Capacity: 2MWh \
Charging Power: 1MW \
Discharging Power: 1MW
## Baseline policy
Determining 2 thresholds for battery charging and discharging. Charging when the imbalance price is below the lower threshold and discharging when the imbalance price is above the upper threshold.
Training data: 01-01-2020 - 31-12-2022
Test data: 01-01-2023 - 12-12-2023
| | Charge threshold | Discharge threshold | Charging Cost | Discharging Profit | Total Profit | Charge cycles | Mean charging price | Mean discharging price |
|---:|-------------------:|----------------------:|----------------:|---------------------:|---------------:|----------------:|----------------------:|-------------------------:|
| 0 | 150 | 175 | 165982 | 989322 | 823340 | 1701.62 | 32.4889 | 348.51 |
| 0 | 175 | 200 | 190060 | 1.00145e+06 | 811389 | 1594 | 37.0705 | 367.44 |
| 0 | 125 | 150 | 132766 | 939145 | 806378 | 1729.88 | 27.7746 | 333.447 |
| 0 | 200 | 225 | 219726 | 1.01789e+06 | 798159 | 1493.12 | 42.9038 | 390.49 |
| 0 | 150 | 200 | 151145 | 937599 | 786454 | 1514.88 | 32.4889 | 367.44 |
| 0 | 125 | 175 | 122067 | 904885 | 782818 | 1584.62 | 27.7746 | 348.51 |
| 0 | 175 | 225 | 173050 | 950270 | 777219 | 1415 | 37.0705 | 390.49 |
| 0 | 100 | 125 | 69876.4 | 829454 | 759577 | 1662.88 | 19.9739 | 315.1 |
| 0 | 150 | 225 | 136563 | 886279 | 749716 | 1339.12 | 32.4889 | 390.49 |
| 0 | 125 | 200 | 109873 | 853728 | 743855 | 1402.5 | 27.7746 | 367.44 |
| 0 | 100 | 150 | 63807.1 | 802437 | 738630 | 1502.5 | 19.9739 | 333.447 |
| 0 | 100 | 175 | 56405.8 | 770173 | 713768 | 1366.75 | 19.9739 | 348.51 |
| 0 | 75 | 100 | 14153.7 | 724660 | 710506 | 1684.5 | 11.3023 | 284.61 |
| 0 | 125 | 225 | 97524.1 | 804468 | 706944 | 1231.88 | 27.7746 | 390.49 |
| 0 | 25 | 50 | -56542.1 | 637628 | 694171 | 2696.12 | -16.9846 | 204.943 |
| 0 | 75 | 125 | 8003.32 | 688780 | 680776 | 1407.38 | 11.3023 | 315.1 |
| 0 | 100 | 200 | 49469.3 | 721380 | 671911 | 1196.12 | 19.9739 | 367.44 |
| 0 | 50 | 75 | -47575.2 | 614964 | 662539 | 1752 | -9.65396 | 254.211 |
| 0 | 75 | 150 | 5147.22 | 661439 | 656292 | 1254.62 | 11.3023 | 333.447 |
| 0 | 50 | 100 | -46110.5 | 592694 | 638805 | 1417.5 | -9.65396 | 284.61 |
| 0 | 100 | 225 | 42046.6 | 677560 | 635514 | 1042.88 | 19.9739 | 390.49 |
| 0 | 75 | 175 | 850.49 | 631552 | 630702 | 1129 | 11.3023 | 348.51 |
| 0 | 25 | 75 | -63342.8 | 561356 | 624699 | 1637 | -16.9846 | 254.211 |
| 0 | 50 | 125 | -46686.3 | 556263 | 602950 | 1150.5 | -9.65396 | 315.1 |
| 0 | 25 | 100 | -61448.6 | 537683 | 599132 | 1306.5 | -16.9846 | 284.61 |
| 0 | 75 | 200 | -1767.94 | 590094 | 591862 | 981.5 | 11.3023 | 367.44 |
| 0 | 50 | 150 | -45858.6 | 531472 | 577330 | 1007.5 | -9.65396 | 333.447 |
| 0 | 25 | 125 | -61228.7 | 500861 | 562089 | 1045.62 | -16.9846 | 315.1 |
| 0 | 75 | 225 | -3475.71 | 555727 | 559203 | 855.875 | 11.3023 | 390.49 |
| 0 | 50 | 175 | -46084.1 | 506348 | 552432 | 900.875 | -9.65396 | 348.51 |
| 0 | 25 | 150 | -60177.2 | 476823 | 537000 | 906.75 | -16.9846 | 333.447 |
| 0 | 50 | 200 | -43738 | 473478 | 517216 | 779.25 | -9.65396 | 367.44 |
| 0 | 25 | 175 | -59466.7 | 453988 | 513455 | 808.25 | -16.9846 | 348.51 |
| 0 | 50 | 225 | -40529.8 | 452651 | 493181 | 693.875 | -9.65396 | 390.49 |
| 0 | 25 | 200 | -55766.8 | 426055 | 481822 | 699.875 | -16.9846 | 367.44 |
| 0 | 25 | 225 | -51953 | 407484 | 459437 | 623.875 | -16.9846 | 390.49 |
| 0 | 0 | 75 | -107853 | 332344 | 440197 | 851.375 | -73.2011 | 254.211 |
| 0 | 0 | 100 | -97804.3 | 341072 | 438876 | 761.5 | -73.2011 | 284.61 |
| 0 | 0 | 50 | -121468 | 314671 | 436139 | 993.625 | -73.2011 | 204.943 |
| 0 | 0 | 125 | -91087.2 | 342646 | 433734 | 686.125 | -73.2011 | 315.1 |
| 0 | 0 | 25 | -126590 | 305984 | 432574 | 1041.75 | -73.2011 | 193.87 |
| 0 | 0 | 150 | -85919 | 341046 | 426964 | 635.75 | -73.2011 | 333.447 |
| 0 | 0 | 175 | -82378.2 | 338310 | 420688 | 600.625 | -73.2011 | 348.51 |
| 0 | 0 | 200 | -75822.2 | 328188 | 404010 | 541.25 | -73.2011 | 367.44 |
| 0 | 0 | 225 | -69488.7 | 320776 | 390265 | 494.75 | -73.2011 | 390.49 |
| 0 | -25 | 125 | -102495 | 269615 | 372110 | 534.062 | -105.73 | 315.1 |
| 0 | -25 | 100 | -108934 | 262527 | 371462 | 574.938 | -105.73 | 284.61 |
| 0 | -25 | 75 | -118553 | 252453 | 371006 | 626.062 | -105.73 | 254.211 |
| 0 | -25 | 150 | -97080 | 271209 | 368289 | 503.438 | -105.73 | 333.447 |
| 0 | -25 | 50 | -129918 | 236112 | 366030 | 683.562 | -105.73 | 204.943 |
| 0 | -25 | 175 | -92889.5 | 272520 | 365409 | 480.438 | -105.73 | 348.51 |
| 0 | -25 | 25 | -132518 | 227910 | 360428 | 695.562 | -105.73 | 193.87 |
| 0 | -25 | 200 | -85482.7 | 268638 | 354120 | 438.5 | -105.73 | 367.44 |
| 0 | -25 | 225 | -79253.2 | 264052 | 343305 | 403.75 | -105.73 | 390.49 |
| 0 | -25 | 0 | -139125 | 199831 | 338956 | 724.312 | -105.73 | 146.436 |
| 0 | -50 | 125 | -102665 | 216740 | 319405 | 431.562 | -127.845 | 315.1 |
| 0 | -50 | 175 | -94272.2 | 223434 | 317706 | 393.188 | -127.845 | 348.51 |
| 0 | -50 | 150 | -97889.1 | 219525 | 317414 | 409.312 | -127.845 | 333.447 |
| 0 | -50 | 100 | -108274 | 208273 | 316548 | 458.312 | -127.845 | 284.61 |
| 0 | -50 | 75 | -115707 | 198325 | 314032 | 488.438 | -127.845 | 254.211 |
| 0 | -50 | 200 | -87698.7 | 223235 | 310933 | 363.625 | -127.845 | 367.44 |
| 0 | -50 | 50 | -124664 | 184027 | 308691 | 525.688 | -127.845 | 204.943 |
| 0 | -50 | 25 | -126605 | 177834 | 304440 | 533.062 | -127.845 | 193.87 |
| 0 | -50 | 225 | -81706.8 | 221510 | 303217 | 337.75 | -127.845 | 390.49 |
| 0 | -50 | 0 | -131679 | 158118 | 289797 | 551.188 | -127.845 | 146.436 |
| 0 | -50 | -25 | -135234 | 140945 | 276180 | 565 | -127.845 | 139.469 |
| 0 | -75 | 175 | -90764.9 | 184846 | 275611 | 325.812 | -146.153 | 348.51 |
| 0 | -75 | 125 | -98076.6 | 176722 | 274799 | 355.062 | -146.153 | 315.1 |
| 0 | -75 | 150 | -93979.3 | 179914 | 273893 | 338.188 | -146.153 | 333.447 |
| 0 | -75 | 100 | -103131 | 169294 | 272425 | 375.062 | -146.153 | 284.61 |
| 0 | -75 | 200 | -85036.8 | 186067 | 271104 | 302.375 | -146.153 | 367.44 |
| 0 | -75 | 75 | -109431 | 159779 | 269210 | 395.938 | -146.153 | 254.211 |
| 0 | -75 | 225 | -79978.8 | 185752 | 265731 | 282.75 | -146.153 | 390.49 |
| 0 | -75 | 50 | -116483 | 147147 | 263630 | 421.062 | -146.153 | 204.943 |
| 0 | -75 | 25 | -117886 | 141847 | 259734 | 424.812 | -146.153 | 193.87 |
| 0 | -75 | 0 | -120983 | 126071 | 247054 | 435.188 | -146.153 | 146.436 |
| 0 | -75 | -25 | -123261 | 111930 | 235190 | 443.625 | -146.153 | 139.469 |
| 0 | -75 | -50 | -124708 | 101672 | 226380 | 449.25 | -146.153 | 136.356 |
| 0 | -100 | 200 | -76499.7 | 137174 | 213674 | 219.625 | -179.829 | 367.44 |
| 0 | -100 | 175 | -79830.5 | 132966 | 212797 | 230.125 | -179.829 | 348.51 |
| 0 | -100 | 225 | -72449.9 | 138631 | 211081 | 207.625 | -179.829 | 390.49 |
| 0 | -100 | 150 | -82202.7 | 128215 | 210418 | 237.125 | -179.829 | 333.447 |
| 0 | -100 | 125 | -84192.7 | 123976 | 208169 | 243.625 | -179.829 | 315.1 |
| 0 | -100 | 100 | -86319.5 | 117325 | 203645 | 250.25 | -179.829 | 284.61 |
| 0 | -100 | 75 | -90219.7 | 109153 | 199373 | 259.25 | -179.829 | 254.211 |
| 0 | -100 | 50 | -94055.9 | 99443.5 | 193499 | 269.875 | -179.829 | 204.943 |
| 0 | -100 | 25 | -94464.1 | 96073.2 | 190537 | 270.875 | -179.829 | 193.87 |
| 0 | -100 | 0 | -95713.7 | 87279.5 | 182993 | 274.625 | -179.829 | 146.436 |
| 0 | -100 | -25 | -97020.3 | 78656.5 | 175677 | 278.25 | -179.829 | 139.469 |
| 0 | -100 | -50 | -97722.9 | 71560.6 | 169283 | 280.375 | -179.829 | 136.356 |
| 0 | -100 | -75 | -98604.6 | 63373.8 | 161978 | 282.625 | -179.829 | 134.012 |
## Optimal policy
Charge threshold: 150 €/MWh \
Discharge threshold: 175 €/MWh
Profit on test data: € 359548 \
Charge cycles: 855.938
# Smarter Policy using predicted NRV
Test data: 01-01-2023 until 08-102023
| Policy | Threshold Step Size (€) | Total Profit (€) | Charge Cycles |
|--------|---------------------|--------------|---------------|
| Baseline (charge: 150, discharge: 175) | 25 | 251202.59 |  725 |
| Baseline (yesterday imbalance price) | 25 | 342980.0938 | 903 |
| GRU Predicted NRV (mean reconstructed imbalance price) | 50 | 325362.81 |  856 |
| GRU Predicted NRV (mean reconstructed imbalance price) | 25 | 334058.65 | 862 |
| GRU Predicted NRV (mean thresholds) | 25 | 339846.9062 | 842 |
| Diffusion Predicted NRV (mean thresholds) | 25 | 338168.0312 | 886 |
# Penalty parameter for charge cycles
| Policy | Penalty parameter | Total Profit (€) | Charge Cycles |
|--------|---------------------|--------------|-----------------|
| Baseline (yesterday imbalance price) | 10 | 335968.9062 | 895.4375 |
| Baseline (yesterday imbalance price) | 20 | 328577.2812 | 886.5625 |
| Baseline (yesterday imbalance price) | 50 | 306301.9688 | 850.9375 |
| Baseline (yesterday imbalance price) | 150 | 251367.0469 | 749.7500 |
| Diffusion Predicted NRV | 10 | 331288.7812 | 880.3750 |
| Diffusion Predicted NRV | 20 | 324568.7812 | 871.5000 |
| Diffusion Predicted NRV | 50 | 304761.1875 | 837.3125 |
| Diffusion Predicted NRV | 150 | 238441.5625 | 670.1875 |
# TODO
- [ ] Baseline
- [x] Profit penalty parameter als over charge cycles voor een dag -> parameter bepalen op training data (convex probleem) (< 400 charge cycles per jaar) (over een dag kijken hoeveel charge cycles -> profit - penalty * charge cycles erover, (misschien belonen als eronder charge cycles))
- [ ] Meer verschil bekijken tussen GRU en diffusion
- [ ] (In Progress) Andere lagen voor diffusion model (GRU, kijken naar TSDiff)
- [x] Policies met andere modellen (Linear, Non Linear)
- [ ] Visualize the policies over the whole testr set -> thresholds plotten voor elke dag (elke policy) -> mss distribution om overzichtelijk te houden (mean and std)
- [ ] Probleem met diffusion model (activation function? waarom direct grote waardes?)
- [ ] Autoregressive confidence problem -> Quantiles zelf uit elkaar halen (helpt dit?)
- [ ] time steps reducing for diffusion model (UNet activation functions?)
- [ ] (State space model? S4)
TODO:
- [ ] diffusion model oefening generative models vragen
- [ ] Non autoregressive models policy testen (Non Linear eerst) -> als dit al slect, niet verder kijken, wel vermelden
- [ ] Policy in test set -> over charge cycles (stop trading electricity)
- [ ] penalty bepalen op training data
- [ ] cycles en profit herschalen naar per jaar
baseline -> NRV van gisteren gebruiken om thresholds te bepalen voor vandaag
andere policies -> NRV van vandaag voorspellen met model en thresholds bepalen voor vandaag
Eerste baseline -> thresholds bepalen op training data maar ook stoppen als 400 cycles (herschalen) per jaar bereikt zijn -> thresholds zouden anders moeten zijn (Ook met penalty parameter)
-> deze toepassen op test set (ook stoppen als 400/jaar bereikt zijn)
Visualizatie van thresholds over test set voor baselines en complexere modellen -> zonder penalties tonen
1 a 2 Case studies (extreme gevallen, thresholds 150, -5, normale mss)
- Generatie van NRV (echte NRV)
- Thresholds die eruit komen
- Profit en charge cycles
Policy volledig fixen en later training script met policy direct erachter (tijdens schrijven door laten runnen)
1) Policy
2) Finetuning van modellen (+ vergelijken met elkaar opbv profit en error)
3) Ablation Study (input features weghalen en kijken wat er gebeurt)
( 4) Diffusion tussendoor )
Inleiding +
Literatuurstudie +
Tabellen die we gaan bespreken -> updaten met nieuwe data dan
Nog eens 3e meeting opbrengen voor 2e deel maart.