Skip to content

Commit dc4f0e9

Browse files
committed
Updates to CMake and code style.
1 parent 19ee3cc commit dc4f0e9

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

examples/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ if(TARGET SUNDIALS::idas)
6868
add_subdirectory(RLCircuit)
6969
add_subdirectory(Microgrid)
7070
add_subdirectory(ScaleMicrogrid)
71+
add_subdirectory(PhasorDynamics)
7172
if(GRIDKIT_ENABLE_IPOPT)
7273
add_subdirectory(DynamicConstrainedOpt)
7374
add_subdirectory(GenConstLoad)
@@ -79,5 +80,3 @@ endif()
7980
if(GRIDKIT_ENABLE_ENZYME)
8081
add_subdirectory(Enzyme)
8182
endif()
82-
83-
add_subdirectory(PhasorDynamics)

src/Model/PhasorDynamics/BusFault/BusFault.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ namespace GridKit
6464
{
6565
if (status_)
6666
{
67-
double B = -X_ / (X_ * X_ + R_ * R_);
68-
double G = R_ / (X_ * X_ + R_ * R_);
69-
Ir() += -Vr() * G + Vi() * B;
70-
Ii() += -Vr() * B - Vi() * G;
67+
double B = -X_ / (X_ * X_ + R_ * R_);
68+
double G = R_ / (X_ * X_ + R_ * R_);
69+
70+
Ir() += -Vr() * G + Vi() * B;
71+
Ii() += -Vr() * B - Vi() * G;
7172
}
7273
return 0;
7374
}

src/Model/PhasorDynamics/SynchronousMachine/GENROUwS/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,14 @@ then
9393
Sat(\psi'')=Sat(\vert V_{r}+jV_{i} \vert)
9494
```
9595

96-
It is important to point out that finding the initial value of $`\delta`$ for the model without saturation direct method can be used. In case when saturation is considered some "claver" math is needed. Key insight for determining initial $`\delta`$ is that the magnitude of the saturation depends upon the magnitude of $`\psi''`$, which is independent of $`\delta`$.
96+
It is important to point out that finding the initial value of $`\delta`$ for
97+
the model without saturation direct method can be used. In case when saturation
98+
is considered some "claver" math is needed. Key insight for determining initial
99+
$`\delta`$ is that the magnitude of the saturation depends upon the magnitude
100+
of $`\psi''`$, which is independent of $`\delta`$.
97101
```math
98-
\delta=tan^{-1}(\dfrac{K_{sat}V_{iterm}+K_{sat}R_{a}I_{i}+(K_{sat}X''_{d}+X_{q}-X''_{q})I_{r}}{K_{sat}V_{rterm}+K_{sat}R_{a}I_{r}-(K_{sat}X''_{d}+X_{q}-X''_{q})I_{i}})
102+
\delta=\tan^{-1}\left(\dfrac{K_{sat}V_{iterm}+K_{sat}R_{a}I_{i}+(K_{sat}X''_{d}+X_{q}-X''_{q})I_{r}}
103+
{K_{sat}V_{rterm}+K_{sat}R_{a}I_{r}-(K_{sat}X''_{d}+X_{q}-X''_{q})I_{i}} \right)
99104
```
100105
where
101106
```math

0 commit comments

Comments
 (0)