Module ml4opf.formulations.ed.violation
Class interface for EconomicDispatch constraints, objective, etc.
Classes
class EDViolation (data: dict, ptdf: torch.Tensor)
-
OPFViolation
for EconomicDispatchInitialize internal Module state, shared by both nn.Module and ScriptModule.
Ancestors
- OPFViolation
- torch.nn.modules.module.Module
- abc.ABC
Methods
def balance_residual(self,
pd: torch.Tensor,
pg: torch.Tensor,
dpb_surplus: torch.Tensor | None = None,
dpb_shortage: torch.Tensor | None = None,
clamp: bool = False) ‑> torch.Tensor-
Compute power balance residual.
def calc_violations(self,
pd: torch.Tensor,
pg: torch.Tensor,
reduction: str = 'mean',
clamp: bool = True) ‑> dict[str, torch.Tensor]-
Compute all EconomicDispatch violations.
def objective(self, pd: torch.Tensor, pg: torch.Tensor) ‑> torch.Tensor
-
Compute ED objective function.
def pf_bound_residual(self, pf: torch.Tensor, df: torch.Tensor | None = None, clamp: bool = False) ‑> torch.Tensor
-
Compute power flow bound residual.
def pf_from_pdpg(self, pd: torch.Tensor, pg: torch.Tensor, dense_incidence: bool = False) ‑> torch.Tensor
-
Compute power flow from power demand and power generation.
def pg_bound_residual(self, pg: torch.Tensor, clamp: bool = False) ‑> torch.Tensor
-
Compute power generation bound residual.
Inherited members