gtopt/line_losses.hpp file

Modular transmission line losses engine.

Provides a pluggable loss-model dispatch for transmission lines. Each LineLossesMode has its own implementation function that adds the appropriate variables and constraints to the LP.

Supported modes

ModeExtra rows/blockExtra cols/block
none01 (bidirectional flow)
linear01–2 (flow per dir)
piecewise2K+3 (segs + loss + fp + fn)
bidirectional42(K+2) (per-dir segs)

| adaptive | resolved at config time to piecewise or bidirectional | | dynamic | placeholder → piecewise |

Mathematical background

Quadratic loss: P_loss = R · f² / V² [MW], with R [Ω], f [MW], V [kV].

Piecewise-linear approximation with K segments over [0, f_max]:

  • Segment width: w = f_max / K
  • Segment k (1-based) loss coefficient: loss_k = w · R · (2k−1) / V²
  • Total: loss = Σ_k loss_k · seg_k, with Σ_k seg_k = |f|

References:

  • [1] Macedo, Vallejos, Fernández, "A Dynamic Piecewise Linear Model for DC Transmission Losses in Optimal Scheduling Problems", IEEE Trans. Power Syst., vol. 26, no. 1, pp. 508–516, 2011.
  • [2] Wood & Wollenberg, "Power Generation, Operation and Control", 3rd ed., Wiley, Ch. 13 (incremental transmission losses).
  • [3] FERC Staff Paper, "Optimal Power Flow Paper 2: Linearization", December 2012.

Namespaces

namespace gtopt
namespace gtopt::line_losses

Classes

struct gtopt::line_losses::BlockResult
LP indices produced by add_block() for one block.
struct gtopt::line_losses::LossConfig
Resolved loss parameters for LP construction.