Module ml4opf.layers.slackbus_repair
Classes
class SlackBusRepair (slackbus_idx: int)-
Repair voltage angles by setting the slack bus angle to zero.
Initialize SlackBusRepair module.
Args
slackbus_idx:int- Index of slack bus.
Ancestors
- torch.nn.modules.module.Module
Static methods
def repair(va: torch.Tensor, slackbus_idx: int) ‑> torch.Tensor-
Repair voltage angles by setting the slack bus angle to zero.
\text{va}_i = \text{va}_i - \text{va}_\text{slack}
Args
va:Tensor- Voltage angles. (batch_size, nbus)
slackbus_idx:int- Index of slack bus.
Returns
Tensor- Repaired voltage angles. (batch_size, nbus)
Methods
def forward(self, va: torch.Tensor) ‑> torch.Tensor-
Repair voltage angles by setting the slack bus angle to zero.
\text{va}_i = \text{va}_i - \text{va}_\text{slack}
Args
va:Tensor- Voltage angles. (batch_size, nbus)
Returns
Tensor- Repaired voltage angles. (batch_size, nbus)