DCOPF#

API path: power_flow_relaxations.models.dcopf

class DCOPF(scenario, configuration, **kwargs)[source]#

Bases: NodalBaseModel

Linearized DC optimal power flow (DCOPF) relaxation on the nodal model scaffold.

This model keeps only active-power network physics with voltage-angle variables and branch susceptances. Reactive-power AC relations are omitted, yielding a fast linear approximation commonly used as a baseline.

Note: this is the relaxation-benchmark DCOPF variant (MOSEK-based), not the APEM market-clearing Gurobi DCOPF.

Initialize the DCOPF model and create bus-angle decision variables.

Parameters:
  • scenario – Unit-based scenario containing bids and transmission network.

  • configuration – Solver configuration passed to the base nodal model.

  • **kwargs – Optional arguments forwarded to NodalBaseModel.

Notes

Creates theta_vt with shape [n_nodes, n_periods], representing voltage phase angles used in linearized flow equations.

get_V_vt_values()[source]#

Reconstruct unit-magnitude complex voltage components from bus angles.

Returns:

Mapping (node, period) -> (V_d, V_q) where V_d = cos(theta) and V_q = sin(theta).

Return type:

dict[tuple[int, int], tuple[float, float]]

power_constraints()[source]#

Add DC branch-flow and thermal-limit constraints.

For each directed branch and period, enforce symmetric active-power flow limits and a linear DC flow relation between phase-angle differences and active power flow, with tolerance band p_vwt_line_tol.

reference_constraints()[source]#

Fix the slack/reference bus angle to zero across all periods.

This removes the rotational invariance of voltage angles and makes the linear system identifiable.