Market Calibration Areas

Market calibration areas (samkjøringsområder) is used to group busbars into greater areas.

Motivating example:

        flowchart LR
    subgraph MarketArea1
        numedal("Numedal")
    end
    subgraph MarketArea2
        otta("Otta")
    end

    numedal -. "⚡dc⚡" .- otta
    

Numedal belongs to area MarketArea1. Otta belongs to MarketArea2.

Numedal and Otta are connected with a DC-line.

This JSON example represents the above model, where certain non-relevant, but required parts are cut for clarity:

 1{
 2    "model": {
 3        "market_calibration_areas": [
 4            {
 5                "name": "market_area_1"
 6            },
 7            {
 8                "name": "market_area_2"
 9            }
10        ],
11        "busbars": [
12            {
13                "name": "numedal"
14            },
15            {
16                "name": "otta"
17            }
18        ],
19        "dclines": [
20            {
21                "name": "DC_A"
22            }
23        ],
24        "connections": [
25            {
26                "from": "numedal",
27                "to": "DC_A"
28            },
29            {
30                "from": "DC_A",
31                "to": "otta"
32            },
33            {
34                "from": "numedal",
35                "to": "market_area_1"
36            },
37            {
38                "from": "otta",
39                "to": "market_area_2"
40            }
41        ]
42    }
43}

Multiple busbars:

To expand on the example above, to have multiple busbars per area, connect the busbar object to the market calibration area.

        flowchart LR
    subgraph MarketArea1
        numedal("Numedal")
        rjukan("Rjukan")
        ustaoset("Ustaoset")
    end
    subgraph MarketArea2
        otta("Otta")
        nordherad("Nordherad")
        litldalen("Litldalen")
    end

    numedal -. "⚡dc1⚡" .- otta
    rjukan -. "⚡" .- numedal
    ustaoset -. "⚡" .- numedal

    nordherad -. "⚡" .- otta
    litldalen -. "⚡" .- otta
    

Full JSON source listing:

Expand to see full JSON listing with 2 market calibration areas and 6 busbars.
  1{
  2    "$schema": "https://gitlab.sintef.no/energy/ltm/pyltmapi/-/raw/main/model.schema.json",
  3    "model": {
  4        "global_settings": {
  5            "name": "global_settings",
  6            "output_path": "testout_market_calibration_areas/",
  7            "calc_water_value_flag": {
  8                "timestamps": [
  9                    "2024-01-01T00:00:00Z",
 10                    "2026-12-28T00:00:00Z"
 11                ],
 12                "scenarios": [
 13                    [
 14                        1,
 15                        0
 16                    ]
 17                ]
 18            },
 19            "historical_period": {
 20                "timestamps": [
 21                    "2000-01-01T00:00:00Z",
 22                    "2002-01-01T00:00:00Z"
 23                ],
 24                "scenarios": [
 25                    [
 26                        1,
 27                        0
 28                    ]
 29                ]
 30            },
 31            "simulation_price_period": {
 32                "#comment": "prisavsnitt -> PRISREKKE.DATA",
 33                "timestamps": [
 34                    "2024-01-01T00:00:00Z",
 35                    "2024-01-02T00:00:00Z",
 36                    "2024-01-03T00:00:00Z",
 37                    "2024-01-04T00:00:00Z",
 38                    "2024-01-05T00:00:00Z"
 39                ],
 40                "scenarios": [
 41                    [
 42                        1,
 43                        2,
 44                        3,
 45                        4,
 46                        5
 47                    ]
 48                ]
 49            }
 50        },
 51        "market_calibration_areas": [
 52            {
 53                "name": "market_area_1"
 54            },
 55            {
 56                "name": "market_area_2"
 57            }
 58        ],
 59        "busbars": [
 60            {
 61                "name": "numedal"
 62            },
 63            {
 64                "name": "rjukan"
 65            },
 66            {
 67                "name": "ustaoset"
 68            },
 69            {
 70                "name": "otta"
 71            },
 72            {
 73                "name": "nordherad"
 74            },
 75            {
 76                "name": "litldalen"
 77            }
 78        ],
 79        "dclines": [
 80            {
 81                "name": "DC_A",
 82                "forward_capacity": {
 83                    "timestamps": [
 84                        "2024-01-01T00:00:00Z"
 85                    ],
 86                    "scenarios": [
 87                        [
 88                            50
 89                        ]
 90                    ]
 91                },
 92                "backward_capacity": {
 93                    "timestamps": [
 94                        "2024-01-01T00:00:00Z"
 95                    ],
 96                    "scenarios": [
 97                        [
 98                            50
 99                        ]
100                    ]
101                },
102                "loss_percentage": 1.0,
103                "forward_cost": 2.0,
104                "backward_cost": 3.0
105            },
106            {
107                "name": "RJU_NUM",
108                "forward_capacity": {
109                    "timestamps": [
110                        "2024-01-01T00:00:00Z"
111                    ],
112                    "scenarios": [
113                        [
114                            50
115                        ]
116                    ]
117                },
118                "backward_capacity": {
119                    "timestamps": [
120                        "2024-01-01T00:00:00Z"
121                    ],
122                    "scenarios": [
123                        [
124                            50
125                        ]
126                    ]
127                },
128                "loss_percentage": 1.0,
129                "forward_cost": 2.0,
130                "backward_cost": 3.0
131            },
132            {
133                "name": "UST_NUM",
134                "forward_capacity": {
135                    "timestamps": [
136                        "2024-01-01T00:00:00Z"
137                    ],
138                    "scenarios": [
139                        [
140                            50
141                        ]
142                    ]
143                },
144                "backward_capacity": {
145                    "timestamps": [
146                        "2024-01-01T00:00:00Z"
147                    ],
148                    "scenarios": [
149                        [
150                            50
151                        ]
152                    ]
153                },
154                "loss_percentage": 1.0,
155                "forward_cost": 2.0,
156                "backward_cost": 3.0
157            },
158            {
159                "name": "NOR_OTT",
160                "forward_capacity": {
161                    "timestamps": [
162                        "2024-01-01T00:00:00Z"
163                    ],
164                    "scenarios": [
165                        [
166                            50
167                        ]
168                    ]
169                },
170                "backward_capacity": {
171                    "timestamps": [
172                        "2024-01-01T00:00:00Z"
173                    ],
174                    "scenarios": [
175                        [
176                            50
177                        ]
178                    ]
179                },
180                "loss_percentage": 1.0,
181                "forward_cost": 2.0,
182                "backward_cost": 3.0
183            },
184            {
185                "name": "LIT_OTT",
186                "forward_capacity": {
187                    "timestamps": [
188                        "2024-01-01T00:00:00Z"
189                    ],
190                    "scenarios": [
191                        [
192                            50
193                        ]
194                    ]
195                },
196                "backward_capacity": {
197                    "timestamps": [
198                        "2024-01-01T00:00:00Z"
199                    ],
200                    "scenarios": [
201                        [
202                            50
203                        ]
204                    ]
205                },
206                "loss_percentage": 1.0,
207                "forward_cost": 2.0,
208                "backward_cost": 3.0
209            }
210        ],
211        "connections": [
212            {
213                "from": "numedal",
214                "to": "market_area_1"
215            },
216            {
217                "from": "rjukan",
218                "to": "market_area_1"
219            },
220            {
221                "from": "ustaoset",
222                "to": "market_area_1"
223            },
224            {
225                "from": "otta",
226                "to": "market_area_2"
227            },
228            {
229                "from": "nordherad",
230                "to": "market_area_2"
231            },
232            {
233                "from": "litldalen",
234                "to": "market_area_2"
235            },
236            {
237                "from": "numedal",
238                "to": "DC_A"
239            },
240            {
241                "from": "DC_A",
242                "to": "otta"
243            },
244            {
245                "from": "rjukan",
246                "to": "RJU_NUM"
247            },
248            {
249                "from": "RJU_NUM",
250                "to": "numedal"
251            },
252            {
253                "from": "ustaoset",
254                "to": "UST_NUM"
255            },
256            {
257                "from": "UST_NUM",
258                "to": "numedal"
259            },
260            {
261                "from": "nordherad",
262                "to": "NOR_OTT"
263            },
264            {
265                "from": "NOR_OTT",
266                "to": "otta"
267            },
268            {
269                "from": "litldalen",
270                "to": "LIT_OTT"
271            },
272            {
273                "from": "LIT_OTT",
274                "to": "otta"
275            }
276        ]
277    }
278}

Example code:

 1import os
 2
 3from pyltmapi import LtmSession
 4
 5with LtmSession("market_calibration_areas_session") as session:
 6    session.load(filename="market_calibration_areas.json")
 7    session.write_model()
 8
 9
10
11from pyltmapi import LtmSession
12
13with LtmSession("simulation") as session:
14    lake_mead = session.model.add("busbar", "lake_mead")
15    dam = session.model.add("reservoir", "hoover_dam")
16    plant = session.model.add("plant", "power_plant")
17    river = session.model.add("reservoir", "colorado_river")
18
19    session.connect(lake_mead, dam)
20    session.connect(dam, plant)
21    session.connect(plant, river)
22
23    session.write_model()
24    _, results = session.execute_model()