Battery example¶
This example shows a simple battery use case in an EMPS simulation. The battery functionality of the EMPS is documented here: Battery functionality. In the example, we have a small power system with a battery. In the figure a sketch of the system is provided, showing three interconnected areas.
The area TEV has aggregated hydro power, Numedal has detailed hydro power and Battery is the battery area. An overview of the hydro power and battery specification is provided in the figure. The load in the system have simple seasonal variations, high load in the winter, low in the summer and medium load in the spring and fall. Stochastic inflow with 8 scenarios with seasonal variations, low in the winter, medium in the fall and high during spring and summer. The time resolution is set to 3 hours per time-step (prisavsnitt).
Input file¶
All detailes of the system can be found in the busbar_battery.json file below. Note that when using the LTM-API the previous requirement of equality of timestamps on the Break point series for “exogenous_endvalue”, “charging_cost”, “max_charging_power” and “charging_efficiency” is removed. See busbar_battery.json example below. The LTM-API joins all timestamps of the mentioned break-point time-series and creates the battery.h5-file (with the required array dimensions). See the battery documentation for more details: Battery functionality.
Expand to see full JSON listings.
1{
2 "$schema": "model.schema.json",
3 "model": {
4 "global_settings": {
5 "name": "batteries",
6 "output_path": "testout_batteries/",
7 "delete_output_dir": false,
8 "generate_output_dir": true,
9 "simulation_period": {
10 "timestamps": [
11 "2024-01-01T00:00:00Z",
12 "2024-12-30T00:00:00Z"
13 ],
14 "scenarios": [
15 [
16 1,
17 0
18 ]
19 ]
20 },
21 "historical_period": {
22 "timestamps": [
23 "1981-01-01T00:00:00Z",
24 "1989-01-01T00:00:00Z"
25 ],
26 "scenarios": [
27 [
28 1,
29 0
30 ]
31 ]
32 },
33 "max_iterations": 40,
34 "precision": 0.001,
35 "default_max_iterations_battery": 101,
36 "default_precision_battery": 0.42,
37 "timesteps_per_week": 42,
38 "kronasjer": "kronasjer",
39 "default_spill_cost": 0.01,
40 "default_load_penalty": 445.0
41 },
42 "dclines": [
43 {
44 "name": "numedal-tev",
45 "forward_capacity": {
46 "timestamps": [
47 "2024-01-01T00:00:00Z"
48 ],
49 "scenarios": [
50 [
51 2
52 ]
53 ]
54 },
55 "backward_capacity": {
56 "timestamps": [
57 "2024-01-01T00:00:00Z"
58 ],
59 "scenarios": [
60 [
61 2
62 ]
63 ]
64 },
65 "loss_percentage": 2.0,
66 "forward_cost": 2.0,
67 "backward_cost": 2.0
68 },
69 {
70 "name": "numedal-battery_busbar",
71 "forward_capacity": {
72 "timestamps": [
73 "2024-01-01T00:00:00Z"
74 ],
75 "scenarios": [
76 [
77 2
78 ]
79 ]
80 },
81 "backward_capacity": {
82 "timestamps": [
83 "2024-01-01T00:00:00Z"
84 ],
85 "scenarios": [
86 [
87 2
88 ]
89 ]
90 },
91 "loss_percentage": 2.0,
92 "forward_cost": 2.0,
93 "backward_cost": 2.0
94 },
95 {
96 "name": "tev-battery_busbar",
97 "forward_capacity": {
98 "timestamps": [
99 "2024-01-01T00:00:00Z"
100 ],
101 "scenarios": [
102 [
103 20
104 ]
105 ]
106 },
107 "backward_capacity": {
108 "timestamps": [
109 "2024-01-01T00:00:00Z"
110 ],
111 "scenarios": [
112 [
113 20
114 ]
115 ]
116 },
117 "loss_percentage": 2.0,
118 "forward_cost": 2.0,
119 "backward_cost": 2.0
120 }
121 ],
122 "loads": [
123 {
124 "#comment": "Gruppe 16",
125 "name": "Seasonal variation",
126 "capacity": {
127 "timestamps": [
128 "2024-01-01T00:00:00Z",
129 "2024-03-01T00:00:00Z",
130 "2024-06-01T00:00:00Z",
131 "2024-09-01T00:00:00Z",
132 "2024-12-01T00:00:00Z"
133 ],
134 "scenarios": [
135 [
136 2.10,
137 1.31,
138 0.52,
139 1.31,
140 2.10
141 ]
142 ]
143 }
144 },
145 {
146 "#comment": "Gruppe 16",
147 "name": "Seasonal variation 2",
148 "capacity": {
149 "timestamps": [
150 "2024-01-01T00:00:00Z",
151 "2024-03-01T00:00:00Z",
152 "2024-06-01T00:00:00Z",
153 "2024-09-01T00:00:00Z",
154 "2024-12-01T00:00:00Z"
155 ],
156 "scenarios": [
157 [
158 20.0,
159 12.48,
160 4.99,
161 12.48,
162 20.0
163 ]
164 ]
165 }
166 }
167 ],
168 "market_steps": [
169 {
170 "#comment": "type: market_step",
171 "name": "IMPORT",
172 "price": {
173 "#comment": "type: time series / txy",
174 "timestamps": [
175 "2024-01-01T00:00:00Z",
176 "2024-04-01T00:00:00Z",
177 "2024-10-01T00:00:00Z"
178 ],
179 "scenarios": [
180 [
181 50,
182 25,
183 40
184 ]
185 ]
186 },
187 "capacity": {
188 "timestamps": [
189 "2024-01-01T00:00:00Z",
190 "2024-04-01T00:00:00Z",
191 "2024-10-01T00:00:00Z"
192 ],
193 "scenarios": [
194 [
195 2,
196 1,
197 2
198 ]
199 ]
200 }
201 },
202 {
203 "#comment": "type: market_step",
204 "name": "Export",
205 "price": {
206 "#comment": "type: time series / txy",
207 "timestamps": [
208 "2024-01-01T00:00:00Z",
209 "2024-04-01T00:00:00Z",
210 "2024-10-01T00:00:00Z"
211 ],
212 "scenarios": [
213 [
214 50,
215 25,
216 40
217 ]
218 ]
219 },
220 "capacity": {
221 "timestamps": [
222 "2024-01-01T00:00:00Z",
223 "2024-04-01T00:00:00Z",
224 "2024-10-01T00:00:00Z"
225 ],
226 "scenarios": [
227 [
228 -2,
229 -3,
230 -3
231 ]
232 ]
233 }
234 }
235 ],
236 "main_price_model_TXY": {
237 "#comment": "hovedprisrekke"
238 },
239 "inflow_series": [
240 {
241 "name": "yearly_inflow_profile",
242 "series": {
243 "timestamps": [
244 "1981-01-01T00:00:00Z",
245 "1981-05-01T00:00:00Z",
246 "1981-10-01T00:00:00Z",
247 "1982-01-01T00:00:00Z",
248 "1982-05-01T00:00:00Z",
249 "1982-10-01T00:00:00Z",
250 "1983-01-01T00:00:00Z",
251 "1983-05-01T00:00:00Z",
252 "1983-10-01T00:00:00Z",
253 "1984-01-01T00:00:00Z",
254 "1984-05-01T00:00:00Z",
255 "1984-10-01T00:00:00Z",
256 "1985-01-01T00:00:00Z",
257 "1985-05-01T00:00:00Z",
258 "1985-10-01T00:00:00Z",
259 "1986-01-01T00:00:00Z",
260 "1986-05-01T00:00:00Z",
261 "1986-10-01T00:00:00Z",
262 "1987-01-01T00:00:00Z",
263 "1987-05-01T00:00:00Z",
264 "1987-10-01T00:00:00Z",
265 "1988-01-01T00:00:00Z",
266 "1988-05-01T00:00:00Z",
267 "1988-10-01T00:00:00Z"
268 ],
269 "scenarios": [
270 [
271 0.47,
272 1.79,
273 1.30,
274 0.49,
275 1.87,
276 1.35,
277 0.38,
278 1.45,
279 1.05,
280 0.34,
281 1.33,
282 0.96,
283 0.32,
284 1.25,
285 0.90,
286 0.36,
287 1.40,
288 1.01,
289 0.44,
290 1.72,
291 1.24,
292 0.43,
293 1.67,
294 1.21
295 ]
296 ]
297 }
298 }
299 ],
300 "reservoirs": [
301 {
302 "name": "LABRO",
303 "average_spill_energy_equivalent": 0.115,
304 "average_regulated_inflow": 2.7,
305 "degree_of_regulation": 4,
306 "initial_volume": 60,
307 "max_discharge": 30,
308 "reference_curve": {
309 "timestamps": [
310 "2024-01-01T00:00:00Z",
311 "2024-04-22T00:00:00Z",
312 "2024-06-03T00:00:00Z",
313 "2024-12-01T00:00:00Z"
314 ],
315 "scenarios": [
316 [
317 70.0,
318 0.0,
319 35.0,
320 85.0
321 ]
322 ]
323 },
324 "regulated_inflow_name": "yearly_inflow_profile",
325 "volume_curve": {
326 "x": [
327 1050,
328 1100
329 ],
330 "y": [
331 0,
332 100
333 ]
334 }
335 },
336 {
337 "name": "VITTINGFOSS",
338 "average_spill_energy_equivalent": 0.115,
339 "average_regulated_inflow": 2.3,
340 "degree_of_regulation": 4,
341 "initial_volume": 60,
342 "max_discharge": 20,
343 "reference_curve": {
344 "timestamps": [
345 "2024-01-01T00:00:00Z",
346 "2024-04-22T00:00:00Z",
347 "2024-06-03T00:00:00Z",
348 "2024-12-01T00:00:00Z"
349 ],
350 "scenarios": [
351 [
352 70.0,
353 0.0,
354 35.0,
355 85.0
356 ]
357 ]
358 },
359 "regulated_inflow_name": "yearly_inflow_profile",
360 "volume_curve": {
361 "x": [
362 1050,
363 1100
364 ],
365 "y": [
366 0,
367 100
368 ]
369 }
370 }
371 ],
372 "plants": [
373 {
374 "name": "LABRO_plant",
375 "discharge_energy_equivalent": {
376 "timestamps": [
377 "2023-01-02T00:00:00Z"
378 ],
379 "scenarios": [
380 [
381 0.12
382 ]
383 ]
384 },
385 "pq_curves": {
386 "2024-01-01T00:00:00Z": {
387 "y": [
388 0.0,
389 9.89
390 ],
391 "x": [
392 0.0,
393 24.6
394 ]
395 }
396 },
397 "average_unregulated_inflow": 1.5,
398 "gross_head": 40.0,
399 "tailrace_elevation": 1030,
400 "unregulated_inflow_name": "yearly_inflow_profile"
401 },
402 {
403 "name": "VITTINGFOSS_plant",
404 "discharge_energy_equivalent": {
405 "timestamps": [
406 "2023-01-02T00:00:00Z"
407 ],
408 "scenarios": [
409 [
410 0.12
411 ]
412 ]
413 },
414 "pq_curves": {
415 "2024-01-01T00:00:00Z": {
416 "y": [
417 0.0,
418 9.89
419 ],
420 "x": [
421 0.0,
422 24.6
423 ]
424 }
425 },
426 "average_unregulated_inflow": 1.3,
427 "gross_head": 40.0,
428 "tailrace_elevation": 1030,
429 "unregulated_inflow_name": "yearly_inflow_profile"
430 }
431 ],
432 "aggregated_hydro_modules": [
433 {
434 "name": "tev_enmag_aggregated",
435 "reservoir_energy": 100000.0,
436 "station_power": 22.0,
437 "start_reservoir_energy": 60000,
438 "regulated_power_inflow": {
439 "#comment": "R30 - GWh/uke i datafil, input in MW",
440 "timestamps": [
441 "2024-01-01T00:00:00Z",
442 "2024-05-01T00:00:00Z",
443 "2024-10-01T00:00:00Z"
444 ],
445 "scenarios": [
446 [
447 1.00601190476,
448 1.02321428571,
449 0.01678571429
450 ],
451 [
452 1.00482142857,
453 1.01857142857,
454 0.01339285714
455 ],
456 [
457 1.00238095238,
458 1.00928571429,
459 0.00672619048
460 ],
461 [
462 1.00315476190,
463 1.01208333333,
464 0.00869047619
465 ],
466 [
467 1.00261904762,
468 1.01023809524,
469 0.00738095238
470 ],
471 [
472 1.00363095238,
473 1.01392857143,
474 0.01005952381
475 ],
476 [
477 1.00553571429,
478 1.02130952381,
479 0.01541666667
480 ],
481 [
482 1.00410714286,
483 1.01577380952,
484 0.01142857143
485 ]
486 ]
487 },
488 "unregulated_power_inflow": {
489 "#comment": "U30 - GWh/uke i datafil, input in MW",
490 "timestamps": [
491 "2024-01-01T00:00:00Z",
492 "2024-05-01T00:00:00Z",
493 "2024-10-01T00:00:00Z"
494 ],
495 "scenarios": [
496 [
497 1.00035714286,
498 1.00136904762,
499 0.00101190476
500 ],
501 [
502 1.00041666667,
503 1.00166666667,
504 0.00119047619
505 ],
506 [
507 1.00017857143,
508 1.00071428571,
509 0.00053571429
510 ],
511 [
512 1.00023809524,
513 1.00095238095,
514 0.00065476190
515 ],
516 [
517 1.00047619048,
518 1.00184523810,
519 0.00136904762
520 ],
521 [
522 1.00029761905,
523 1.00113095238,
524 0.00083333333
525 ],
526 [
527 1.00029761905,
528 1.00113095238,
529 0.00083333333
530 ],
531 [
532 1.00023809524,
533 1.00083333333,
534 0.00059523810
535 ]
536 ]
537 },
538 "upper_reservoir_limits": {
539 "#comment": "Manually adjusted upper reserveroir limits, MWh",
540 "timestamps": [
541 "2024-01-01T00:00:00Z",
542 "2025-01-01T00:00:00Z"
543 ],
544 "scenarios": [
545 [
546 80000,
547 80000
548 ]
549 ]
550 },
551 "lower_reservoir_limits": {
552 "#comment": "Manually adjusted lower reserveroir limits, MWh",
553 "timestamps": [
554 "2024-01-01T00:00:00Z"
555 ],
556 "scenarios": [
557 [
558 20000
559 ]
560 ]
561 },
562 "upper_production_limits": {
563 "#comment": "Manually adjusted upper production limits, MW",
564 "timestamps": [
565 "2024-01-01T00:00:00Z"
566 ],
567 "scenarios": [
568 [
569 22
570 ]
571 ]
572 },
573 "lower_production_limits": {
574 "#comment": "Manually adjusted lower production limits, MW",
575 "timestamps": [
576 "2024-01-01T00:00:00Z"
577 ],
578 "scenarios": [
579 [
580 0
581 ]
582 ]
583 }
584 }
585 ],
586 "batteries": [
587 {
588 "name": "battery",
589 "start_battery_energy": 0,
590 "charging_efficiency": {
591 "timestamps": [
592 "2024-01-01T00:00:00Z",
593 "2024-01-01T01:00:00Z",
594 "2024-05-31T23:00:00Z",
595 "2024-06-01T00:00:00Z",
596 "2024-07-01T00:00:00Z"
597 ],
598 "scenarios": [
599 [
600 0.7,
601 0.8,
602 0.9,
603 1.0,
604 0.9
605 ]
606 ]
607 },
608 "max_charging_power": {
609 "timestamps": [
610 "2024-01-01T00:00:00Z",
611 "2024-06-01T00:00:00Z"
612 ],
613 "scenarios": [
614 [
615 50.0,
616 50.0
617 ]
618 ]
619 },
620 "charging_cost": {
621 "timestamps": [
622 "2024-01-01T00:00:00Z",
623 "2024-06-01T00:00:00Z",
624 "2024-08-01T00:00:00Z"
625 ],
626 "scenarios": [
627 [
628 5.0,
629 3.0,
630 2.0
631 ]
632 ]
633 },
634 "endvalue_type": 1,
635 "max_energy_level": {
636 "#comment": "Manually adjusted upper reserveroir limits, MWh",
637 "timestamps": [
638 "2024-01-01T00:00:00Z",
639 "2024-06-01T00:00:00Z"
640 ],
641 "scenarios": [
642 [
643 4500,
644 4400
645 ]
646 ]
647 },
648 "min_energy_level": {
649 "#comment": "Manually adjusted lower reserveroir limits, MWh",
650 "timestamps": [
651 "2024-01-01T00:00:00Z"
652 ],
653 "scenarios": [
654 [
655 0.5
656 ]
657 ]
658 },
659 "max_discharge_power": {
660 "#comment": "Manually adjusted upper production limits, MW",
661 "timestamps": [
662 "2024-01-01T00:00:00Z"
663 ],
664 "scenarios": [
665 [
666 40
667 ]
668 ]
669 },
670 "min_discharge_power": {
671 "#comment": "Manually adjusted lower production limits, MW",
672 "timestamps": [
673 "2024-01-01T00:00:00Z"
674 ],
675 "scenarios": [
676 [
677 0
678 ]
679 ]
680 },
681 "exogenous_endvalue": {
682 "timestamps": [
683 "2024-01-01T00:00:00Z",
684 "2024-02-06T00:00:00Z"
685 ],
686 "scenarios": [
687 [
688 1,
689 1
690 ],
691 [
692 2,
693 2
694 ],
695 [
696 3,
697 3
698 ],
699 [
700 4,
701 4
702 ],
703 [
704 5,
705 5
706 ],
707 [
708 6,
709 6
710 ],
711 [
712 7,
713 7
714 ],
715 [
716 8,
717 8
718 ],
719 [
720 9,
721 9
722 ],
723 [
724 10,
725 10
726 ],
727 [
728 11,
729 11
730 ],
731 [
732 12,
733 12
734 ],
735 [
736 13,
737 13
738 ],
739 [
740 14,
741 14
742 ],
743 [
744 15,
745 15
746 ],
747 [
748 16,
749 16
750 ],
751 [
752 17,
753 17
754 ],
755 [
756 18,
757 18
758 ],
759 [
760 19,
761 19
762 ],
763 [
764 20,
765 20
766 ],
767 [
768 21,
769 21
770 ],
771 [
772 22,
773 22
774 ],
775 [
776 23,
777 23
778 ],
779 [
780 24,
781 24
782 ],
783 [
784 25,
785 25
786 ],
787 [
788 26,
789 26
790 ],
791 [
792 27,
793 27
794 ],
795 [
796 28,
797 28
798 ],
799 [
800 29,
801 29
802 ],
803 [
804 30,
805 30
806 ],
807 [
808 31,
809 31
810 ],
811 [
812 32,
813 32
814 ],
815 [
816 33,
817 33
818 ],
819 [
820 34,
821 34
822 ],
823 [
824 35,
825 35
826 ],
827 [
828 36,
829 36
830 ],
831 [
832 37,
833 37
834 ],
835 [
836 38,
837 38
838 ],
839 [
840 39,
841 39
842 ],
843 [
844 40,
845 40
846 ],
847 [
848 41,
849 41
850 ],
851 [
852 42,
853 42
854 ],
855 [
856 43,
857 43
858 ],
859 [
860 44,
861 44
862 ],
863 [
864 45,
865 45
866 ],
867 [
868 46,
869 46
870 ],
871 [
872 47,
873 47
874 ],
875 [
876 48,
877 48
878 ],
879 [
880 49,
881 49
882 ],
883 [
884 50,
885 50
886 ],
887 [
888 51,
889 51
890 ]
891 ]
892 }
893 }
894 ],
895 "busbars": [
896 {
897 "name": "numedal"
898 },
899 {
900 "name": "tev"
901 },
902 {
903 "name": "battery_busbar"
904 }
905 ],
906 "connections": [
907 {
908 "from": "WIND_TEST_01",
909 "to": "tev"
910 },
911 {
912 "from": "Seasonal variation",
913 "to": "numedal"
914 },
915 {
916 "from": "Seasonal variation 2",
917 "to": "tev"
918 },
919 {
920 "from": "numedal",
921 "to": "numedal-tev"
922 },
923 {
924 "from": "numedal-tev",
925 "to": "tev"
926 },
927 {
928 "from": "VITTINGFOSS",
929 "to": "numedal"
930 },
931 {
932 "from": "VITTINGFOSS",
933 "to": "VITTINGFOSS_plant"
934 },
935 {
936 "from": "LABRO",
937 "to": "numedal"
938 },
939 {
940 "from": "LABRO",
941 "to": "LABRO_plant"
942 },
943 {
944 "from": "tev_enmag_aggregated",
945 "to": "tev"
946 },
947 {
948 "from": "numedal",
949 "to": "numedal-battery_busbar"
950 },
951 {
952 "from": "numedal-battery_busbar",
953 "to": "battery_busbar"
954 },
955 {
956 "from": "tev",
957 "to": "tev-battery_busbar"
958 },
959 {
960 "from": "tev-battery_busbar",
961 "to": "battery_busbar"
962 },
963 {
964 "from": "battery",
965 "to": "battery_busbar"
966 },
967 {
968 "from": "IMPORT",
969 "to": "tev"
970 },
971 {
972 "from": "Export",
973 "to": "tev"
974 }
975 ],
976 "wind": [
977 {
978 "name": "WIND_TEST_01",
979 "capacity": {
980 "timestamps": [
981 "1981-01-01T00:00:00Z",
982 "1981-01-03T00:00:00Z"
983 ],
984 "scenarios": [
985 [
986 0.1,
987 0.1
988 ],
989 [
990 0.2,
991 0.2
992 ],
993 [
994 0.3,
995 0.3
996 ],
997 [
998 0.4,
999 0.4
1000 ],
1001 [
1002 0.5,
1003 0.5
1004 ],
1005 [
1006 0.6,
1007 0.6
1008 ],
1009 [
1010 0.7,
1011 0.7
1012 ],
1013 [
1014 0.8,
1015 0.8
1016 ]
1017 ]
1018 }
1019 }
1020 ]
1021 }
1022}
Results¶
The link below takes you to a (static) notebook where LTM-API have been run using the busbar_battery.json file as input. The notebook contains the result from the EMPS show in a set of figures.