Skip to content

Commit 35ce3d9

Browse files
remove voltage step without angles
1 parent 066f75e commit 35ce3d9

File tree

1 file changed

+5
-78
lines changed

1 file changed

+5
-78
lines changed

state-estimation-assignment/State Estimation Assignment.ipynb

Lines changed: 5 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"cells": [
33
{
4-
"attachments": {},
54
"cell_type": "markdown",
65
"id": "a727ce38",
76
"metadata": {},
@@ -28,7 +27,6 @@
2827
]
2928
},
3029
{
31-
"attachments": {},
3230
"cell_type": "markdown",
3331
"id": "9cd12445",
3432
"metadata": {},
@@ -70,7 +68,6 @@
7068
]
7169
},
7270
{
73-
"attachments": {},
7471
"cell_type": "markdown",
7572
"id": "50065790",
7673
"metadata": {},
@@ -145,7 +142,6 @@
145142
]
146143
},
147144
{
148-
"attachments": {},
149145
"cell_type": "markdown",
150146
"id": "0c2bad59",
151147
"metadata": {},
@@ -167,7 +163,6 @@
167163
]
168164
},
169165
{
170-
"attachments": {},
171166
"cell_type": "markdown",
172167
"id": "0234cab7",
173168
"metadata": {},
@@ -194,7 +189,6 @@
194189
]
195190
},
196191
{
197-
"attachments": {},
198192
"cell_type": "markdown",
199193
"id": "940d48be",
200194
"metadata": {},
@@ -218,7 +212,6 @@
218212
]
219213
},
220214
{
221-
"attachments": {},
222215
"cell_type": "markdown",
223216
"id": "2b013fa7",
224217
"metadata": {},
@@ -270,7 +263,6 @@
270263
]
271264
},
272265
{
273-
"attachments": {},
274266
"cell_type": "markdown",
275267
"id": "f4736cc1",
276268
"metadata": {},
@@ -286,7 +278,7 @@
286278
"- print the difference in `q_from` between `se_output_data` and `pf_output_data`\n",
287279
"- print the difference in `q_to` between `se_output_data` and `pf_output_data`\n",
288280
"\n",
289-
"You should see that while the voltages match quite precisely (in the order of microvolts), the *p* and *q* are way off (in the order of megawatts / mega VARs). This is as expected because we used voltage angles of 0.0."
281+
"You should see that both the voltages and the *p* and *q* match quite precisely."
290282
]
291283
},
292284
{
@@ -311,71 +303,11 @@
311303
]
312304
},
313305
{
314-
"attachments": {},
315-
"cell_type": "markdown",
316-
"id": "683bb610",
317-
"metadata": {},
318-
"source": [
319-
"# Assignment 5: Add voltage angle measurements\n",
320-
"\n",
321-
"Now we will update the model by adding voltage angles to the voltage sensors.\n",
322-
"We could alter the `input_data` and construct a new Model, but for the purpose of this workshop (and efficiency) we'll supply the voltage angles as `update_data`, which could potentially be a *batch* calculation in other usecases.\n",
323-
"\n",
324-
"- initialize an update voltage sensor array\n",
325-
"- create an update dataset\n",
326-
"- perform a state estimation, using the update dataset\n",
327-
"- compare the results (as in assignment 4)\n",
328-
"\n",
329-
"You should see that the voltages match quite precisely (in the order of microvolts), the *p* and *q* do too (in the order of 0.01 watts / VARs), because we used the exact voltage angles from the power flow calculation."
330-
]
331-
},
332-
{
333-
"cell_type": "code",
334-
"execution_count": null,
335-
"id": "8628b888",
336-
"metadata": {},
337-
"outputs": [],
338-
"source": [
339-
"# TODO: Initialize a voltage sensor update array for 3 sensors\n",
340-
"update_sym_voltage_sensor = initialize_array(..., ..., ...)\n",
341-
"update_sym_voltage_sensor[\"id\"] = ...\n",
342-
"update_sym_voltage_sensor[\"u_angle_measured\"] = ...\n",
343-
"\n",
344-
"# TODO: Create an update dataset \n",
345-
"update_data = {\n",
346-
" ...\n",
347-
"}\n",
348-
"\n",
349-
"# TODO: Validate the update data\n",
350-
"assert_valid_batch_data(..., ..., calculation_type=..., symmetric=...)\n",
351-
"\n",
352-
"# Run the (iterative linear) state estimation\n",
353-
"se_output_data_u_angle = model.calculate_state_estimation(\n",
354-
" update_data = update_data,\n",
355-
" symmetric=True,\n",
356-
" error_tolerance=1e-8, \n",
357-
" max_iterations=20, \n",
358-
" calculation_method=CalculationMethod.iterative_linear)\n",
359-
"\n",
360-
"# TODO: Print the delta u for all nodes (se_output_data_u_angle - pf_output_data)\n",
361-
"print(\"-------------- nodes --------------\")\n",
362-
"print(\"delta_u:\", ...)\n",
363-
"\n",
364-
"# TODO: Print the delta p and q for all lines (se_output_data_u_angle - pf_output_data)\n",
365-
"print(\"-------------- lines --------------\")\n",
366-
"print(\"delta_p_from:\", ...)\n",
367-
"print(\"delta_p_to:\", ...)\n",
368-
"print(\"delta_q_from:\", ...)\n",
369-
"print(\"delta_q_to:\", ...)"
370-
]
371-
},
372-
{
373-
"attachments": {},
374306
"cell_type": "markdown",
375307
"id": "7b054f55",
376308
"metadata": {},
377309
"source": [
378-
"# Assignment 6: Add power sensors to the model\n",
310+
"# Assignment 5: Add power sensors to the model\n",
379311
"\n",
380312
"In common power grids most voltage sensors only measure the voltage magnitude; not the angle. In this assigment we will again use the `input_data` of assignment 3 (with unknown voltage angles) and we will connect power sensors to the model.\n",
381313
"\n",
@@ -386,7 +318,7 @@
386318
"- Create a new input data set, including both voltage and power sensors\n",
387319
"- Use the print statements of assignment 4 to compare the results\n",
388320
"\n",
389-
"You should see that the voltages match quite precisely (in the order of microvolts), the *p* and *q* do too (in the order of watts / VARs)."
321+
"You should see that again the voltages match quite precisely (in the order of microvolts), the *p* and *q* do too (in the order of watts / VARs)."
390322
]
391323
},
392324
{
@@ -450,7 +382,6 @@
450382
]
451383
},
452384
{
453-
"attachments": {},
454385
"cell_type": "markdown",
455386
"id": "1afd00f1",
456387
"metadata": {},
@@ -490,12 +421,11 @@
490421
]
491422
},
492423
{
493-
"attachments": {},
494424
"cell_type": "markdown",
495425
"id": "4e48d946",
496426
"metadata": {},
497427
"source": [
498-
"# Assignment 7: Time Series Batch Calculation\n",
428+
"# Assignment 6: Time Series Batch Calculation\n",
499429
"\n",
500430
"Sometimes, it is desirable to see what the state of the power grid was for a number of measurements at different points in time. A typical use case is to see if the voltage or power requirements were not met over the past day.\n",
501431
"\n",
@@ -522,7 +452,6 @@
522452
]
523453
},
524454
{
525-
"attachments": {},
526455
"cell_type": "markdown",
527456
"id": "4720b175",
528457
"metadata": {},
@@ -580,7 +509,6 @@
580509
]
581510
},
582511
{
583-
"attachments": {},
584512
"cell_type": "markdown",
585513
"id": "fb3bf501",
586514
"metadata": {},
@@ -611,7 +539,6 @@
611539
]
612540
},
613541
{
614-
"attachments": {},
615542
"cell_type": "markdown",
616543
"id": "27e42d99",
617544
"metadata": {},
@@ -660,7 +587,7 @@
660587
"name": "python",
661588
"nbconvert_exporter": "python",
662589
"pygments_lexer": "ipython3",
663-
"version": "3.11.2"
590+
"version": "3.11.5"
664591
}
665592
},
666593
"nbformat": 4,

0 commit comments

Comments
 (0)