gtopt::line_losses::AdaptiveSegmentsOpts struct

Options for compute_adaptive_loss_segments.

Defaults track the Python plexos2gtopt converter (see scripts/plexos2gtopt/parsers.py_apply_adaptive_loss_segments): 1 % worst-case error budget, floor of 2 segments (one segment is a degenerate single secant), ceiling of 6 (hard LP-cost cap so the rule never explodes K on extreme lines).

Public variables

int ceiling
double err_pct
int floor

Variable documentation

int gtopt::line_losses::AdaptiveSegmentsOpts::ceiling

Maximum K per lossy line. Acts as a hard LP-cost cap so the rule never spends >ceiling segments on an outlier line whose L_max would otherwise demand K≫6 under a tight budget.

double gtopt::line_losses::AdaptiveSegmentsOpts::err_pct

Worst-case PWL secant-error budget, as a fraction of the sum of per-line analytical peak losses Σ_i L_max,i with L_max,i = R_i · f_max,i². When the raw KKT solution lands inside [floor, ceiling] for every line, the realised total error satisfies Σ_i L_max,i / (4 K_i²) ≤ err_pct · Σ_i L_max,i. Set ≤ 0 to disable adaptive mode (every lossy line gets ceiling).

int gtopt::line_losses::AdaptiveSegmentsOpts::floor

Minimum K per lossy line. Floor=2 because a single secant reduces to a linear approximation, which collapses to linear loss mode and is handled elsewhere.