|
1 | 1 | { |
2 | 2 | "cells": [ |
3 | 3 | { |
4 | | - "attachments": {}, |
5 | 4 | "cell_type": "markdown", |
6 | 5 | "id": "a727ce38", |
7 | 6 | "metadata": {}, |
|
28 | 27 | ] |
29 | 28 | }, |
30 | 29 | { |
31 | | - "attachments": {}, |
32 | 30 | "cell_type": "markdown", |
33 | 31 | "id": "9cd12445", |
34 | 32 | "metadata": {}, |
|
70 | 68 | ] |
71 | 69 | }, |
72 | 70 | { |
73 | | - "attachments": {}, |
74 | 71 | "cell_type": "markdown", |
75 | 72 | "id": "50065790", |
76 | 73 | "metadata": {}, |
|
145 | 142 | ] |
146 | 143 | }, |
147 | 144 | { |
148 | | - "attachments": {}, |
149 | 145 | "cell_type": "markdown", |
150 | 146 | "id": "0c2bad59", |
151 | 147 | "metadata": {}, |
|
167 | 163 | ] |
168 | 164 | }, |
169 | 165 | { |
170 | | - "attachments": {}, |
171 | 166 | "cell_type": "markdown", |
172 | 167 | "id": "0234cab7", |
173 | 168 | "metadata": {}, |
|
194 | 189 | ] |
195 | 190 | }, |
196 | 191 | { |
197 | | - "attachments": {}, |
198 | 192 | "cell_type": "markdown", |
199 | 193 | "id": "940d48be", |
200 | 194 | "metadata": {}, |
|
218 | 212 | ] |
219 | 213 | }, |
220 | 214 | { |
221 | | - "attachments": {}, |
222 | 215 | "cell_type": "markdown", |
223 | 216 | "id": "2b013fa7", |
224 | 217 | "metadata": {}, |
|
270 | 263 | ] |
271 | 264 | }, |
272 | 265 | { |
273 | | - "attachments": {}, |
274 | 266 | "cell_type": "markdown", |
275 | 267 | "id": "f4736cc1", |
276 | 268 | "metadata": {}, |
|
286 | 278 | "- print the difference in `q_from` between `se_output_data` and `pf_output_data`\n", |
287 | 279 | "- print the difference in `q_to` between `se_output_data` and `pf_output_data`\n", |
288 | 280 | "\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." |
290 | 282 | ] |
291 | 283 | }, |
292 | 284 | { |
|
311 | 303 | ] |
312 | 304 | }, |
313 | 305 | { |
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": {}, |
374 | 306 | "cell_type": "markdown", |
375 | 307 | "id": "7b054f55", |
376 | 308 | "metadata": {}, |
377 | 309 | "source": [ |
378 | | - "# Assignment 6: Add power sensors to the model\n", |
| 310 | + "# Assignment 5: Add power sensors to the model\n", |
379 | 311 | "\n", |
380 | 312 | "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", |
381 | 313 | "\n", |
|
386 | 318 | "- Create a new input data set, including both voltage and power sensors\n", |
387 | 319 | "- Use the print statements of assignment 4 to compare the results\n", |
388 | 320 | "\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)." |
390 | 322 | ] |
391 | 323 | }, |
392 | 324 | { |
|
450 | 382 | ] |
451 | 383 | }, |
452 | 384 | { |
453 | | - "attachments": {}, |
454 | 385 | "cell_type": "markdown", |
455 | 386 | "id": "1afd00f1", |
456 | 387 | "metadata": {}, |
|
490 | 421 | ] |
491 | 422 | }, |
492 | 423 | { |
493 | | - "attachments": {}, |
494 | 424 | "cell_type": "markdown", |
495 | 425 | "id": "4e48d946", |
496 | 426 | "metadata": {}, |
497 | 427 | "source": [ |
498 | | - "# Assignment 7: Time Series Batch Calculation\n", |
| 428 | + "# Assignment 6: Time Series Batch Calculation\n", |
499 | 429 | "\n", |
500 | 430 | "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", |
501 | 431 | "\n", |
|
522 | 452 | ] |
523 | 453 | }, |
524 | 454 | { |
525 | | - "attachments": {}, |
526 | 455 | "cell_type": "markdown", |
527 | 456 | "id": "4720b175", |
528 | 457 | "metadata": {}, |
|
580 | 509 | ] |
581 | 510 | }, |
582 | 511 | { |
583 | | - "attachments": {}, |
584 | 512 | "cell_type": "markdown", |
585 | 513 | "id": "fb3bf501", |
586 | 514 | "metadata": {}, |
|
611 | 539 | ] |
612 | 540 | }, |
613 | 541 | { |
614 | | - "attachments": {}, |
615 | 542 | "cell_type": "markdown", |
616 | 543 | "id": "27e42d99", |
617 | 544 | "metadata": {}, |
|
660 | 587 | "name": "python", |
661 | 588 | "nbconvert_exporter": "python", |
662 | 589 | "pygments_lexer": "ipython3", |
663 | | - "version": "3.11.2" |
| 590 | + "version": "3.11.5" |
664 | 591 | } |
665 | 592 | }, |
666 | 593 | "nbformat": 4, |
|
0 commit comments