Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
build/
*.swp
doxygen-docs/
docs/_build/
docs/api/reference/
docs/xml/
__pycache__
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2

build:
os: ubuntu-24.04
tools:
python: "3.12"
apt_packages:
- doxygen
jobs:
pre_build:
- rm -rf docs/xml && cd docs && doxygen Doxyfile

sphinx:
configuration: docs/conf.py

python:
install:
- requirements: docs/requirements.txt
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Added 3, 10, 37, and 39 bus test cases.
- Updated documentation.
- Added support for Read the Docs
- Added JSON parsing.
- Automatic differentiation with enzyme (w.r.t. internal and external variables).
- Added PR and issue templates.
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ required.

Doxygen supports Markdown markup and it should be used to make documentation
more clear. For example,
```c++
```text
* @return The size of `a`
```
is clearer than
```c++
```text
* @return The size of a
```
when read in plain text and in formatted documentation.
Expand Down
30 changes: 15 additions & 15 deletions GridKit/CommonMath.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CommonMath

Smooth, autodiff-friendly replacements for piecewise functions used across GridKit component models. See [CommonMath.hpp](CommonMath.hpp) for implementation details.
Smooth, autodiff-friendly replacements for piecewise functions used across GridKit component models. See `CommonMath.hpp` for implementation details.

## Primitives

Expand Down Expand Up @@ -28,7 +28,7 @@ The sigmoid is also known as the logistic function. The equivalent `tanh` form i
\end{aligned}
```

<div align="center"><img src="../docs/Figures/CommonMath/sigmoid.svg" width="250"></div>
![](../docs/Figures/CommonMath/sigmoid.svg)

### $\rho$ - `ramp`

Expand All @@ -42,7 +42,7 @@ The sigmoid is also known as the logistic function. The equivalent `tanh` form i
\end{aligned}
```

<div align="center"><img src="../docs/Figures/CommonMath/ramp.svg" width="250"></div>
![](../docs/Figures/CommonMath/ramp.svg)

### $q$ - `qramp`

Expand All @@ -52,7 +52,7 @@ The sigmoid is also known as the logistic function. The equivalent `tanh` form i
q(x)=x^2\,\sigma(x)
```

<div align="center"><img src="../docs/Figures/CommonMath/qramp.svg" width="250"></div>
![](../docs/Figures/CommonMath/qramp.svg)

## Derived Functions

Expand Down Expand Up @@ -85,7 +85,7 @@ q(x)=x^2\,\sigma(x)
\end{aligned}
```

<div align="center"><img src="../docs/Figures/CommonMath/max.svg" width="250"></div>
![](../docs/Figures/CommonMath/max.svg)

### `min`

Expand All @@ -101,7 +101,7 @@ q(x)=x^2\,\sigma(x)
\end{aligned}
```

<div align="center"><img src="../docs/Figures/CommonMath/min.svg" width="250"></div>
![](../docs/Figures/CommonMath/min.svg)

### `clamp`

Expand All @@ -118,7 +118,7 @@ q(x)=x^2\,\sigma(x)
\end{aligned}
```

<div align="center"><img src="../docs/Figures/CommonMath/clamp.svg" width="250"></div>
![](../docs/Figures/CommonMath/clamp.svg)

### `deadband1`

Expand All @@ -135,7 +135,7 @@ q(x)=x^2\,\sigma(x)
\end{aligned}
```

<div align="center"><img src="../docs/Figures/CommonMath/deadband1.svg" width="250"></div>
![](../docs/Figures/CommonMath/deadband1.svg)

### `deadband2`

Expand All @@ -152,7 +152,7 @@ q(x)=x^2\,\sigma(x)
\end{aligned}
```

<div align="center"><img src="../docs/Figures/CommonMath/deadband2.svg" width="250"></div>
![](../docs/Figures/CommonMath/deadband2.svg)

### `slew`

Expand All @@ -169,7 +169,7 @@ q(x)=x^2\,\sigma(x)
\end{aligned}
```

<div align="center"><img src="../docs/Figures/CommonMath/slew.svg" width="250"></div>
![](../docs/Figures/CommonMath/slew.svg)

### `linseg`

Expand All @@ -186,7 +186,7 @@ q(x)=x^2\,\sigma(x)
\end{aligned}
```

<div align="center"><img src="../docs/Figures/CommonMath/linseg.svg" width="250"></div>
![](../docs/Figures/CommonMath/linseg.svg)

### `above`

Expand All @@ -202,7 +202,7 @@ q(x)=x^2\,\sigma(x)
\end{aligned}
```

<div align="center"><img src="../docs/Figures/CommonMath/above.svg" width="250"></div>
![](../docs/Figures/CommonMath/above.svg)

### `below`

Expand All @@ -218,7 +218,7 @@ q(x)=x^2\,\sigma(x)
\end{aligned}
```

<div align="center"><img src="../docs/Figures/CommonMath/below.svg" width="250"></div>
![](../docs/Figures/CommonMath/below.svg)

### `inside`

Expand All @@ -234,7 +234,7 @@ q(x)=x^2\,\sigma(x)
\end{aligned}
```

<div align="center"><img src="../docs/Figures/CommonMath/inside.svg" width="250"></div>
![](../docs/Figures/CommonMath/inside.svg)

### `outside`

Expand All @@ -250,7 +250,7 @@ q(x)=x^2\,\sigma(x)
\end{aligned}
```

<div align="center"><img src="../docs/Figures/CommonMath/outside.svg" width="250"></div>
![](../docs/Figures/CommonMath/outside.svg)

### `antiwindup`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ Series current $\mathbf{i}$ is directed from bus 1 to bus 2. Bus residual
current injections are positive into buses. All electrical parameter matrices
are $3 \times 3$ and capture self and mutual coupling between phases.

<div align="center">
<img align="center" src="../../../../../../docs/Figures/EMT/lumped_constant_diagram.svg">
![](../../../../../../docs/Figures/EMT/lumped_constant_diagram.svg)

Figure 1: Lumped constant EMT branch model
</div>
Figure 1: Lumped constant EMT branch model

## Model Parameters

Expand Down
6 changes: 2 additions & 4 deletions GridKit/Model/PhasorDynamics/Branch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ An ideal complex tap is placed on the bus-1 side of the branch equivalent. The
ordinary transmission-line $\pi$ model is recovered with $\tau = 1$ and
$\theta = 0$.

<div align="center">
<img align="center" src="../../../../docs/Figures/transformer-branch.png">
![](../../../../docs/Figures/transformer-branch.png)

Figure 1: Branch equivalent circuit
</div>
Figure 1: Branch equivalent circuit

## Model Parameters

Expand Down
11 changes: 3 additions & 8 deletions GridKit/Model/PhasorDynamics/Bus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,11 @@ numerical integrator requests residual evaluation.
Current entering the bus has positive and current exiting the bus negative
sign.

<div align="center">
<img align="center" src="../../../../docs/Figures/bus_variables.jpg">

Figure 1: Needs to be changed to represent current balance instead of power
balance.
</div>


![](../../../../docs/Figures/bus_variables.jpg)

Figure 1: Needs to be changed to represent current balance instead of power

balance.
**Other Parameters**
Buses are uniquely defined by their ID (number or name). Besides, each bus
should have associated Nominal Voltage value.
6 changes: 3 additions & 3 deletions GridKit/Model/PhasorDynamics/BusToSignalAdapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
This component enables signals to send and receive bus variables. It has five
ports:

#### Bus port
## Bus Port
- `bus` for the bus whose variables are managed by the adapter

#### Input ports
## Input Ports
- `ir` ($I_r$)
- `ii` ($I_i$)

External current injections are read from input signal nodes added to currents
on the bus.

#### Output ports
## Output Ports
- `vr` ($V_r$)
- `vi` ($V_i$)

Expand Down
8 changes: 3 additions & 5 deletions GridKit/Model/PhasorDynamics/Converter/REECA/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ Notes:

Standard REECA block diagram.

<div align="center">
<img align="center" src="../../../../../docs/Figures/PhasorDynamics_REECA_Diagram.png">
![](../../../../../docs/Figures/PhasorDynamics_REECA_Diagram.png)

Figure 1: REECA block diagram. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)
</div>
Figure 1: REECA block diagram. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)

## Model Parameters

Expand Down Expand Up @@ -251,7 +249,7 @@ The state-equation residuals use compact limiter notation where applicable. The
\end{aligned}
```

CommonMath defines the [Anti-Windup](../../../../CommonMath.md#anti-windup-indicator) target and smooth approximation.
CommonMath defines the [Anti-Windup](../../../../CommonMath.md#antiwindup) target and smooth approximation.

### Algebraic Equations

Expand Down
6 changes: 2 additions & 4 deletions GridKit/Model/PhasorDynamics/Converter/REGCA/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ Notes:

Standard REGCA converter-interface model.

<div align="center">
<img align="center" src="../../../../../docs/Figures/PhasorDynamics_REGCA_Diagram.png">
![](../../../../../docs/Figures/PhasorDynamics_REGCA_Diagram.png)

Figure 1: Generator/Converter REGCA model. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)
</div>
Figure 1: Generator/Converter REGCA model. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)

## Model Parameters

Expand Down
6 changes: 2 additions & 4 deletions GridKit/Model/PhasorDynamics/Converter/REGCB/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ the REGCB source standard before implementation.

Standard model diagram for the REGCB converter interface.

<div align="center">
<img align="center" src="../../../../../docs/Figures/PhasorDynamics_REGCB_Diagram.png">
![](../../../../../docs/Figures/PhasorDynamics_REGCB_Diagram.png)

Figure 1: Generator/Converter REGCB model. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)
</div>
Figure 1: Generator/Converter REGCB model. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)

Detailed REGCB parameters, variables, equations, initialization details, and
outputs will be added after validation against the REGCB source standard.
Expand Down
6 changes: 2 additions & 4 deletions GridKit/Model/PhasorDynamics/Exciter/ESAC6A/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ Notes:

Standard model of the ESAC6A Exciter.

<div align="center">
<img align="center" src="../../../../../docs/Figures/PhasorDynamics/ESAC6A_diagram.png">
![](../../../../../docs/Figures/PhasorDynamics/ESAC6A_diagram.png)

Figure 1: Exciter ESAC6A model. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)
</div>
Figure 1: Exciter ESAC6A model. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)

## Model Parameters

Expand Down
8 changes: 3 additions & 5 deletions GridKit/Model/PhasorDynamics/Exciter/ESDC2A/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ Notes:

Standard model of the ESDC2A Exciter.

<div align="center">
<img align="center" src="../../../../../docs/Figures/PhasorDynamics/ESDC2A_diagram.png">
![](../../../../../docs/Figures/PhasorDynamics/ESDC2A_diagram.png)

Figure 1: Exciter ESDC2A model. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)
</div>
Figure 1: Exciter ESDC2A model. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)

## Model Parameters

Expand Down Expand Up @@ -167,7 +165,7 @@ $\omega$ | [p.u.] | Machine speed deviation
\end{aligned}
```

CommonMath defines the [Anti-Windup](../../../../CommonMath.md#anti-windup-indicator)
CommonMath defines the [Anti-Windup](../../../../CommonMath.md#antiwindup)
target and smooth approximation.

### Algebraic Equations
Expand Down
8 changes: 3 additions & 5 deletions GridKit/Model/PhasorDynamics/Exciter/ESST4B/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ Notes:

Standard model of the ESST4B Exciter.

<div align="center">
<img align="center" src="../../../../../docs/Figures/PhasorDynamics/ESST4B_diagram.png">
![](../../../../../docs/Figures/PhasorDynamics/ESST4B_diagram.png)

Figure 1: Exciter ESST4B model. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)
</div>
Figure 1: Exciter ESST4B model. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)

## Model Parameters

Expand Down Expand Up @@ -151,7 +149,7 @@ $I_{\mathrm{fd}}$ | [p.u.] | Machine field current
\end{aligned}
```

CommonMath defines the [Anti-Windup](../../../../CommonMath.md#anti-windup-indicator)
CommonMath defines the [Anti-Windup](../../../../CommonMath.md#antiwindup)
target and smooth approximation.

### Algebraic Equations
Expand Down
8 changes: 3 additions & 5 deletions GridKit/Model/PhasorDynamics/Exciter/EXAC1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ Notes:

Standard model of the EXAC1 Exciter.

<div align="center">
<img align="center" src="../../../../../docs/Figures/PhasorDynamics/EXAC1_diagram.png">
![](../../../../../docs/Figures/PhasorDynamics/EXAC1_diagram.png)

Figure 1: Exciter EXAC1 model. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)
</div>
Figure 1: Exciter EXAC1 model. Figure courtesy of [PowerWorld](https://www.powerworld.com/WebHelp/)

## Model Parameters

Expand Down Expand Up @@ -153,7 +151,7 @@ $\omega$ | [p.u.] | Machine speed deviation
\end{aligned}
```

CommonMath defines the [Anti-Windup](../../../../CommonMath.md#anti-windup-indicator)
CommonMath defines the [Anti-Windup](../../../../CommonMath.md#antiwindup)
target and smooth approximation.

### Algebraic Equations
Expand Down
Loading
Loading