Skip to content

Commit 419be8d

Browse files
committed
Updates to CMake and code style.
1 parent 1205fe5 commit 419be8d

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
@@ -13,6 +13,7 @@ if(TARGET SUNDIALS::idas)
1313
add_subdirectory(RLCircuit)
1414
add_subdirectory(Microgrid)
1515
add_subdirectory(ScaleMicrogrid)
16+
add_subdirectory(PhasorDynamics)
1617
if(GRIDKIT_ENABLE_IPOPT)
1718
add_subdirectory(DynamicConstrainedOpt)
1819
add_subdirectory(GenConstLoad)
@@ -24,5 +25,3 @@ endif()
2425
if(GRIDKIT_ENABLE_ENZYME)
2526
add_subdirectory(Enzyme)
2627
endif()
27-
28-
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)