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.
{
"$schema": "model.schema.json",
"model": {
"global_settings": {
"name": "batteries",
"output_path": "testout_batteries/",
"delete_output_dir": false,
"generate_output_dir": true,
"simulation_period": {
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-12-30T00:00:00Z"
],
"scenarios": [
[
1,
0
]
]
},
"historical_period": {
"timestamps": [
"1981-01-01T00:00:00Z",
"1989-01-01T00:00:00Z"
],
"scenarios": [
[
1,
0
]
]
},
"max_iterations": 40,
"precision": 0.001,
"default_max_iterations_battery": 101,
"default_precision_battery": 0.42,
"timesteps_per_week": 42,
"kronasjer": "kronasjer",
"default_spill_cost": 0.01,
"default_load_penalty": 445.0
},
"dclines": [
{
"name": "numedal-tev",
"forward_capacity": {
"timestamps": [
"2024-01-01T00:00:00Z"
],
"scenarios": [
[
2
]
]
},
"backward_capacity": {
"timestamps": [
"2024-01-01T00:00:00Z"
],
"scenarios": [
[
2
]
]
},
"loss_percentage": 2.0,
"forward_cost": 2.0,
"backward_cost": 2.0
},
{
"name": "numedal-battery_area",
"forward_capacity": {
"timestamps": [
"2024-01-01T00:00:00Z"
],
"scenarios": [
[
2
]
]
},
"backward_capacity": {
"timestamps": [
"2024-01-01T00:00:00Z"
],
"scenarios": [
[
2
]
]
},
"loss_percentage": 2.0,
"forward_cost": 2.0,
"backward_cost": 2.0
},
{
"name": "tev-battery_area",
"forward_capacity": {
"timestamps": [
"2024-01-01T00:00:00Z"
],
"scenarios": [
[
20
]
]
},
"backward_capacity": {
"timestamps": [
"2024-01-01T00:00:00Z"
],
"scenarios": [
[
20
]
]
},
"loss_percentage": 2.0,
"forward_cost": 2.0,
"backward_cost": 2.0
}
],
"loads": [
{
"#comment": "Gruppe 16",
"name": "Seasonal variation",
"capacity": {
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-03-01T00:00:00Z",
"2024-06-01T00:00:00Z",
"2024-09-01T00:00:00Z",
"2024-12-01T00:00:00Z"
],
"scenarios": [
[
2.10,
1.31,
0.52,
1.31,
2.10
]
]
}
},
{
"#comment": "Gruppe 16",
"name": "Seasonal variation 2",
"capacity": {
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-03-01T00:00:00Z",
"2024-06-01T00:00:00Z",
"2024-09-01T00:00:00Z",
"2024-12-01T00:00:00Z"
],
"scenarios": [
[
20.0,
12.48,
4.99,
12.48,
20.0
]
]
}
}
],
"market_steps": [
{
"#comment": "type: market_step",
"name": "IMPORT",
"price": {
"#comment": "type: time series / txy",
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-04-01T00:00:00Z",
"2024-10-01T00:00:00Z"
],
"scenarios": [
[
50,
25,
40
]
]
},
"capacity": {
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-04-01T00:00:00Z",
"2024-10-01T00:00:00Z"
],
"scenarios": [
[
2,
1,
2
]
]
}
},
{
"#comment": "type: market_step",
"name": "Export",
"price": {
"#comment": "type: time series / txy",
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-04-01T00:00:00Z",
"2024-10-01T00:00:00Z"
],
"scenarios": [
[
50,
25,
40
]
]
},
"capacity": {
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-04-01T00:00:00Z",
"2024-10-01T00:00:00Z"
],
"scenarios": [
[
-2,
-3,
-3
]
]
}
}
],
"inflow_series": [
{
"name": "yearly_inflow_profile",
"series": {
"timestamps": [
"1981-01-01T00:00:00Z",
"1981-05-01T00:00:00Z",
"1981-10-01T00:00:00Z",
"1982-01-01T00:00:00Z",
"1982-05-01T00:00:00Z",
"1982-10-01T00:00:00Z",
"1983-01-01T00:00:00Z",
"1983-05-01T00:00:00Z",
"1983-10-01T00:00:00Z",
"1984-01-01T00:00:00Z",
"1984-05-01T00:00:00Z",
"1984-10-01T00:00:00Z",
"1985-01-01T00:00:00Z",
"1985-05-01T00:00:00Z",
"1985-10-01T00:00:00Z",
"1986-01-01T00:00:00Z",
"1986-05-01T00:00:00Z",
"1986-10-01T00:00:00Z",
"1987-01-01T00:00:00Z",
"1987-05-01T00:00:00Z",
"1987-10-01T00:00:00Z",
"1988-01-01T00:00:00Z",
"1988-05-01T00:00:00Z",
"1988-10-01T00:00:00Z"
],
"scenarios": [
[
0.47,
1.79,
1.30,
0.49,
1.87,
1.35,
0.38,
1.45,
1.05,
0.34,
1.33,
0.96,
0.32,
1.25,
0.90,
0.36,
1.40,
1.01,
0.44,
1.72,
1.24,
0.43,
1.67,
1.21
]
]
}
}
],
"reservoirs": [
{
"name": "LABRO",
"average_regulated_inflow": 2.7,
"degree_of_regulation": 4,
"initial_volume": 60,
"max_discharge": 30,
"reference_curve": {
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-04-22T00:00:00Z",
"2024-06-03T00:00:00Z",
"2024-12-01T00:00:00Z"
],
"scenarios": [
[
70.0,
0.0,
35.0,
85.0
]
]
},
"regulated_inflow_name": "yearly_inflow_profile",
"gross_head": 40.0,
"tailrace_elevation": 1030,
"volume_curve": {
"x": [
1050,
1100
],
"y": [
0,
100
]
}
},
{
"name": "VITTINGFOSS",
"average_regulated_inflow": 2.3,
"degree_of_regulation": 4,
"initial_volume": 60,
"max_discharge": 20,
"reference_curve": {
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-04-22T00:00:00Z",
"2024-06-03T00:00:00Z",
"2024-12-01T00:00:00Z"
],
"scenarios": [
[
70.0,
0.0,
35.0,
85.0
]
]
},
"regulated_inflow_name": "yearly_inflow_profile",
"gross_head": 40.0,
"tailrace_elevation": 1030,
"volume_curve": {
"x": [
1050,
1100
],
"y": [
0,
100
]
}
}
],
"plants": [
{
"name": "LABRO_plant",
"average_energy_equivalent": 0.115,
"discharge_energy_equivalent": {
"timestamps": [
"2023-01-02T00:00:00Z"
],
"scenarios": [
[
0.12
]
]
},
"pq_curves": {
"2024-01-01T00:00:00Z": {
"y": [
0.0,
9.89
],
"x": [
0.0,
24.6
]
}
},
"average_unregulated_inflow": 1.5,
"unregulated_inflow_name": "yearly_inflow_profile"
},
{
"name": "VITTINGFOSS_plant",
"average_energy_equivalent": 0.115,
"discharge_energy_equivalent": {
"timestamps": [
"2023-01-02T00:00:00Z"
],
"scenarios": [
[
0.12
]
]
},
"pq_curves": {
"2024-01-01T00:00:00Z": {
"y": [
0.0,
9.89
],
"x": [
0.0,
24.6
]
}
},
"average_unregulated_inflow": 1.3,
"unregulated_inflow_name": "yearly_inflow_profile"
}
],
"aggregated_hydro_modules": [
{
"name": "tev_enmag_aggregated",
"reservoir_energy": 100000.0,
"station_power": 22.0,
"start_reservoir_energy": 60000,
"regulated_power_inflow": {
"#comment": "R30 - GWh/uke i datafil, input in MW",
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-05-01T00:00:00Z",
"2024-10-01T00:00:00Z"
],
"scenarios": [
[
1.00601190476,
1.02321428571,
0.01678571429
],
[
1.00482142857,
1.01857142857,
0.01339285714
],
[
1.00238095238,
1.00928571429,
0.00672619048
],
[
1.00315476190,
1.01208333333,
0.00869047619
],
[
1.00261904762,
1.01023809524,
0.00738095238
],
[
1.00363095238,
1.01392857143,
0.01005952381
],
[
1.00553571429,
1.02130952381,
0.01541666667
],
[
1.00410714286,
1.01577380952,
0.01142857143
]
]
},
"unregulated_power_inflow": {
"#comment": "U30 - GWh/uke i datafil, input in MW",
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-05-01T00:00:00Z",
"2024-10-01T00:00:00Z"
],
"scenarios": [
[
1.00035714286,
1.00136904762,
0.00101190476
],
[
1.00041666667,
1.00166666667,
0.00119047619
],
[
1.00017857143,
1.00071428571,
0.00053571429
],
[
1.00023809524,
1.00095238095,
0.00065476190
],
[
1.00047619048,
1.00184523810,
0.00136904762
],
[
1.00029761905,
1.00113095238,
0.00083333333
],
[
1.00029761905,
1.00113095238,
0.00083333333
],
[
1.00023809524,
1.00083333333,
0.00059523810
]
]
},
"upper_reservoir_limits": {
"#comment": "Manually adjusted upper reserveroir limits, MWh",
"timestamps": [
"2024-01-01T00:00:00Z",
"2025-01-01T00:00:00Z"
],
"scenarios": [
[
80000,
80000
]
]
},
"lower_reservoir_limits": {
"#comment": "Manually adjusted lower reserveroir limits, MWh",
"timestamps": [
"2024-01-01T00:00:00Z"
],
"scenarios": [
[
20000
]
]
},
"upper_production_limits": {
"#comment": "Manually adjusted upper production limits, MW",
"timestamps": [
"2024-01-01T00:00:00Z"
],
"scenarios": [
[
22
]
]
},
"lower_production_limits": {
"#comment": "Manually adjusted lower production limits, MW",
"timestamps": [
"2024-01-01T00:00:00Z"
],
"scenarios": [
[
0
]
]
}
}
],
"batteries": [
{
"name": "battery",
"start_battery_energy": 0,
"charging_efficiency": {
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-01-01T01:00:00Z",
"2024-05-31T23:00:00Z",
"2024-06-01T00:00:00Z",
"2024-07-01T00:00:00Z"
],
"scenarios": [
[
0.7,
0.8,
0.9,
1.0,
0.9
]
]
},
"max_charging_power": {
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-06-01T00:00:00Z"
],
"scenarios": [
[
50.0,
50.0
]
]
},
"charging_cost": {
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-06-01T00:00:00Z",
"2024-08-01T00:00:00Z"
],
"scenarios": [
[
5.0,
3.0,
2.0
]
]
},
"endvalue_type": 1,
"max_energy_level": {
"#comment": "Manually adjusted upper reserveroir limits, MWh",
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-06-01T00:00:00Z"
],
"scenarios": [
[
4500,
4400
]
]
},
"min_energy_level": {
"#comment": "Manually adjusted lower reserveroir limits, MWh",
"timestamps": [
"2024-01-01T00:00:00Z"
],
"scenarios": [
[
0.5
]
]
},
"max_discharge_power": {
"#comment": "Manually adjusted upper production limits, MW",
"timestamps": [
"2024-01-01T00:00:00Z"
],
"scenarios": [
[
40
]
]
},
"min_discharge_power": {
"#comment": "Manually adjusted lower production limits, MW",
"timestamps": [
"2024-01-01T00:00:00Z"
],
"scenarios": [
[
0
]
]
},
"exogenous_endvalue": {
"timestamps": [
"2024-01-01T00:00:00Z",
"2024-02-06T00:00:00Z"
],
"scenarios": [
[
1,
1
],
[
2,
2
],
[
3,
3
],
[
4,
4
],
[
5,
5
],
[
6,
6
],
[
7,
7
],
[
8,
8
],
[
9,
9
],
[
10,
10
],
[
11,
11
],
[
12,
12
],
[
13,
13
],
[
14,
14
],
[
15,
15
],
[
16,
16
],
[
17,
17
],
[
18,
18
],
[
19,
19
],
[
20,
20
],
[
21,
21
],
[
22,
22
],
[
23,
23
],
[
24,
24
],
[
25,
25
],
[
26,
26
],
[
27,
27
],
[
28,
28
],
[
29,
29
],
[
30,
30
],
[
31,
31
],
[
32,
32
],
[
33,
33
],
[
34,
34
],
[
35,
35
],
[
36,
36
],
[
37,
37
],
[
38,
38
],
[
39,
39
],
[
40,
40
],
[
41,
41
],
[
42,
42
],
[
43,
43
],
[
44,
44
],
[
45,
45
],
[
46,
46
],
[
47,
47
],
[
48,
48
],
[
49,
49
],
[
50,
50
],
[
51,
51
]
]
}
}
],
"areas": [
{
"name": "numedal"
},
{
"name": "tev"
},
{
"name": "battery_area"
}
],
"connections": [
{
"from": "WIND_TEST_01",
"to": "tev"
},
{
"from": "Seasonal variation",
"to": "numedal"
},
{
"from": "Seasonal variation 2",
"to": "tev"
},
{
"from": "numedal",
"to": "numedal-tev"
},
{
"from": "numedal-tev",
"to": "tev"
},
{
"from": "VITTINGFOSS",
"to": "numedal"
},
{
"from": "VITTINGFOSS",
"to": "VITTINGFOSS_plant"
},
{
"from": "LABRO",
"to": "numedal"
},
{
"from": "LABRO",
"to": "LABRO_plant"
},
{
"from": "tev_enmag_aggregated",
"to": "tev"
},
{
"from": "numedal",
"to": "numedal-battery_area"
},
{
"from": "numedal-battery_area",
"to": "battery_area"
},
{
"from": "tev",
"to": "tev-battery_area"
},
{
"from": "tev-battery_area",
"to": "battery_area"
},
{
"from": "battery",
"to": "battery_area"
},
{
"from": "IMPORT",
"to": "tev"
},
{
"from": "Export",
"to": "tev"
}
],
"wind": [
{
"name": "WIND_TEST_01",
"capacity": {
"timestamps": [
"1981-01-01T00:00:00Z",
"1981-01-03T00:00:00Z"
],
"scenarios": [
[
0.1,
0.1
],
[
0.2,
0.2
],
[
0.3,
0.3
],
[
0.4,
0.4
],
[
0.5,
0.5
],
[
0.6,
0.6
],
[
0.7,
0.7
],
[
0.8,
0.8
]
]
}
}
]
}
}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.