gtopt::StorageOptions struct

Options controlling storage LP behaviour for a single add_to_lp call.

Public variables

bool daily_cycle
double energy_scale
double flow_scale
bool skip_state_link
bool use_state_variable

Variable documentation

bool gtopt::StorageOptions::daily_cycle

PLP daily-cycle mode: scale block durations in the energy balance by 24/stage_duration and close each stage with efin==eini. Implies use_state_variable=false.

double gtopt::StorageOptions::energy_scale

Energy (volume) scale factor: the LP energy variable is divided by this value so that the LP works in scaled units (physical_energy / energy_scale). Default 1.0 = no scaling. For reservoirs the default is 100000 (dam³→Gm³) and for batteries 0.01.

double gtopt::StorageOptions::flow_scale

Flow variable scale factor applied to finp/fout/drain LP variables.

When > 1.0, the caller has pre-divided the flow LP variables (finp_cols, fout_cols, and the drain variable) by this factor. StorageLP compensates by multiplying the energy-balance row coefficients by flow_scale, so that the net contribution remains physically correct:

coeff = flow_conversion_rate × duration × flow_scale / energy_scale

With flow_scale == energy_scale (the reservoir case) this simplifies to: coeff = flow_conversion_rate × duration which is O(1) for typical hydro parameters — no more 1e-5 entries.

For drain: bounds are divided and LP cost is multiplied by flow_scale so that the physical objective value is preserved.

Default 1.0 = no flow scaling (battery behaviour is unchanged).

bool gtopt::StorageOptions::skip_state_link

Skip linking sini to the previous phase's efin at this cross-phase boundary. When true, the sini column is left free (within emin/emax bounds) so that the caller can fix it to a provisioned value (e.g., VolumeRight reset_month). The efin StateVariable is still registered for outgoing propagation to the next phase.

This prevents SDDP from propagating stale duals backward through a rights reset boundary, and from overwriting the provisioned eini with the previous phase's efin trial value in the forward pass.

Should only be set when the stage is a phase boundary AND the storage element's initial state is independently determined (reset/reprovision).

bool gtopt::StorageOptions::use_state_variable

Propagate SoC/energy across phase/stage boundaries via StateVariables. Forced to false when daily_cycle is true.