commonpower.core.PowerFlowModel
- class PowerFlowModel[source]
Bases:
objectGeneric class to model power flow constraints.
Methods
Specifies the power flow constraints and adds them to the given model instance.
Creates a fresh copy of the power flow model.
- _set_bus_constraint(model: ConcreteModel, nid: int, node: Node, connected_lines: list[Line]) None[source]
Adds constraint for the given bus to the given model instance. Optional for subclasses.
- _set_line_constraint(model: ConcreteModel, lid: int, line: Line)[source]
Adds constraint for the given bus to the given model instance. Optional for subclasses.
- Parameters:
model (ConcreteModel) – Pyomo root model (sys).
lid (int) – Line index.
line (Line) – Line instance.
- _set_sys_constraints(model: ConcreteModel, nodes: List[Node], lines: List[Line]) None[source]
Adds system-wide constraint(s) to the given model instance. Optional for subclasses.
- add_to_model(model: ConcreteModel, nodes: List[Node], lines: List[Line]) None[source]
Specifies the power flow constraints and adds them to the given model instance. This method is called by system.add_to_model().
- empty_copy() PowerFlowModel[source]
Creates a fresh copy of the power flow model.
- Returns:
PowerFlowModel – Cloned power flow model instance.