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 area_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 area_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_area",
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_area",
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 "inflow_series": [
237 {
238 "name": "yearly_inflow_profile",
239 "series": {
240 "timestamps": [
241 "1981-01-01T00:00:00Z",
242 "1981-05-01T00:00:00Z",
243 "1981-10-01T00:00:00Z",
244 "1982-01-01T00:00:00Z",
245 "1982-05-01T00:00:00Z",
246 "1982-10-01T00:00:00Z",
247 "1983-01-01T00:00:00Z",
248 "1983-05-01T00:00:00Z",
249 "1983-10-01T00:00:00Z",
250 "1984-01-01T00:00:00Z",
251 "1984-05-01T00:00:00Z",
252 "1984-10-01T00:00:00Z",
253 "1985-01-01T00:00:00Z",
254 "1985-05-01T00:00:00Z",
255 "1985-10-01T00:00:00Z",
256 "1986-01-01T00:00:00Z",
257 "1986-05-01T00:00:00Z",
258 "1986-10-01T00:00:00Z",
259 "1987-01-01T00:00:00Z",
260 "1987-05-01T00:00:00Z",
261 "1987-10-01T00:00:00Z",
262 "1988-01-01T00:00:00Z",
263 "1988-05-01T00:00:00Z",
264 "1988-10-01T00:00:00Z"
265 ],
266 "scenarios": [
267 [
268 0.47,
269 1.79,
270 1.30,
271 0.49,
272 1.87,
273 1.35,
274 0.38,
275 1.45,
276 1.05,
277 0.34,
278 1.33,
279 0.96,
280 0.32,
281 1.25,
282 0.90,
283 0.36,
284 1.40,
285 1.01,
286 0.44,
287 1.72,
288 1.24,
289 0.43,
290 1.67,
291 1.21
292 ]
293 ]
294 }
295 }
296 ],
297 "reservoirs": [
298 {
299 "name": "LABRO",
300 "average_regulated_inflow": 2.7,
301 "degree_of_regulation": 4,
302 "initial_volume": 60,
303 "max_discharge": 30,
304 "reference_curve": {
305 "timestamps": [
306 "2024-01-01T00:00:00Z",
307 "2024-04-22T00:00:00Z",
308 "2024-06-03T00:00:00Z",
309 "2024-12-01T00:00:00Z"
310 ],
311 "scenarios": [
312 [
313 70.0,
314 0.0,
315 35.0,
316 85.0
317 ]
318 ]
319 },
320 "regulated_inflow_name": "yearly_inflow_profile",
321 "gross_head": 40.0,
322 "tailrace_elevation": 1030,
323 "volume_curve": {
324 "x": [
325 1050,
326 1100
327 ],
328 "y": [
329 0,
330 100
331 ]
332 }
333 },
334 {
335 "name": "VITTINGFOSS",
336 "average_regulated_inflow": 2.3,
337 "degree_of_regulation": 4,
338 "initial_volume": 60,
339 "max_discharge": 20,
340 "reference_curve": {
341 "timestamps": [
342 "2024-01-01T00:00:00Z",
343 "2024-04-22T00:00:00Z",
344 "2024-06-03T00:00:00Z",
345 "2024-12-01T00:00:00Z"
346 ],
347 "scenarios": [
348 [
349 70.0,
350 0.0,
351 35.0,
352 85.0
353 ]
354 ]
355 },
356 "regulated_inflow_name": "yearly_inflow_profile",
357 "gross_head": 40.0,
358 "tailrace_elevation": 1030,
359 "volume_curve": {
360 "x": [
361 1050,
362 1100
363 ],
364 "y": [
365 0,
366 100
367 ]
368 }
369 }
370 ],
371 "plants": [
372 {
373 "name": "LABRO_plant",
374 "average_energy_equivalent": 0.115,
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 "unregulated_inflow_name": "yearly_inflow_profile"
399 },
400 {
401 "name": "VITTINGFOSS_plant",
402 "average_energy_equivalent": 0.115,
403 "discharge_energy_equivalent": {
404 "timestamps": [
405 "2023-01-02T00:00:00Z"
406 ],
407 "scenarios": [
408 [
409 0.12
410 ]
411 ]
412 },
413 "pq_curves": {
414 "2024-01-01T00:00:00Z": {
415 "y": [
416 0.0,
417 9.89
418 ],
419 "x": [
420 0.0,
421 24.6
422 ]
423 }
424 },
425 "average_unregulated_inflow": 1.3,
426 "unregulated_inflow_name": "yearly_inflow_profile"
427 }
428 ],
429 "aggregated_hydro_modules": [
430 {
431 "name": "tev_enmag_aggregated",
432 "reservoir_energy": 100000.0,
433 "station_power": 22.0,
434 "start_reservoir_energy": 60000,
435 "regulated_power_inflow": {
436 "#comment": "R30 - GWh/uke i datafil, input in MW",
437 "timestamps": [
438 "2024-01-01T00:00:00Z",
439 "2024-05-01T00:00:00Z",
440 "2024-10-01T00:00:00Z"
441 ],
442 "scenarios": [
443 [
444 1.00601190476,
445 1.02321428571,
446 0.01678571429
447 ],
448 [
449 1.00482142857,
450 1.01857142857,
451 0.01339285714
452 ],
453 [
454 1.00238095238,
455 1.00928571429,
456 0.00672619048
457 ],
458 [
459 1.00315476190,
460 1.01208333333,
461 0.00869047619
462 ],
463 [
464 1.00261904762,
465 1.01023809524,
466 0.00738095238
467 ],
468 [
469 1.00363095238,
470 1.01392857143,
471 0.01005952381
472 ],
473 [
474 1.00553571429,
475 1.02130952381,
476 0.01541666667
477 ],
478 [
479 1.00410714286,
480 1.01577380952,
481 0.01142857143
482 ]
483 ]
484 },
485 "unregulated_power_inflow": {
486 "#comment": "U30 - GWh/uke i datafil, input in MW",
487 "timestamps": [
488 "2024-01-01T00:00:00Z",
489 "2024-05-01T00:00:00Z",
490 "2024-10-01T00:00:00Z"
491 ],
492 "scenarios": [
493 [
494 1.00035714286,
495 1.00136904762,
496 0.00101190476
497 ],
498 [
499 1.00041666667,
500 1.00166666667,
501 0.00119047619
502 ],
503 [
504 1.00017857143,
505 1.00071428571,
506 0.00053571429
507 ],
508 [
509 1.00023809524,
510 1.00095238095,
511 0.00065476190
512 ],
513 [
514 1.00047619048,
515 1.00184523810,
516 0.00136904762
517 ],
518 [
519 1.00029761905,
520 1.00113095238,
521 0.00083333333
522 ],
523 [
524 1.00029761905,
525 1.00113095238,
526 0.00083333333
527 ],
528 [
529 1.00023809524,
530 1.00083333333,
531 0.00059523810
532 ]
533 ]
534 },
535 "upper_reservoir_limits": {
536 "#comment": "Manually adjusted upper reserveroir limits, MWh",
537 "timestamps": [
538 "2024-01-01T00:00:00Z",
539 "2025-01-01T00:00:00Z"
540 ],
541 "scenarios": [
542 [
543 80000,
544 80000
545 ]
546 ]
547 },
548 "lower_reservoir_limits": {
549 "#comment": "Manually adjusted lower reserveroir limits, MWh",
550 "timestamps": [
551 "2024-01-01T00:00:00Z"
552 ],
553 "scenarios": [
554 [
555 20000
556 ]
557 ]
558 },
559 "upper_production_limits": {
560 "#comment": "Manually adjusted upper production limits, MW",
561 "timestamps": [
562 "2024-01-01T00:00:00Z"
563 ],
564 "scenarios": [
565 [
566 22
567 ]
568 ]
569 },
570 "lower_production_limits": {
571 "#comment": "Manually adjusted lower production limits, MW",
572 "timestamps": [
573 "2024-01-01T00:00:00Z"
574 ],
575 "scenarios": [
576 [
577 0
578 ]
579 ]
580 }
581 }
582 ],
583 "batteries": [
584 {
585 "name": "battery",
586 "start_battery_energy": 0,
587 "charging_efficiency": {
588 "timestamps": [
589 "2024-01-01T00:00:00Z",
590 "2024-01-01T01:00:00Z",
591 "2024-05-31T23:00:00Z",
592 "2024-06-01T00:00:00Z",
593 "2024-07-01T00:00:00Z"
594 ],
595 "scenarios": [
596 [
597 0.7,
598 0.8,
599 0.9,
600 1.0,
601 0.9
602 ]
603 ]
604 },
605 "max_charging_power": {
606 "timestamps": [
607 "2024-01-01T00:00:00Z",
608 "2024-06-01T00:00:00Z"
609 ],
610 "scenarios": [
611 [
612 50.0,
613 50.0
614 ]
615 ]
616 },
617 "charging_cost": {
618 "timestamps": [
619 "2024-01-01T00:00:00Z",
620 "2024-06-01T00:00:00Z",
621 "2024-08-01T00:00:00Z"
622 ],
623 "scenarios": [
624 [
625 5.0,
626 3.0,
627 2.0
628 ]
629 ]
630 },
631 "endvalue_type": 1,
632 "max_energy_level": {
633 "#comment": "Manually adjusted upper reserveroir limits, MWh",
634 "timestamps": [
635 "2024-01-01T00:00:00Z",
636 "2024-06-01T00:00:00Z"
637 ],
638 "scenarios": [
639 [
640 4500,
641 4400
642 ]
643 ]
644 },
645 "min_energy_level": {
646 "#comment": "Manually adjusted lower reserveroir limits, MWh",
647 "timestamps": [
648 "2024-01-01T00:00:00Z"
649 ],
650 "scenarios": [
651 [
652 0.5
653 ]
654 ]
655 },
656 "max_discharge_power": {
657 "#comment": "Manually adjusted upper production limits, MW",
658 "timestamps": [
659 "2024-01-01T00:00:00Z"
660 ],
661 "scenarios": [
662 [
663 40
664 ]
665 ]
666 },
667 "min_discharge_power": {
668 "#comment": "Manually adjusted lower production limits, MW",
669 "timestamps": [
670 "2024-01-01T00:00:00Z"
671 ],
672 "scenarios": [
673 [
674 0
675 ]
676 ]
677 },
678 "exogenous_endvalue": {
679 "timestamps": [
680 "2024-01-01T00:00:00Z",
681 "2024-02-06T00:00:00Z"
682 ],
683 "scenarios": [
684 [
685 1,
686 1
687 ],
688 [
689 2,
690 2
691 ],
692 [
693 3,
694 3
695 ],
696 [
697 4,
698 4
699 ],
700 [
701 5,
702 5
703 ],
704 [
705 6,
706 6
707 ],
708 [
709 7,
710 7
711 ],
712 [
713 8,
714 8
715 ],
716 [
717 9,
718 9
719 ],
720 [
721 10,
722 10
723 ],
724 [
725 11,
726 11
727 ],
728 [
729 12,
730 12
731 ],
732 [
733 13,
734 13
735 ],
736 [
737 14,
738 14
739 ],
740 [
741 15,
742 15
743 ],
744 [
745 16,
746 16
747 ],
748 [
749 17,
750 17
751 ],
752 [
753 18,
754 18
755 ],
756 [
757 19,
758 19
759 ],
760 [
761 20,
762 20
763 ],
764 [
765 21,
766 21
767 ],
768 [
769 22,
770 22
771 ],
772 [
773 23,
774 23
775 ],
776 [
777 24,
778 24
779 ],
780 [
781 25,
782 25
783 ],
784 [
785 26,
786 26
787 ],
788 [
789 27,
790 27
791 ],
792 [
793 28,
794 28
795 ],
796 [
797 29,
798 29
799 ],
800 [
801 30,
802 30
803 ],
804 [
805 31,
806 31
807 ],
808 [
809 32,
810 32
811 ],
812 [
813 33,
814 33
815 ],
816 [
817 34,
818 34
819 ],
820 [
821 35,
822 35
823 ],
824 [
825 36,
826 36
827 ],
828 [
829 37,
830 37
831 ],
832 [
833 38,
834 38
835 ],
836 [
837 39,
838 39
839 ],
840 [
841 40,
842 40
843 ],
844 [
845 41,
846 41
847 ],
848 [
849 42,
850 42
851 ],
852 [
853 43,
854 43
855 ],
856 [
857 44,
858 44
859 ],
860 [
861 45,
862 45
863 ],
864 [
865 46,
866 46
867 ],
868 [
869 47,
870 47
871 ],
872 [
873 48,
874 48
875 ],
876 [
877 49,
878 49
879 ],
880 [
881 50,
882 50
883 ],
884 [
885 51,
886 51
887 ]
888 ]
889 }
890 }
891 ],
892 "areas": [
893 {
894 "name": "numedal"
895 },
896 {
897 "name": "tev"
898 },
899 {
900 "name": "battery_area"
901 }
902 ],
903 "connections": [
904 {
905 "from": "WIND_TEST_01",
906 "to": "tev"
907 },
908 {
909 "from": "Seasonal variation",
910 "to": "numedal"
911 },
912 {
913 "from": "Seasonal variation 2",
914 "to": "tev"
915 },
916 {
917 "from": "numedal",
918 "to": "numedal-tev"
919 },
920 {
921 "from": "numedal-tev",
922 "to": "tev"
923 },
924 {
925 "from": "VITTINGFOSS",
926 "to": "numedal"
927 },
928 {
929 "from": "VITTINGFOSS",
930 "to": "VITTINGFOSS_plant"
931 },
932 {
933 "from": "LABRO",
934 "to": "numedal"
935 },
936 {
937 "from": "LABRO",
938 "to": "LABRO_plant"
939 },
940 {
941 "from": "tev_enmag_aggregated",
942 "to": "tev"
943 },
944 {
945 "from": "numedal",
946 "to": "numedal-battery_area"
947 },
948 {
949 "from": "numedal-battery_area",
950 "to": "battery_area"
951 },
952 {
953 "from": "tev",
954 "to": "tev-battery_area"
955 },
956 {
957 "from": "tev-battery_area",
958 "to": "battery_area"
959 },
960 {
961 "from": "battery",
962 "to": "battery_area"
963 },
964 {
965 "from": "IMPORT",
966 "to": "tev"
967 },
968 {
969 "from": "Export",
970 "to": "tev"
971 }
972 ],
973 "wind": [
974 {
975 "name": "WIND_TEST_01",
976 "capacity": {
977 "timestamps": [
978 "1981-01-01T00:00:00Z",
979 "1981-01-03T00:00:00Z"
980 ],
981 "scenarios": [
982 [
983 0.1,
984 0.1
985 ],
986 [
987 0.2,
988 0.2
989 ],
990 [
991 0.3,
992 0.3
993 ],
994 [
995 0.4,
996 0.4
997 ],
998 [
999 0.5,
1000 0.5
1001 ],
1002 [
1003 0.6,
1004 0.6
1005 ],
1006 [
1007 0.7,
1008 0.7
1009 ],
1010 [
1011 0.8,
1012 0.8
1013 ]
1014 ]
1015 }
1016 }
1017 ]
1018 }
1019}
Results¶
The link below takes you to a (static) notebook where LTM-API have been run using the area_battery.json file as input. The notebook contains the result from the EMPS show in a set of figures.