commonpower.models.powerflow.DCPowerFlowModel

class DCPowerFlowModel[source]

Bases: PowerFlowModel

Models DC power flow constraints. Based on https://www.mech.kuleuven.be/en/tme/research/energy_environment/Pdf/wpen2014-12.pdf.

Methods

add_to_model

Specifies the power flow constraints and adds them to the given model instance.

empty_copy

Creates a fresh copy of the power flow model.

_set_bus_constraint(model: ConcreteModel, nid: int, node: Bus, connected_lines: list[Line])[source]

Set DC bus constraints and voltage angle of first bus fixed at zero.

\[\begin{split}p_i = \sum_{j=1}^{N} ( B_{ij}(d_i - d_j) ) \\ d_0 = 0\end{split}\]
_set_line_constraint(model: ConcreteModel, lid: int, line: Line)[source]

Sets line flow constraints. Technically,we want a limit on the line current I_l. However, we will use the line power flow p_l (I~p/v in DCOPF).

\[p_l = B_l (d_{src} - d_{dst})\]

The system is then factually constrained by the bounds on I_l.

_set_sys_constraints(model: ConcreteModel, nodes: List[Bus], lines: List[Line]) None[source]
\[\begin{split}\sum_i p_i = 0 \\ \sum_i q_i = 0\end{split}\]