You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -8,6 +8,12 @@ This script can be dowloaded as a normal Julia script [here](@__NAME__.jl). #md
8
8
9
9
> [1] Schäfer, B., Witthaut, D., Timme, M., & Latora, V. (2018). Dynamically induced cascading failures in power grids. Nature communications, 9(1), 1-13. https://www.nature.com/articles/s41467-018-04287-5
10
10
11
+
This example has three subchaperts:
12
+
- first we [define the network model](#define-the-model),
13
+
- secondly, we implement [component based callbacks](#component-based-callbacks) and
14
+
- thirdly we solve the problem using [systemwide callbacks](#system-wide-callbacks).
15
+
16
+
11
17
The system is modeled using swing equation and active power edges. The nodes are
12
18
characterized by the voltage angle `δ`, the active power on each line is symmetric
13
19
and a function of the difference between source and destination angle `δ_src - δ_dst`.
@@ -22,6 +28,8 @@ using Test #hide
22
28
import SymbolicIndexingInterface as SII
23
29
24
30
#=
31
+
## Defining the Model
32
+
25
33
For the nodes we define the swing equation. State `v[1] = δ`, `v[2] = ω`.
26
34
The swing equation has three parameters: `p = (P_ref, I, γ)` where `P_ref`
27
35
is the power setpopint, `I` is the inertia and `γ` is the droop or damping coeficcient.
@@ -58,25 +66,102 @@ g = SimpleGraph([0 1 1 0 1;
58
66
11010;
59
67
01101;
60
68
10010])
61
-
swing_network=Network(g, vertex, edge)
69
+
nw=Network(g, vertex, edge; dealias=true)
62
70
63
71
#=
64
-
For the parameters, we create the `NWParameter` object prefilled with default p values
72
+
Note that we used `dealias=true` to automaticially generate separate
73
+
`ComponentModels` for each vertex/edge. Doing so allows us to later
74
+
set different metadata (callbacks, default values, etc.) for each vertex/edge.
75
+
76
+
We proceed by setting the default reference power for the nodes:
0 commit comments