gtopt::ModelOptions struct

Power system model configuration for LP construction.

Groups all options that affect how the mathematical model is formulated: network topology, Kirchhoff constraints, line losses, scaling factors, penalty costs, and discount rate.

Used both as a global sub-object in Options (model_options) and as per-level overrides in CascadeLevel (model_options). When used in a cascade level, only set fields override the global; absent fields inherit from the global configuration.

Public functions

auto has_any() const -> bool noexcept
True if any field is set.
auto merge(const ModelOptions& opts) -> void

Public variables

OptReal demand_fail_cost
Penalty cost for unserved demand [$/MWh].
OptReal hydro_fail_cost
OptReal hydro_use_value
OptReal kirchhoff_threshold
Minimum bus voltage [kV] below which Kirchhoff is not applied.
OptName line_losses_mode
OptInt loss_segments
Number of piecewise-linear segments for quadratic line losses.
OptReal reserve_fail_cost
Penalty cost for unserved spinning-reserve [$/MWh].
OptReal scale_objective
Divisor for all objective coefficients (numerical stability).
OptReal scale_theta
Scaling factor for voltage-angle variables.
OptBool use_kirchhoff
Apply DC Kirchhoff voltage-law constraints.
OptBool use_line_losses deprecated
OptBool use_single_bus
Collapse the network to a single bus (copper-plate model).

Variable documentation

OptReal gtopt::ModelOptions::hydro_fail_cost

Default penalty cost for unmet hydro rights [$/m3]. Per-element fail_cost overrides this global default.

OptReal gtopt::ModelOptions::hydro_use_value

Default value (benefit) of exercising hydro rights [$/m3]. Per-element use_value overrides this global default.

OptName gtopt::ModelOptions::line_losses_mode

Line losses model selection. See LineLossesMode enum for values: "none", "linear", "piecewise", "bidirectional", "adaptive", "dynamic". When unset, defaults to "adaptive".

OptBool gtopt::ModelOptions::use_line_losses