Changelog
All notable changes to GTOpt (Generation, Transmission and storage Optimization) will be documented in this file.
The format is based on Keep a Changelog.
Unreleased
An overview of the new capabilities with links to their documentation is in docs/whats-new.md.
Added
- LinDistFlow distribution network model (
model_options.network_model = "lindistflow"). Squared bus voltages withvmin_pu/vmax_pu/reference_voltage, a reactive balance per bus (shunt_q, Generatorqmin/qmax/power_factor, Demandpower_factor), the voltage-drop roww_a/t² − w_b − 2(rP + xQ)/V² = 0per line, exact continuous optimised taps (tap_ratio_min/tap_ratio_max), MVA polygons (mva_polygon_sides, default 8) bounded by the line capacity column, and disjunctive big-M drop rows for zero-capacity candidate lines, so reconductoring, transformer upgrades, BESS and PV hosting studies run as LP or MIP (integer_expmod). The default"dc"builds the same LP as before. New outputsBus/vsq,Bus/qbalancedual,Line/qflow,Line/vsqtap,Line/vdropdual andGenerator/qgen.opendss2gtopt --study vad|hostingbuilds the Chilean VAD sizing study and the PV hosting study on OpenDSS feeders. See §5.6 bis and docs/methods/distribution-expansion.md. opendss2gtoptandgtopt2opendssconverters. Parse OpenDSS.dssdistribution circuits (own parser: Redirect/Compile,like=, continuations, RPN values; Line/LineCode/LineGeometry with modified Carson, Transformer, RegControl, Load, Generator, PVSystem, Storage, Capacitor, LoadShape) into a balanced single-phase-equivalent gtopt case, and write a gtopt case plus its solved dispatch back as an OpenDSS script for AC validation through the optionalopendssdirect.py(pip install "./scripts[opendss]"). Converter fidelity against OpenDSS: 0.01 % voltage error on the balanced IEEE 4-bus feeder, mean 0.2-0.5 % on the unbalanced IEEE 13/34/123-bus feeders. See docs/scripts/opendss2gtopt.md.gtopt_private_evalstorage valuation (storage_valuation,--storage-valuation [TYPE=]MODE). Units drawing from a storage (LNG terminal, reservoir, battery) can be valued at the storage shadow value (its balance dual:LngTerminal/energy_dual,Reservoir/water_value_dual,Battery/energy_dual) instead of a declared fuel / water cost; refills at purchase price (LNG cargoes), zero (natural inflow) or CMg (battery charge), and the report gives a per-storage account that reconciles unit margins + storage margin = one-owner profit and values the inventory change. Defaultdeclared, except reservoirs incl(water value, as the CEN dispatches hydro).- LNG tank draw along the generator's heat-rate curve (
LngTerminal.use_generator_fuel_curve). Opt-in: a linked unit drawslink heat_rate × (h₁·P + Σ Δhₖ·sₖ + noload_fuel·u)from the tank — itspmax_segments/heat_rate_segments, scalarGenerator.heat_rateand committedCommitment.noload_fuel(theFuelofftake legs) — in the balance, send-out rows and PAMPLfuel, so holding reserve at part load costs gas; the up-reserve backing uses the top slope.gtopt_private_evalcharges thermal units the declared curve at the dispatched point (fuel price × upper segments + no-load fuel / P on top ofsrmc). plexos2gtopt no longer usesHeat Rate Base(no-load burn per hour) as a per-MWh heat rate. Casecases/lng_heat_curve_2u(the less efficient unit is part-loaded to hold the reserve). - Gas-backed reserves of LNG-fed units (
LngTerminal.reserve_sustain_hours,reserve_gas_usage). Opt-in (unset = LP unchanged). Per block the linked generators' up reserve must be sustainable from the tank,V_end − fcr·T·Σ heat_rate·r_up ≥ emin, and withsendout_maxenforcedΣ heat_rate·(P + r_up) ≤ sendout_max;reserve_gas_usageburns the expected deployment from the tank. Down reserve stays gas-limited through the genericr_dn ≤ P − Pminrow (empty tank → P = 0 → r_dn = 0). DualsLngTerminal/reserve_up_energy_dual,reserve_up_sendout_dual. Casecases/lng_reserve_1b(the reserve price rises from 0 to the peaker bid when the tank empties); tests for the battery down-reserve rules (idle not full → by charging, idle full → none, discharging full → up to its discharge).gtopt_private_evalSSCC revenue uses the dispatched provisions (also by generator uid). gtopt_private_evalstorages (storage_valuation,--storage-valuation [TYPE=]MODE). The evaluation stays cash in every market (cash, default): units receive CMg × energy and pay their variable cost — hydro with a reservoir only its VOM, batteries their charge at the CMg, LNG-linked units VOM + heat rate × the terminal purchase price (delivery_cost, elsespot_cost); the report adds the LNG terminal / owner account of the cargo purchases.shadowis an opt-in diagnostic that charges the storage balance dual (LngTerminal/energy_dual,Reservoir/water_value_dual,Battery/energy_dual) instead, to split profit between a storage and its units and value the end-of-horizon inventory; its accounts reconcile with the one-owner cash profit.- LNG spot cargoes and contract price (
LngTerminal.spot_cargo_volume,spot_cargo_max,spot_cost,spot_integer,spot_annual_max,delivery_cost). Optional cargoes, one column per stage (integer slots make the case a MIP: HiGHS / CPLEX, never CLP), arrive in the stage's first block and need room underemax;spot_annual_maxcaps them per 8760-h planning year.delivery_costprices the contracted deliveries (a constant for must-take cargoes); the linked units'gcostis then non-fuel VOM, the tank dual prices the gas. OutputsLngTerminal/spot_sol,spot_cost,spot_annual_dual; PAMPLlng_terminal("X").spot. Unset fields build the same LP. Casecases/lng_spot_1b. - Risk-averse planner (
model_options.risk_measure = "cvar",cvar_alpha,cvar_weight). Minimises (1 − λ)·E[cost] + λ·CVaR_α[cost] over the scenarios of a monolithic single-phase LP in the Rockafellar–Uryasev form (one η, one excess column and one row per scenario; investment stays first-stage). The duals become risk-adjusted probabilities, written torisk_measure.csv;gtopt_cost_recovery --risk-weights auto|probabilityvalues projects under them (zero profit) or under the true probabilities (risk premium). SDDP / cascade and multi-phase runs are rejected (nested CVaR design in formulation §4.5). Defaultexpectedleaves the LP byte-identical. Casecases/invest_cvar_1b. - Daily (non-uniform) commitment grid (
commitment_breaks). Cell boundaries in hours of the day, e.g.[3.5, 7.5, 10.5, 14.5, 17.5, 23.5](the peak 17:30–23:30 as ONE cell, 3 h sunrise / sunset cells), per unit (Commitment), per stage (Stage, e.g. seasonal) or as the planning default (model_options). Point and block stages map nodes by their clock timeStage.start_hour + t(new field, default 0); v / w only at cell boundaries, min up / down in cell hours, the cell straddling a cyclic week start is one cell.tcheby2gtoptandplexos2gtopt.aemo_isp_expansiontake--commitment-breaks/--commitment-breaks-file(per month). Unset leaves the LP unchanged. See docs/methods/typical-week-sampling.md §4c. - Per-candidate cost of capital (
overnight_capcost,economic_life,wacc). Generators, lines, batteries (energy andpower_overnight_capcost), converters, demands and carrier converters can give an overnight cost, a life and a private rate; the LP charges the annuityovernight_capcost × CRF(wacc, economic_life)whenannual_capcostis unset,waccfalling back tosimulation.annual_discount_rate. Stage discounting keeps the social rate. Cases without the fields build the same LP. See docs/methods/investment-economics.md. - Fixed O&M of expansion candidates (
fixed_om_cost,Battery.power_fixed_om_cost). A $/unit-year cost of the capacity built, charged in the LP with the annuity and the same stage discounting, on generators, lines, batteries (energy; power through the converter), converters, demands and carrier converters. Unset leaves the LP unchanged.gtopt_cost_recoveryreports it as an opex component. gtopt_cost_recoverytool and investment cases. Per-project revenue, opex, annualised capex, profit and make-whole uplift at the marginal prices, each margin split into variable-cost margin, capacity rent and failure rent (--price-blocks: λ = set cost + capacity rent per block; margin earned at failure prices is warned about); casesinvest_screening_1b,invest_garver_6b,invest_bat_1b,invest_wacc_1b,invest_multi_3b(electrolyser and desalination candidates) and the e2e caseinvest_wacc_2c.- Operation wear adders on
Commitment(SSCC maintenance signal in the LP). These are new optional fields, off by default. With them, wear acts on dispatch and expansion, not only on reserve:startup_wear_cost[$/start]: the wear part of one start, added to the startup column apart fromstartup_cost, also when hot / warm / cold tiers are used;wear_hour_costa [ \(/h] and `wear_load_cost` b [\)/MWh]: hourly weara·u + b·(p − Pmin·u). b may be negative (a low-load penalty); the LP builder checksa + b·(Pmax − Pmin) >= 0.
The terms are linear, so they work with a relaxed commitment and with capacity expansion. They are reported as
Commitment/startup_wear_costandCommitment/operation_wear_cost. Negativestartup_wear_costorwear_hour_costvalues are rejected. Docs: input-data.md (Commitment), formulation §5.15 Costs. - gtopt_usage
maintenance: maintenance counters, a calendar and an incremental cost. Each unit keeps counters per maintenance type (EOH, starts, cycles and calendar years, "whichever comes first"). An event of type k resets k and every lower type, optionally to a fraction of the counter (imperfect maintenance). EOH counts operating hours weighted by load,a + b·(p − Pmin)/(Pmax − Pmin)with b of either sign, plus Kd·starts, Kf·trips and α·reserve MW·h / Pmax. Batteries count DoD-weighted equivalent full cycles instead. The counters run against a fixed calendar (CSV, or theoutage_fractionschedule from plp2gtopt) and each calendar event is classed early, late or consistent. Only the difference between a run with SSCC and one without is priced, by two methods: a rate method (ΔEOH · Σ C/HOM) and an event method (extra events, advancementC·[1 − (1+r)^−Δt], replacement energy, terminal wear; discount rate 0.06 by default). The tool reports gross, savings and net per unit and technology, and θ per product for both methods. Wear factors (eoh_per_reserve_mwh,alpha_reserve,service_weights) take per-direction keys ({"cpf": {"up": a, "dn": b}}or"cpf_up"; flat per-service values still work) and θ is reported per technology, service and direction (the six SSCC products) inthetaandmaintenance. Docs: scripts/gtopt_usage.md. - Per-service reserve costs on one unit (SSCC), guard against negative costs. A unit that offers CPF, CSF and CTF at different costs uses one
ReserveProvisionper service withshared_headroom: true: each service keeps its ownurcost/drcostand the services share one headroom pairp + Σ r_up ≤ Pmax·u,p − Σ r_dn ≥ Pmin·u. New tests show the zone prices then differ exactly by the cost gap. A negativeurcost/drcostis now rejected byvalidate_planningand by the LP builder (file schedules); no existing case used one. Docs: input-data.md (ReserveProvision), formulation §5.9. - Usage accounting outputs (
output_usage_metrics) and thegtopt_usagepost-processor. With the option on (default off, the LP is unchanged) gtopt also writesGenerator/usage_on(1 when the unit generates),Generator/usage_ramp(|Δp| between consecutive chronological blocks),Commitment/usage_pminandCommitment/usage_at_pmin(committed at the floor).gtopt_usage usage RUNturns them into hours, starts, ramp MW, hours at pmin and reserve MW·h per unit, and, from per-technology maintenance parameters (intervals in EOH / starts / cycles, cost per event, Kf / Kd), into equivalent operating hours, maintenance events and cost.gtopt_usage theta BASE SSCC --params Pderives the SSCC wear cost θ per technology and service = Δ maintenance cost / reserve MW·h from a run without and a run with reserves. Docs: usage.md, scripts/gtopt_usage.md. - Known SSCC variable costs on
ReserveProvision(all off by default).ur/dr_partload_cost(part-load penalty, $/MW·h),ur/dr_activation_factorγ ∈ [0, 1] withur/dr_activation_cost(deployed-energy cost; up defaults to the generator SRMC, down to 0) andur/dr_degradation_cost(per MWh of deployed throughput, BESS). The provision column cost becomesurcost + partload + γ·(activation + degradation); each term is written separately (ReserveProvision/{up,dn}_{partload,activation,degradation}_cost, $/h) so θ splits into known costs and the derived maintenance delta. Negative costs and γ outside [0, 1] are rejected. New accessorGeneratorLP::srmc_at. Docs: input-data.md, formulation §5.9. - Maintenance calendar:
Generator.outage_fractionandmodel_options.outage_reserve_mode. A per-(stage, block) fractionf∈ [0, 1] of the unit in maintenance scalespmin/pmax(and the expansion capacity row) by1 − f, kept apart from derates and entry / retirement; the applied value is written asGenerator/outage_fraction.outage_reserve_mode:none(default, only the headroom shrinks),proportional(urmax/drmaxscaled by1 − f) orexclude(no reserve in a block withf > 0). Unset = the previous model.plp2gtopt --mance-split {off,auto,xlsm}(defaultoff) movesplpmance.datmaintenance derates into this schedule:autouses a heuristic on thermal centrals,xlsmtakes the maintained centrals from the PLP workbook (--mance-xlsm FILE). Docs: input-data.md (Generator), planning-options.md, formulation. - Radial lines: one-way and dead-end detection (
model_options.line_direction_mode,Line.flow_direction). The bridges of the transport graph (every line ever active, DC links and candidates included) are classified from the injection signs on each side: one-wayab/ba(toward a load-only side, away from a generation-only side), dead end (nothing, or the same sign, behind the line) or both.structuraldrops the impossible direction of one-way lines (reverse flow / loss / segment columns; one-sidedtangent_signed_flow) and does not build dead-end lines; lines in user constraints or line commitments stay untouched.reportonly logs the classification.Line.flow_direction = ab | ba | both | autopins or opts out per line. Defaultoff: the LP is unchanged.gtopt_check_topology --directionspreviews the classification. plp2gtopt,sddp2gtopt,plexos2gtopt --results: import the source tool's solution as a gtopt output directory. The output uses the same layout as a gtopt run: Parquet files with the same names, columns, uids and scenario / stage / block indexing, zstd by default, plussolution.csv,solver_status.jsonandplanning.json. Existing readers load it unchanged.- Imported results: generation, served and unserved demand, LMPs, line flows, reservoir volumes and water values, turbined and spilled water, and battery operation.
- Elements that cannot be matched are reported as warnings.
- Output goes to
<out>/results_<tool>;--results-onlyskips the conversion of the inputs.
gtopt_compare_runs: compare two gtopt output directories. It reports the objective, every stream and the top differing elements, and lists the elements found in only one run.- Elements are aligned by name and by scenario / stage / block position.
- Generation is summed by technology, and reservoir end-of-stage volumes are compared stage by stage.
- Reports can be written as CSV, JSON and plots.
- Tolerances are set with
--abs-tol/--rel-tol; the exit code is 1 when a stream is beyond tolerance. plexos2gtopt.compare_with_plexosnow builds on it, with a new--run-diffflag.
See docs/scripts/gtopt_compare_runs.md.
gtopt2plp,gtopt2sddp,gtopt2plexos: export a gtopt case and its results to PLP, PSR SDDP and PLEXOS formats. Inputs are written in the layoutsplp2gtopt,sddp2gtoptandplexos2gtoptread back;--results DIRalso writes a solved run as the tool's own outputs (PLPplpcen/plpbar/plplin/plpemb/plpessCSVs, PSR graf CSVs, PLEXOS solution tables read byplexos_solution). Whatever the target format cannot hold (merged demands per bus, intra-stage variation, turbine flow capacity, batteryeini, user constraints, ...) is reported as a warning and ingtopt2plp.json/gtopt2sddp.json;--strictturns warnings into exit code 2.gtopt2plpprints theplp2gtoptflags (-y,-p,-d) and thegtopt --setoverrides that make the read-back case solve like the original. New shared helpers:gtopt_shared.case_reader(field values at full scenario x block resolution, inline or from tables),gtopt_shared.results_readerandgtopt_shared.case_compare(name-independent comparison of two plannings). See docs/scripts/gtopt2plp.md, docs/scripts/gtopt2sddp.md and docs/scripts/gtopt2plexos.md.dlr2gtopt/re2gtopt: one--weather-source {explorador,open-meteo}option forhistory, through a weather layer both tools share (gtopt_shared/weather_source.py).exploradoris the Explorador Eólico WRF 1 km hindcast (2010 or 2015);open-meteois the Open-Meteo archive (ERA5 from 1940, ECMWF IFS from 2017). Years outside a source fail unless--climatology calendar(replay the source year on the same local month/day/hour) ormonth-hour(per month × hour statistic) is set. Each output gets a.provenance.json. Without the option the previous default is unchanged. The free Open-Meteo API is non-commercial only (--api-key/--base-urlfor commercial use). A third source,explorador-solar, reads the Explorador Solar (2004–2016): the hourly series (needs the site's download-profile declaration,--explorador-solar-profile, no default) or the month × hour means (--explorador-solar-mode aggregate). The hourly file is parsed in its real layout (metadata and variable table to the provenance;difhas DHI); its stamps were fitted as fixed UTC−4, centred on the hour (--explorador-solar-label), and its wind height is 5.5 m as documented by the site's SOLEVAPP report (--explorador-solar-wind-height). With no wind direction,dlr2gtopt historyneeds an explicit attack angle (45° study value, 0° conservative variant,--perpendicular-wind90°), or--wind-angle-source explorador-eolico: the angle per span and local month × hour from the Explorador Eólico WRF dominant direction (speed-weighted modal 22.5° sector), a rating parameter only.re2gtopt: wind and PV plant profiles on the DLR typical year. A new script turns weather into hourly output per plant and writes gtoptGeneratorProfileschedules, using the same historical hours thatdlr2gtopt typical-yearpicks for the line ratings.- Weather: Explorador Eólico recon (10–140 m, the DLR grid and stencil) and ERA5 (Open-Meteo).
- Wind model: density normalisation, OEDB or generic power curves, farm smoothing, wake, a soft cut-out and an explicit max-output cap (default 0.95).
- PV model (pvlib): DIRINT, Perez, single-axis tracking with backtracking, Faiman cell temperature, soiling and DC/AC clipping.
- Each plant's equipment is sized to reproduce its reported Pmax, with a per-plant peak check.
inventory: plant location and equipment from the CEN Infotécnica API.fetch-cen: hourly generation, curtailment and forecasts from CEN public files, cached and never committed.calibrate: fits on observed output by scalar, empirical curve or quantile map. Curtailment is treated as censoring, so the profile is potential generation. Includes leave-one-year-out validation.typical: the default--case meanpreserves the long-term monthly energy. P90 and other quantiles are energy-yield cases.to-blocks/repeat: use dlr2gtopt's own hour->block mapping.--block-stat dlr-hour --cf-historytakes each block's CF at the DLR block's exact historical hour.- It reads the DLR provenance columns (blend partner, knn members) and the same
--timezone/--dstcalendar as dlr2gtopt. - Generic defaults for single plants: no farm smoothing (
ninjastays available for fleets), and a PV DC/AC ratio by commissioning year (1.05 to 2015, 1.2 for 2016–2019, 1.3 from 2020; overridable). - Literature, defaults and data licences:
scripts/re2gtopt/README.md.
- Point-sampled stages (
Stage.sampling = "point",Block.time,Stage.period_hours,Stage.periodic): block values are samples at node times and block durations are quadrature weights; a stage can sample one typical day or week that repeats; the intra-period couplings wrap around the period where an option asks for it (Commitment.cycle = "stage",model_options.periodic_storage). A generic cell partition counts min up / down times, commitment periods and daily-cycle windows on the quadrature cells. See Typical-week sampling. - Storage integration rules on point stages (
model_options.storage_integration,reservoir_storage_integration,battery_storage_integration, per-elementstorage_integration):block(aliascc/clenshaw_curtis: the Clenshaw–Curtis weights on a Chebyshev grid),trapezoid,lg4/lg6,lg4_pos/lg6_pos. Built-in defaults:lg4_posfor reservoirs,blockfor other storages;plexos2gtoptandtcheby2gtoptwritecc(--point-storage-integration). - Storages on periodic stages (
model_options.periodic_storage, defaultfalse): adaily_cyclestorage starts every periodic stage at a free level and closes on itself; a state storage (reservoir, LNG tank, a battery withdaily_cycle = false) runs ONE real cycle and its stage-end state isefin = s + n·(x_last − s)(cycle_scalerow,n = duration / period_hours), with the bounds checked on the first and the ⌈n⌉-th repetition (cycle_shiftrows). External terms in the storage balance (VolumeRight, LNG fuel, AllowancePool, EmissionSource) use the same one-cycle time scale. Off: the LP is unchanged. - Cyclic line commitment (
LineCommitment.cycle = "stage", default"none", mirrorsCommitment.cycle): the breaker transition at the first block wraps to the last block, min up / down windows and the start-up tier walk wrap around the stage on real time steps, start / shut-down costs are paidduration / period_hourstimes, andinitial_status/initial_hoursare ignored (validation warning). model_options.prev_stage_link = "period": a user-constraint<attr>_prevterm at the first block of a periodic stage (typical day / week, ≥ 2 blocks) reads the last block of the same stage — the period wraps; other stages behave as under"stage"(the default, unchanged).- Validation warning for contradictory storage flags: a storage whose resolved
daily_cycleanduse_state_variableare both true (e.g. a Battery that sets onlyuse_state_variable: true, itsdaily_cycledefaulting to true) is cyclic and the state request has no effect; the warning asks fordaily_cycle: false. Defaults and the LP are unchanged. plexos2gtoptAEMO ISP expansion storage modes:--battery-state-hours H(defaultinf, all cyclic as before) writes batteries of at least H hours (PHES, long-duration BESS) as state storages;--periodic-storagesetsmodel_options.periodic_storage;--rep-day-periodicwrites hourly representative days withperiod_hours = 24. All off by default (unchanged output).- Typical-week sampling in
plexos2gtopt: Chebyshev weeks and days, uniform and point weeks, a Wednesday-noon window and the--ramp-refinesunrise / sunset refinement. tcheby2gtopt(python -m tcheby2gtopt): Chebyshev case converter and thecheby_smallcase library, with per-unit commitment-period classes on point stages.- Power-based unit commitment (
model_options.uc_formulation = "power_based", per unitCommitment.uc_formulation; Morales-España, Gentile & Ramos 2015): power at block boundaries, trapezoid block energy, exact ramps, start-up / shut-down trajectories (startup_trajectory,shutdown_trajectory,trajectory_step) and ramp-capability reserves.cucdata2gtoptcan write it. - Commitment grids:
Commitment.commitment_grid,Block.commitment_cellandCommitment.ramp_allowance(boundaryby default: only ramp rows that cross a commitment-period boundary get the start-up / shut-down allowance;periodrestores the looser form) on block and point stages; backward interval-slope ramps on point stages. model_options.prev_stage_link(stagedefault,none): what a user-constraint<attr>_prevterm reads at the first block of a stage.- Gas network and LNG terminals in PAMPL: user constraints can reference gas nodes, pipes, compressors, supplies, demands and LNG terminals.
- GUI service security: access-token authentication on non-loopback binds, security headers and bounded uploads (see
guiservice/INSTALL.md). lp_matrix_options.pin_logic_rows(bool, defaultfalse) andSparseRow::pin_scale, the row-side counterpart ofSparseCol::pin_scale. With the option on, pure commitment-logic rows (Commitment and LineCommitment transition, exclusion, start-up tier and window, max / min starts; Converter charge / discharge exclusivity; Plant commit with unit coefficients / unique: all ±1 rows) keep row factor 1 underrow_max,ruizand the incrementaladd_row/add_rowsnormalisation; column scales still apply and the rows still enter Ruiz's column norms. Physical duals are unchanged. Min up / down rows are never pinned: their aggregated form carries the window length (UT · startup), and pinning it widened uc_small's matrix range from 80 to 160. Off by default: it left kappa unchanged on every benchmark case and made a cuc39 MIP much slower.solver_options.accept_optimal_infeas(bool, defaulttrue). A CPLEX LP that endsCPX_STAT_OPTIMAL_INFEAS(5, optimal with unscaled infeasibilities) is accepted as optimal, with one warning per solve giving the max unscaled primal and dual infeasibility, instead of running the barrier -> dual -> primal fallback cycle (whose presolve-off attempts stalled or ended in a numerical "infeasible" on the CEN PCP corridor LPs).falserestores the former rejection. Also under--set, per SDDP pass and inmonolithic_options. Other solvers ignore it.- Fallback cycle logging. Every algorithm-fallback cycle (
max_fallbacks) now logs one WARN line listing each attempt's algorithm and native solver status (code and name, newSolverBackend::raw_status(), plugin ABI 18) and the outcome; the per-attemptresolvelines were DEBUG only, so a monolithic run's failing attempts were invisible. - Relative zero-impedance floor (
model_options.tiny_reactance_rel_threshold, default0.01). A line is a zero-impedance tie when|X/V²|is belowmax(dc_line_reactance_threshold, 0.01 × median |X/V²|). The absolute1e-6floor missed the PLEXOSX = 1e-4p.u. generator-connection placeholders, which sit exactly atx = 1e-6. On CEN PCP 2026-11-09 it ties 44 lines instead of 1, and the x_τ spread drops from 1.6e4 to 3.3e3.0restores the absolute floor. The effective floor is written back intodc_line_reactance_threshold, so every consumer uses it. - Lossless ties (
model_options.tie_line_losses, defaultfalse). A zero-impedance tie gets no loss columns or rows.truekeeps the legacy tie loss model. - Ordered-fill bound on PWL loss segments (
model_options.loss_segment_bound, defaulttrue). Each segment column is capped atmin(w_k, max(0, tmax − b_{k−1})). This is a valid tightening cut that only bites when the segments reach past the flow cap: aloss_envelopeabovetmaxused to leave the last segment unbounded. It limits non-physical loss inflation; it does not fix arbitrage.falserestores the width-only bounds. solver_options.deterministic_parallel(bool, default unset = opportunistic, the former behaviour).trueruns CPLEX in deterministic parallel mode (CPX_PARAM_PARALLELMODE = 1): the same LP gives the same basis, duals and reduced costs whatever the machine load. Also under--set, per SDDP pass and inmonolithic_options. The e2e golden tests (run_gtopt.cmake) now set it: under a loadedctest -j20CPLEX run, the opportunistic barrier + crossover endedexp_bat_4b_24(a dual-degenerate LP) on another optimal basis in ~1 run of 15, failing itsDemand/load_costandGenerator/generation_costreduced-cost goldens.- Numerical-stability monitor. Tests that fail when a change worsens the scaling or conditioning of the LP (docs/numerical-stability.md):
test_numerical_stability.cpp: six canonical cases (Kirchhoff network, battery, hydro, piecewise losses, UC with ramps, capacity expansion). Matrix / objective / RHS / bound ranges per case, no tiny or huge matrix entries, default scaling never wider than--no-scale, and per-solver kappa baselines (HiGHS, CPLEX).gtopt_check_output --numerics: runs a case, dumps its LPs and checks kappa, SDDP kappa growth and cut-coefficient range, the LP ranges, cell status and solver numerical warnings againstintegration_test/numerics/numerical_stability_baselines.json;--update-baselinesrewrites it,--top Nlists the entries that drive the matrix range. CTest labelnumstab(three small cases, default set); the CEN 2-year case (first phase) runs withGTOPT_NUMERICS_TESTS=ONandGTOPT_CASES_DIR.
- Dynamic line rating (DLR) through critical spans. A line can now carry a
dlrobject with one or more critical spans (one representative span is enough). Each span has a per-block weather forecast: ambient temperature, wind speed and direction, and global horizontal solar irradiance. For every block gtopt computes the span's ampacity with the IEEE Std 738 steady-state heat balance, converts it to MW and limits the line flow by it. The weather is input data, so the model stays linear.- PLEXOS line limits. New optional per-block line fields
max_flow/min_flow(aliases oftmax_ab/-tmax_ba),max_rating/min_rating,overload_max_rating/overload_min_rating(the hard cap when the band is priced),outage_max_rating/outage_min_ratingwithunits_out(maintenance derate), andlimit_penalty(alias ofoverload_penalty).min_*are signed (≤ 0), as in PLEXOS. - Limit causes.
conductor_rating_ab/ba(replaced by DLR),equipment_rating_ab/ba(TTCC, CCSS, wave trap, breaker) andsecurity_limit_ab/ba(stability, N-1). These follow the CEN ERST causes. - Combining the limits. Every field is optional: unset means no limit, NaN cells are unset, and an unset B→A field never copies A→B. The limit is the min over the set fields, carried by one bound or row per direction. The binding part's dual goes to
Line/<part>{p,n}_dual. Every field is also a PAMPL parameter. dlr.limit_mode/model_options.dlr_limit_mode:replaceormin.replacemakes the DLR rating replaceconductor_rating_*(without one,max_rating) andtmax_normal.minusesmin(static, rating). When unset, the mode isreplacewith a conductor rating andminotherwise, so existing cases are unchanged. Flow, outage, equipment and security limits always apply.- The DLR rating follows
line_thermal_limit_modeliketmax:|f| ≤ T(flow),|f| + a·ℓ ≤ T(sending),|f| + ℓ ≤ T(full), in both directions, both span modes and the emergency tier. New tests pin this. When you audit a run,Line/loss_solalready holds the total loss (lossp + lossn). Do not addLine/lossn_solto it. span_mode = "min"(default) applies the minimum over the spans wherevertmaxapplies today."rows"adds one limit row per span and block instead, and drops the rows of spans that cannot bind. Both give the same optimum.tmax_conductor_emergencyadds an emergency rating: above the normal rating the flow paysoverload_penalty, up to the emergency rating.- A precomputed per-span MW schedule (
rating) can replace the weather. - Every behaviour is an option:
model_options.use_line_dlr(defaulttrue;falseignores everydlrblock for static-vs-DLR runs),dlr.use_emergency,dlr.safety_factor,dlr.v_pu,dlr.power_factor, the low-wind rule (low_wind_speed, default 0.5 m/s, andlow_wind_angle, default 45°) anddlr.solar_mode(ghi, the default, uses the irradiance as absorbed fluxα·S·D;noneignores the sun). The conductor resistance can be given asr25/r75or asr20+alpha_r+ac_factor. - The overload slack of every line (
overload_penaltyband) is now bounded:overload_slack_bound = "thermal"(default) caps it atmin(hard − normal, max_overload_ratio × normal)— on DLR lines the IEEE 738 emergency minus normal rating, the conductor's thermal headroom."ratio"usesmax_overload_ratio × normal, and"unbounded"keeps the old open slack.max_overload_ratiodefaults to 1.5 (flow ≤ 2.5 × normal), well above reported DLR gains (DOE SGDP 2014: +10–25 %; up to ~40 % at windy sites, 50–72 % outliers; EPRI 2025: DLR below static 30–40 % of the time). Both options can be set per line and inmodel_options. The span duals stay well defined when the flow sits exactly at the emergency rating. - New outputs:
Line/dlr_rating_sol,Line/critical_span_solandLine/span_thermal_dual(the value of one more MW of rating on each span). - The span selection method is Matus, Saez, Favley, Suazo-Martinez, Moya, Jimenez-Estevez, Palma-Behnke, Olguin and Jorquera, "Identification of Critical Spans for Monitoring Systems in Dynamic Thermal Rating", IEEE Trans. Power Delivery 27(2):1002–1009, 2012, DOI 10.1109/TPWRD.2012.2185254 (open access: ResearchGate, PDF (Universidad de Chile)). Selecting the spans is done outside gtopt. The ampacity follows IEEE Std 738-2012.
- The input reference now also documents the existing Line fields
tmax_normal_ab/tmax_normal_ba,overload_penalty,in_serviceandenforce_level.
- PLEXOS line limits. New optional per-block line fields
dlr2gtopt: dynamic line rating inputs. A new script builds thedlrobject of a gtopt Line. It goes from tower coordinates to spans, per-span hourly weather, the IEEE 738 ampacity and the critical spans of Matus et al. (IEEE TPWRD 2012), then writes the per-block weather or rating schedules.- Tower sources: the CEN Infotécnica structure lists, OpenStreetMap, or a CSV/KML file.
- Weather sources: the Explorador Eólico 1 km WRF hindcast, interpolated to each span (bilinear in space, log or power law in height, direction through u/v), Open-Meteo forecasts, or ECMWF open data.
critical-spansalways writes the full ρ(n) curve, with the equidistant benchmark.- Every choice is an option, and downloads are cached and polite. See
scripts/dlr2gtopt/README.mdfor the data licences.
gtopt_check_casesflags unserved energy. After--solve, the demand failure (Demand/fail_sol) is summed per case (MWh, blocks with shedding, peak MW) and reported as a warning;--fail-on-unservedor a catalog entry with"serves_all_load": truemakes it an error.dlr2gtopt: typical meteorological years for long-term DLR. Long-term studies have no weather forecast, and gtopt computes each critical span's rating itself, so the new subcommands build typical weather forLine.dlr.history: a multi-year per-span table. Wind comes from the Explorador Eólico 1980-2017 reconstruction (1 km); temperature and GHI from ERA5 via the Open-Meteo archive, calibrated per span to the WRF 1 km month × hour climatology.typical-year: an 8760 h typical year of all critical spans, with the mean case (TMY month selection by the Finkelstein-Schafer statistic on the line rating) and the P90 case (the rating exceeded 90 % of the time = the 10th percentile, by analogue hours per month × hour, or a real low-rating month). Statistics are taken after the min over spans; every hour keeps all spans from one historical hour. It writes the month × hour rating statistics, a verification report with out-of-sample over/under-estimation, and plots.to-blocksmaps the typical year to PLP load blocks through plp2gtopt's hour→block map (or month × hour bands, or chronological blocks), andrepeattiles a month template over a 20-year horizon. Both write theLine.dlrweather schedules (or therating/ per-linetmaxprofiles).- Provenance (
--source-columns on, the default): typical files record the blend partner of month seams (source_time_2) and the hours averaged byknn-mean(knn_sources). The blocks table records each block's UTCsource_timeandsource_year, also in--historymode. - Calendar:
--timezone auto(from the span coordinates) and--dst off(fixed standard time, UTC−4 for Chile, as PLPindhor) replace the UTC default.--utc-offsetstays as an explicit override.
- Line thermal limit with losses. The new option
line_thermal_limit_modesets how a line's limit (tmax_ab/tmax_ba, and the installed capacity of expandable lines) treats its losses. It can be set per line or inmodel_options; a per-line value wins.flow(default): only the flow is limited. Results do not change.full: addsflow + loss ≤ tmaxin each direction.sending: limits the power leaving the sending bus, which is the flow plus the part of the loss charged there (seeloss_allocation_mode).- With
sendingorfull, the normal-rating band (tmax_normal_ab/tmax_normal_bawithoverload_penalty) also counts the loss: the penalty is paid onflow + loss(or the sending-end share) above the normal rating, for every loss model. Underflowthe band is unchanged.
- Line limit shadow prices in the output.
Line/thermalp_dualandLine/thermaln_dualhold the duals of thesending/fulllimit rows, andLine/capacityp_dual/Line/capacityn_dualthe duals of the installed-capacity rows of expandable lines, in $/MWh. Undersending/fullthe congestion rent of a full line moves fromflow_costtothermalp_dual/thermaln_dual. - gtopt now checks that each solver plugin it loads is the one built with it and that it runs with the solver library it was compiled against. It compares the plugin's build-id with the
<plugin>.so.build-idmanifest written next to it, the plugin's gtopt build with its own, and the solver version the plugin was compiled against with the version of the library loaded at run time (for example an oldlibhighs.so.1found throughLD_LIBRARY_PATH). The new option--plugin-check warning|error(environment variableGTOPT_PLUGIN_CHECK) decides what a failed check does:warninglogs it and loads the plugin;errorrefuses it. Seedocs/solvers.md, "Plugin integrity". - Commitment option
transition_integrality(auto/continuous/binary), inmodel_optionsand perCommitment(the per-unit value wins): integrality of startup / shutdown.auto(default) = binary. Seedocs/unit-commitment.md§4.1. - Commitment option
startup_tier_integrality(continuous/integer,model_optionsor perCommitment): integrality of the hot / warm / cold start selectors. Defaultcontinuous(the tier rows are totally unimodular once startup is integral). gtopt --solversshows, for each plugin, its path, build-id and build tag, and for each solver the compiled and run time library versions and the path of the solver library actually loaded.run_gtoptdashboard and plain mode.--ui {auto,tui,plain}(--no-tui/--plain=plain): the live dashboard on a terminal, line-oriented output for CI, pipes and editors.--no-color(orNO_COLOR) now works, and--ascii(orGTOPT_TUI_ASCII=1, automatic on non-UTF-8 locales) draws the dashboard with ASCII characters only.- SDDP progress shows the gap against
convergence_tol, the phase being solved and an ETA; objective values use SI suffixes; the log panel colours lines by level and folds repeats; a compact layout is used below 100 columns or 40 rows;oshows where the run's files are. - When gtopt ends, the last frame stays on screen with a summary and a banner that reflects the real outcome (converged, not converged, stopped, failed or killed), the output, log and status paths, and, after an infeasibility, the error LP files with the
gtopt_check_lpcommand to analyse them. - Plain mode prints one line per SDDP iteration and a heartbeat every 30 s.
--fail-on-not-convergedexits with 4 when gtopt succeeded but SDDP did not converge.--attachwithout an argument attaches to the only live run.--list-checksprints each check with its stage and default.--solver NAMEis forwarded to gtopt; the conversion output flag is now--convert-dir(-o/--output-dirstill work).- What gtopt prints on its own stdout / stderr is saved under
<output>/logs/and shown when a run fails. - Ctrl-C asks for a graceful stop first, then terminates, then kills.
See
docs/scripts-guide.md, "run_gtopt".- gtopt refuses a HiGHS other than the pinned release at run time. The HiGHS plugin carries
GTOPT_HIGHS_PIN_VERSION(1.16.0, the version the goldens are generated with); when thelibhighsloaded at run time is another release (e.g. the distro 1.12), the plugin is refused with the found and expected versions, the library path and how to fix it, and--solver highsfails instead of using another solver. It only warns when the plugin was built with-DGTOPT_HIGHS_ALLOW_UNPINNED=ON(asinstall.shdoes), withGTOPT_HIGHS_ALLOW_UNPINNED=1, or under--plugin-check=warning.gtopt --solversshows the pin. An unavailable solver requested by name now also lists why its plugin was refused. Seedocs/solvers.md, "Solver version pin (HiGHS)". - gtopt refuses a foreign solver library even when it reports the right version. Each plugin records, at build time, the GNU build-id (else the SHA-256) of every shared library it links; at load gtopt compares it with the solver library actually mapped in the process. A fake
libhighs.so.1found throughLD_LIBRARY_PATH, anLD_PRELOADthat interposes the solver's functions, or a library replaced in place is refused with the loaded and expected path and build-id (overrides:GTOPT_<SOLVER>_ALLOW_UNPINNED=1or--plugin-check=warning; a plugin built with-DGTOPT_HIGHS_ALLOW_UNPINNED=ONstill refuses a foreign library). Applies to every plugin with a shared solver library; statically linked solvers (CPLEX) reportstatic. Seedocs/solvers.md, "Solver library identity". - New CMake option
GTOPT_SOLVER_LIB_FULL_HASH(defaultOFF). WhenON, each plugin also records the SHA-256 of every linked solver library and gtopt hashes the loaded library file at start: a modified copy that kept the original build-id is refused (SHA256 MISMATCH).gtopt --solversshows whether it is active andsha256 verified. - Fixed: the LP fingerprint SHA-256 was not standard SHA-256 (the message schedule's sigma1 shifted by 2 instead of 10).
sha256_hex()is now FIPS 180-4 (checked against the NIST vectors) and shared with the solver-library identity check; LP fingerprint hashes (col_hash,row_hash,structural_hash) change value and now agree withgtopt_check_fingerprint(Pythonhashlib). No fingerprint goldens are stored in the repository. GTOPT_SOLVERnaming a refused plugin is now an error. When the solver named byGTOPT_SOLVERbelongs to a plugin refused by an integrity check (build-id, build tag, version, shadowing, HiGHS pin), gtopt fails like an explicit--solver(same error, exit code 3) instead of silently falling back to another solver. A solver with no plugin still warns and falls back.GTOPT_SOLVER_FALLBACK_ON_REFUSED=1restores the fallback for refused plugins.- New solver options
barrier_solver,mip_lp_algorithmandmip_heuristic_effort, settable insolver_options,sddp_options.forward_solver_options/backward_solver_options,monolithic_options.solver_optionsand with--set.barrier_solver(auto,ipx,hipo; HiGHS) picks the interior-point code ofalgorithm: barrierand of a HiGHS MIP's IPM fallback;autois the previous behaviour, andipxrestores the serial IPX on a HiGHS built with HiPO.mip_lp_algorithm(default,primal,dual,barrier) sets the MIP root LP algorithm (HiGHSmip_lp_solver, CPLEXStartAlgorithm);mip_heuristic_effort(0-1, HiGHS) the share of MIP effort spent in heuristics. All three are unset by default, which keeps each solver's own default. - Cascade levels take their own solver options:
cascade_options.level_array.N.sddp_options.forward_solver_optionsandbackward_solver_optionsoverride the optional solver fields (tolerances,mip_gap,time_limit,barrier_solver, …) for that level.
Removed
- Commitment rows
startup ≤ status/shutdown ≤ 1 − statusand the optiontransition_status_rows(added 2026-11-25, unit and line commitments). Why: with binary startup / shutdown (transition_integrality = auto) they are redundant in a MIP; at scale they made the LP degenerate and near-singular (the exclusion row is their exact sum, and they were emitted for fixed-status periods too: 155 014 of 219 564 rows on the CEN PCP case), CPLEX's crossover ended at kappa 1e16 and more, and CPLEX declared feasible PCP LPs infeasible. Without them the same LP solves with kappa ≈ 2e7.transition_integrality = autois binary again (it was continuous only while the rows were on), which is exact and is UnitCommitment.jl's Gar1962 model; LP relaxations and MIP sizes of commitment cases move back to the pre-2026-11-25 values (Hua-Baldick Ex. 2 relaxed price 820/13 ≈ 63.08 again). Input files that still settransition_status_rows(bool or name, inmodel_optionsor aCommitment) load; the key is ignored with one warning.
Changed
sddp_options.release_backendsnow defaults totrue. Underlow_memory_mode: off, SDDP / cascade release each cell's solver backend after its solve and rebuild it from the uncompressed snapshot plus the saved basis (ascompresswithmemory_codec: uncompressed). On CEN 2y with CPLEX the peak drops from 22.3 to 3.7 GiB; wall time is unchanged within noise (dual simplex -3.6 %, barrier +4 %). The bounds matchcompressexactly and move ~0.025 % against live backends (degenerate ties).--set sddp_options.release_backends=falserestores the previous behaviour (every LP live). Monolithic runs are unaffected.run_gtoptno longer forcessnappyoutput compression: the case'soutput_compression(or gtopt's default,zstd) is used unless-Cis given.-lfor--log-levelis deprecated (in gtopt-lmeans--lp-file).gtopt --help:--sddp-num-aperturesnow describes the actual behaviour (unset = every aperture of the phase,0= none,N= the firstN).- One rule for the output directory. A directory given on the command line is relative to the current directory, whether it comes from
-dor--set output_directory=(before,--setwas anchored at the case JSON's directory, so--set output_directory=.wrote into the case directory while-d .used the CWD).--set input_directory=follows the same rule. A JSONoptions.output_directorystays relative to the JSON file, and the case-directory formgtopt case/now honours it instead of forcingcase/results(resultsremains its default when the JSON sets none).run_gtoptandgtopt_check_casesfollow the same rule;gtopt_check_casespasses--set output_directory=instead of the deprecated-d. - New option
loss_flow_abs_cost(default 0.001 $/MWh). Intangent_signed_flowthe abs-flow proxy columns (Σv ≥ |f|) carry a small cost that makes Σv = |f| at the optimum and keeps the secant chord on the losses anchored. It was an internal constant of 1e-6 $/MWh, which became 1e-9 in the LP afterscale_objective = 1000: below the solvers' tolerances, so it could fail to pin, and it stretched the objective range (9 decades online_loss_envelope). It is now a user option in real $/MWh, inmodel_optionsand per line, default 0.001 (1e-6 in the LP). It applies only whenloss_cost_eps > 0, as before. Effect on results: the price difference across a lossy line moves by at most about 0.001 $/MWh in the flow direction, and the objective rises by about 0.001 · Σ|f| on those lines.loss_flow_abs_cost: 1e-6reproduces the old LP exactly;0disables the pin. - Solver plugins that fail the integrity check are now refused by default. The default of
--plugin-checkiserror(it waswarning): a plugin from another build tree, a stale install, a plugin without its.so.build-idmanifest, or a solver library shadowed throughLD_LIBRARY_PATHis not loaded. The default is set at build time with the new CMake optionGTOPT_PLUGIN_CHECK_DEFAULT(errororwarning, checked at configure time);$GTOPT_PLUGIN_CHECKoverrides it and--plugin-checkoverrides both.gtopt --help,gtopt --versionandgtopt --solversshow the effective mode and where it comes from. Plugins built and installed with the same gtopt load as before. To load a mismatched plugin anyway, pass--plugin-check=warningor setGTOPT_PLUGIN_CHECK=warning. The CI artifact now ships each plugin's.so.build-idmanifest. - Lower SDDP memory. On the CEN 2y case (CPLEX, 18 scenes x 52 phases, 3 iterations) peak RSS drops from 26.2 to 23.2 GiB under
low_memory_mode: offand from 4.5 to 2.5 GiB undercompress, with identical bounds. Each low-memory backend is released right after alpha registration; the copy-out scratch of the CPLEX, Gurobi and MindOpt plugins is freed after each forward solve; compressed buffers are exact-size; with LP names off no label metadata is kept at all (with names on it is shared with the snapshot instead of copied); and SDDP / cascade underoffdrop the disposable element collections, rebuilding them forwrite_out. LP files and names are unchanged when names or LP-file output are on. Every reduction has an option that restores the previous behaviour:lp_matrix_options.label_meta_without_names(defaultfalse),lp_matrix_options.share_label_meta(defaulttrue),lp_matrix_options.drop_element_collections(defaulttrue),sddp_options.release_after_alpha(defaulttrue) andsddp_options.free_solver_scratch(defaulttrue). - New option
sddp_options.release_backends(defaultfalse, nowtrue, see above): underlow_memory_mode: off, release each solver backend after its solve and rebuild it from an uncompressed snapshot, warm-starting from the saved basis, ascompressdoes.falsekeeps every LP live. plp2gtoptno longer writeslow_memory_mode: off, so gtopt'scompressdefault applies unless the PLP source sets a mode.- Tighter cap on line losses. A line's loss can no longer exceed what the loss model gives at the line's maximum flow. Before, the cap could be up to
(loss_envelope / tmax)²times larger whenloss_envelopewas abovetmax. The extra room only served fictitious losses under negative prices. Results change only for lines withloss_envelopeabovetmax. - The run log's
solver=highs/<version>andsolver=clp/<version>now give the version of the solver library loaded at run time, not the version of the headers the plugin was compiled with. - HiGHS: without an explicit
threads, a MIP now uses every physical core (HiGHS 1.16 runs one tree-search worker per thread); an LP keeps 4 threads. Before, every solve was capped at 4. - HiGHS 1.16.0 is the reference version, for its parallel MIP solver (on by default) and its MIP and presolve fixes: CI builds it, and
install.shbuilds it from source when the distribution package is older (Ubuntu 26.04 and Debian 13 ship 1.12.0). The optionalhighspydependency ofgtopt_check_lprequires 1.16 or later. - HiGHS is built with HiPO, its parallel interior-point solver.
install.shand CI build HiGHS 1.16 with-DHIPO=ON -DBUILD_OPENBLAS=ON, soalgorithm: barrierruns HiPO (multithreaded ordering, normal equations and factorisation) instead of the serial IPX. A HiGHS without HiPO still works and runs IPX. SeeBUILDING.mdand the HiGHS section ofdocs/solvers.md.
Fixed
- LP coefficients were silently dropped while the LP was built, making results depend on the solver and the memory layout.
LinearProblemkept rows and columns in astd::vector, and element builders stamp throughlp.row_at(i)references while other code adds rows:LineLParoundline_losses::add_block(every PWL loss mode adds segment / loss-link rows between the forward and reverse stamps) andDemandLParound its capacity rows (an expandable demand with a stageemin). When the vector reallocated, the stamps that followed went to freed memory: the reverseflown/lossnof a line, or a demand'slman, vanished from one block's bus balance. Which block, if any, depended on the allocation pattern, so HiGHS / CLP and CPLEX / MindOpt / SCIP built different LPs from the same case. Rows and columns now live inStableVector(append-only chunks that never move), so arow_at/col_atreference stays valid acrossadd_row/add_col; correct code builds the same LP as before. - PWL line losses on an unrated line no longer stamp NaN coefficients. A line with resistance but no
tmax/ capacity /loss_envelopespread its loss segments over the unbounded block cap, overflowing the slopes toinfand the row scale to 0: NaN entries in the loss rows, which each solver reads differently. Such a line is now lossless with a warning; rate it or setloss_envelopeto keep its losses. Rated lines build the same LP as before. LngTerminal.sendout_max/sendout_minwere ignored. The fields were parsed and documented as regasification limits but never written into the LP, so the linked units could draw any rate. Each set limit now bounds Σ heat_rate × generation per block (LngTerminal/sendout_dual).enforce_sendout(default true) turns it off to restore the old LP; cases without the fields are unchanged.- plp2gtopt:
plpmaness.dat(ESS maintenance) clobbered the central and demand maintenance. Batteries with DC maintenance went through a legacy path that wroteGenerator/pmaxandDemand/lmaxunder the battery uid (overwriting theplpmance.dat/ demand schedules) and built separate<bat>_disch/<bat>_chrgelements. The rows now set the unified battery's ownBattery/emin,emax,pmax_discharge,pmax_charge(DCMax as both power limits, dense over the blocks, unlisted blocks at the nominal values;DCMin> 0 is warned), and a DCMod=2 regulation tank'sReservoir/ess_emin/ess_emax. Batteryemin/emaxreference a file only when it was written. Casescripts/cases/plp_min_ess_maness. - plp2gtopt: battery entry dates from
plpmance.dat. Maintenance rows of a battery central (and of its<bat>_LOADcharge phantom) were written asGeneratorschedules of the auxiliary units and ignored, so a battery entering mid-horizon was available from the first block. They now set the battery'spmax_discharge/pmax_chargeblock schedules (Battery/pmax_*; unlisted blocks keep theplpcnfce.datpower). Casescripts/cases/plp_min_battery_entry. Battery.integer_expmodnow also makes the converter's power modules integer when the power axis is expandable (it was not forwarded to the expanded converter).- Lossless expandable lines ignored their built capacity. With no loss model (
nonemode) the flow bounds used only the existing capacity, so a candidate line was never limited bycapainst; thecapacityp/capacitynrows are now added as in the other loss modes. - Kappa: a solver "infinity" is no kappa. CPLEX answers
CPX_KAPPAwith status 0 and its huge-value sentinel 1e75 when it cannot bound the condition of the final basis;solution.csv,max_kappaand the high-kappa warning reported it as kappa = 1e+75. That sentinel (>= 1e75), +inf and NaN now read as unavailable (-1), with one CPLEX warning per process; huge finite estimates (CPLEX reports 2.3e16 on that LP's basis) are kept and still trip the high-kappa warning. - Cascade
solution.csvsummary. A cascade never set the run summary, somax_kappawas -1 next to valid per-cell kappas andgap/gap_changewere defaults; the last level's values are now written. auto_scale_thetalogs and keeps the defaultscale_thetawhen every line is a DC link or a tie (no median). The model sanity check no longer reports X/R on ties or on lines below the resistance floor.gtopt_shared.sanity_reportmirrors the relative tie floor.- HiGHS SDDP runs are several times faster. The HiGHS plugin asked HiGHS for the exact basis condition number after every solve, one FTRAN per basis row: on the CEN 2y case that was about 75 % of the HiGHS CPU time, and a backward pass took 6-8x longer than with CPLEX. It now reads the Hager estimate (as CPLEX's
CPX_KAPPA). New optionkappa_modefor every solver:estimate(default),exact(the old HiGHS computation, for diagnostics; CPLEXCPX_EXACT_KAPPA, GurobiKappaExact) oroff(kappa is neither queried nor printed: no solver call, nokappa/max_kappacolumns insolution.csv, no kappa in logs or high-kappa warnings). Kappa is now read once per solve instead of up to three times. Whenkappa_modeis unset,$GTOPT_KAPPA_MODEapplies, else the compiled default: new CMake optionGTOPT_KAPPA_MODE_DEFAULT(auto:offin release builds,estimatein Debug and CIFast), printed bygtopt --version. The integration tests setGTOPT_KAPPA_MODE=exact;run_gtopt --kappa-mode MODEpasses the mode to gtopt.solution.csvreaders (gtopt_check_cases,gtopt_shared) accept files without the kappa columns. With the presolve fix below, a HiGHS SDDP backward pass on a large hydrothermal case is about twice as fast as before, with the same bounds. - A HiGHS warm-start request (
advanced_basis) with no basis to start from, such as the first forward solve of each SDDP cell, now solves cold with presolve. It used to turn presolve off, which made the cold dual simplex 2-3x slower.cold_solve_without_basis: falserestores the old behaviour. - HiGHS:
crossoveris applied on every solve. Once a solve had usedcrossover: none, every later barrier solve of the same LP (an SDDP backward re-solve, for example) also ran without crossover, and returned interior duals and no basis where a vertex was requested. To keep crossover off on every solve, setcrossover: nonein every pass's solver options. gtopt .andgtopt ..now find the case JSON named after the directory (e.g.gtopt .insideieee_9b/usesieee_9b.json); they used to look for..jsonand fail.- The LP fingerprint check is real.
--set lp_fingerprint=truewrotelp_fingerprint_*.jsonfiles with an empty hash and template (the option never reached the LP builder), and the C++ SHA-256 had a wrong message-schedule shift, so its digests matched no standard SHA-256. Both are fixed.gtopt_check_fingerprintnow reads every column of an LP file (not only the bounds section), compares on class/variable/context arity, recomputes the stored hash and exits with 2 on an empty, tampered or unlabelled input instead of passing. - Async SDDP reported a lower bound of 0. With
max_async_spread > 0the per-scene and aggregate LB were read after the backward pass, from the phase-0 LP that had just received a cut and (on the aperture path) was not re-solved, so they came out as 0. The LB is now captured right after the forward pass, as the synchronous path does. - HiGHS kept its options across
load_problem. Loading a problem callsHighs::clear(), which resets every option, so the algorithm, crossover, thread count and log file set before the load were lost (the solve ran with HiGHS defaults). They are now re-applied after every load. - Expandable lines using
piecewiselosses with thetangentlayout now respect their installed capacity. Before, their flow was limited only bytmax. - An LP already proven infeasible is no longer reported as an abandoned solve because a later algorithm in the fallback cycle gave up on it. With HiGHS 1.15, whose interior point solver fails without presolve on some infeasible LPs, SDDP counted infeasible apertures as solver failures.
- HiGHS solver errors no longer abort the solve with an exception: they are reported as an abandoned solve, so the algorithm fallbacks still run.
- SDDP apertures whose solve is abandoned or ends non-optimal (not proven infeasible, not timed out) are retried once from scratch before being dropped. The per-phase aperture log reports how many were retried and recovered.
- A turbine whose generator has zero capacity no longer turns its waterway into a free spillway: dropping the generator also dropped the conversion row that kept the turbine flow at zero, so water could pass through an offline turbine at no cost. The flow is now fixed at zero (turbines with
drainmay still pass water). - Destroying the LP-name spill store could deadlock: the stop request was not made under the worker's mutex, so the worker could miss the wake-up and wait forever.
- Commitment startup tiers now use the same offline-time thresholds for a unit that shut down inside the horizon as for one that was already off before it: hot when offline
< hot_start_time, warm whenhot_start_time ≤offline< cold_start_time, cold otherwise. Before, a start exactlyhot_start_time(cold_start_time) hours after an in-horizon shutdown was priced hot (warm), one tier cheaper than documented. Results can change for units restarting exactly at a tier boundary. - A committed unit that starts the horizon online can now shut down in the first block. The first-block ramp-down row used the initial status where it needed the block's own status and shutdown, so a unit with
initial_poweraboveramp_downwas kept on for block 1. On the RTS-GMLC UC.jl benchmark this cost +3.5 % (five units forced on); gtopt now matches UnitCommitment.jl's optimum. - Commitment
initial_statusis rounded at 0.5 (as LineCommitment already did), so the first-period startup / shutdown stay 0/1. pricing_mode = fast_startnow relaxes integer start-up tier selectors with the status: pinned at the incumbent they kept the fast-start unit on in every start period.- Commitment ramp rows with
commitment_periodapply the startup / shutdown ramp only at the first block of the period where the unit starts / stops; interior blocks ramp withramp_up/ramp_downonly. Before, every block of the start period could ramp bystartup_ramp. - The first-block ramp-up row uses the startup column (
p − startup_ramp·startup ≤ initial_power + ramp_up·initial_status) instead of a constant: same integer solutions, tighter LP relaxation. - LineCommitment startup tiers now use the same thresholds as Commitment (hot when open
< hot_start_time, cold when open≥ cold_start_time), and a line open since before the horizon countsinitial_hoursat every block, not only the first: a later first close was always priced cold. Line startup / shutdown columns are binary (with the line status' domain): continuous ones admitted startup = shutdown = ½ on a line that stayed closed.
1.2.0 - 2026-11-24
GTOpt 1.2.0 adds natural-gas networks, a much richer reserve and unit-commitment model, and an SDDP solver that is faster and stricter about when it reports convergence. A systematic review of how the optimisation model is built also found and fixed many cases where an element was cheaper, freer or more constrained than intended. Several defaults changed, so results of existing cases can move: read Changes that affect your results before comparing with 1.1.0.
Highlights
- Gas and power in one model. Gas nodes, pipelines with line pack, compressors, supplies, demands and gas-fired turbines can be optimised together with the electrical system, with nodal gas prices next to the electricity prices.
- Realistic reserve requirements. Reserve needs can follow load, system inertia, the largest contingency and line flows, block by block, and batteries can only offer reserve they can actually deliver.
- Better prices from unit-commitment runs. Choose how prices are derived from a commitment schedule (fixed, relaxed or fast-start pricing) and compute the matching uplift payments.
- SDDP you can trust. Faster backward passes, and the solver no longer reports convergence on a large gap, on bounds inherited from a previous cascade level, or while some hydrology samples are infeasible.
- Losses without phantom flows. Loss modelling now resists the artificial loss "burning" that negative nodal prices can induce, and very low-impedance branches are modelled as ideal ties.
- Value of lost load as a curve. Load shedding can be priced in steps, as in operator and regulatory practice.
- More systems to read. PLEXOS 8.1 to 10.0 models, the AEMO ISP as a monthly expansion model, the clustered unit-commitment benchmarks, and reserve test systems from Sienna and RTS-GMLC.
Changes that affect your results
Costs and penalties
- Unserved energy is priced at 1000 $/MWh by default. A case that did not set
demand_fail_costused to shed load for free; it now serves it. Setdemand_fail_cost: 0for the old behaviour. - Penalties are weighted like every other cost. Soft user-constraint penalties, water-right deficit costs and junction drain costs are now multiplied by scenario probability, discount factor and block duration. Multi-scenario, discounted or multi-hour-block cases see different trade-offs; single-scenario hourly cases do not change.
- Met reserve requirements no longer lower the objective. The reported total cost is the real operating cost; dispatch and prices do not change.
- Start-up cost in the first hour follows how long the unit has been off (hot, warm or cold start) instead of always being a cold start.
Network and losses
- Losses carry a small cost (
loss_cost_eps, now 0.1 $/MWh). This removes simultaneous flow in both directions and the loss "burning" that small negative prices can cause; total losses are practically unchanged. Set it to 0 for the old formulation. - Flow beyond the loss envelope is priced (
loss_overflow_cost, default: the case's unserved-energy cost), so overloaded lines cannot absorb energy as fictitious losses. - Zero- or near-zero-reactance branches are ideal ties (equal voltage angles at both ends) instead of uncontrolled DC links that could act as free phase shifters.
tiny_reactance_mode: dcrestores the old treatment. - Angle scaling is back to its documented meaning (
scale_thetamultiplies the angle; 1000 = milliradians). Cases that carry a very small value such as1e-4get a warning and should invert it or drop it. Angle limits are now derived from the network whenever they are not set, so they can no longer cap line flows by accident. piecewise_directlosses charge the full transmission toll per MWh.
Unit commitment and storage
- Commitment on non-chronological stages. Units with a commitment now get an on/off status and minimum stable level in every block of load-duration or representative-block stages (start-up, ramps and minimum up/down need chronology and are skipped there). The former simple commitment element is merged into the regular one.
- Reserve and inertia from committed units respect the unit's minimum stable level and its on/off status, so an off unit cannot offer reserve and down reserve is no longer free at minimum load.
- Battery minimum discharge is a hard floor again for batteries without commitment.
- Batteries with commitment cannot charge and discharge in the same block (
exclusive_charge_discharge, default on), so they cannot burn surplus energy through round-trip losses under negative prices. Set it tofalseto allow simultaneous operation. - Hydrogen and thermal storage carry their level between stages by default instead of closing a cycle in every stage (#546).
- Fuel limits count the real fuel burn, including piecewise and hourly heat rates and no-load fuel (#545).
- Existing capacity of an expandable unit is no longer bought again in its first expansion stage, which lowers the objective of such expansion cases.
Hydro and water rights
- A reservoir without an explicit flow-to-volume conversion now uses 0.0036 hm³ per m³/s·h, as documented (the JSON default was 1000 times larger). Set
flow_conversion_rateif your case relied on it. - Global spill and use values apply only to the water rights they are meant for; usage-cost rights are no longer capped at zero flow; rule curves read the stage-start volume; the pass-through arc of a flow right exists only when requested (
use_bypass) and appears in the output.
SDDP and cascade
- Stricter convergence. A "stationary" stop now needs the run's own iterations and a gap below 2 % (was 5 %), and an iteration in which some hydrology samples were infeasible is never declared converged (#551). Short runs may run a few more iterations; the end-of-run summary reports how many samples were dropped and where.
- Hydrology samples are solved scene by scene by default, reusing each solve's basis; bounds are the same, the backward pass is much faster (
aperture_chunk_mode: per_aperturerestores the old grouping). - The future-cost floor comes from the cuts. Models with only non-negative costs that relied on an implicit floor of zero should set
alpha_min: 0. - Cuts built with Ruiz scaling had wrong slopes, so bounds could cross. Cut files saved by such runs should be regenerated.
- Setting the number of hydrology samples to 0 now means none (a deterministic backward pass), and the per-sample time limit is 30 s.
Outputs
- Dual (price) tables list every block, zeros included.
- Element and block identifiers in Parquet outputs are 32-bit integers; large identifiers were previously wrapped.
- Renewable spillover is computed from availability minus dispatch; availability is capped at the unit's maximum output.
Configuration
- A
.gtopt.confin the working directory is no longer read; pass it with--config. Options in the config file now only fill values the case and the command line leave unset. annual_lossis renamedannual_standing_loss(self-discharge while stored); the old name still works with a warning.
Converted cases
- PLEXOS: units without a real commitment decision are LP-relaxed (
--uc-relax nonefor all-integer); reserves are modelled with the native reserve requirements (--reserve-model ucfor the old emulation); constraints without a penalty price are hard, as in PLEXOS; lines PLEXOS does not enforce get non-binding limits; lossless transformers get a correct per-unit susceptance (flows and prices change); fuel transport charges scale with heat rate; battery self-discharge comes from the PLEXOS data. - PLP: a battery charged by a co-located plant no longer curtails that plant (the plant stays on the grid and the battery charge is limited to its output); lines PLP treats as lossless stay lossless; solar and wind profiles are written per unit (re-convert affected cases); zero-cost soft minimum volumes are no longer emitted.
- PSR SDDP: branch impedances are read as % on 100 MVA (they were read as ohms, turning real circuits into ideal ties), and imports are unavailable in hours without an offer.
New modelling capabilities
Network and losses
- Branches with zero or tiny impedance can be modelled as ideal ties or as DC links (
tiny_reactance_mode). - A priced overflow tier for losses beyond a line's loss envelope (
loss_overflow_cost, per case or per line).
Unit commitment and reserves
- Pricing modes for commitment runs (
pricing_mode:fixed,relaxed,fast_start), with automatic fast-start classification and agtopt_pricing_uplifttool for make-whole and lost-opportunity payments. Validated against the classic pricing literature examples. - Dynamic reserve requirements: the requirement in each block is the largest of several planes combining load, inertia, the largest contingency and line flows; load enters from forecast data so reserves do not distort energy prices. Equality requirements, surplus prices and per-plane prices are available.
- Contingency candidates (generators, loads or lines whose loss sets the requirement), inertia credits when enough units of a group are on, cold (offline) reserve, symmetric up/down offers, shared headroom and per-zone effectiveness factors.
- A check that lists every way a reserve requirement depends on dispatch and could create negative price credits (
reserve_coupling). - Feasible commitment starting points for large MIPs, and every MIP that stops at a time limit is re-solved with its commitment fixed, so costs, dispatch and prices are consistent.
Storage and batteries
- Battery reserve deliverability: reserve offers are backed by power headroom and enough state of charge to sustain them, and deployment energy is charged to the battery itself.
- Battery power expansion, with an optional fixed energy-to-power ratio for new storage.
- Storage can be retired during the horizon; a unit commissioned later starts from its stated initial level.
Demand
- Stepwise value of lost load per demand (
fail_segments) or for the whole case (demand_fail_segments), with one shedding output per step.
Gas and emissions
- Gas networks: nodes with pressure limits and gas prices, pipelines (Weymouth flow with optional line pack and elevation), compressors (gas- or electric-driven, with fuel use), supplies with volume allotments, demands, and gas turbines linked to their generators with a minimum supply pressure. Meshed networks are solved by successive linearisation.
- No-load fuel for committed units, fuel-based emission rates, and emission zones limited to a set of buses (#545).
Decision variables and user constraints
- Here-and-now decisions that take one value across all hydrology scenarios (
nonanticipative), for example an LNG cargo plan fixed before inflows are known. - Case-wide decisions that span all planning phases, integer decision variables, user constraints active only in some stages, and stage-average constraints in PAMPL files.
Converters
- PLEXOS: versions 8.1, 9.0 and 10.0; native reserve and battery reserve mapping; inflexible LNG tanks; horizon truncation with end conditions; emission tracking of imports; initial generation for ramp limits; AEMO ISP network augmentations by development path and a new monthly multi-year expansion model of the AEMO ISP (prototype).
- PLP: all failure (falla) tiers as a value-of-lost-load curve (
--falla-segments all); loss tangent count selection (--loss-tangents, defaultdouble= one tangent per PLP loss segment in each flow direction). - PSR SDDP: the full deficit cost curve (
--deficit-segments all). - New converters and inputs:
cucdata2gtopt(the clustered unit-commitment benchmarks on the IEEE 39- and 118-bus systems),gasnet2gtopt(gas networks and published benchmarks), Sienna reserve test systems, and RTS-GMLC reserves and inertia.
Tools
- Data-quality checks after every conversion and before every solve: implausible line impedances and voltage levels, profiles outside 0-1, zero-capacity units with commitment, rewards above failure costs.
- Topology check per stage: electrical islands, zones and interconnectors as the network changes over time.
- Network reduction to zones (for example one bus per country) while keeping chosen interconnectors.
gtopt-fetchdownloads and verifies public operator data.- SDDP and cascade runs can write full results for every cascade level.
Improvements
- The SDDP log explains why each run stopped and how much solver effort each pass took, and reports the upper bound net of irrigation agreement rewards and the effect of end-of-horizon cuts on the gap.
- Unknown option or mode names are errors instead of silently falling back to a default formulation; invalid couplings between elements (for example a turbine active while its generator is not) are reported before the solve.
gtopt --versionand every result file record the exact program version that produced them.- Settings priority is clear: command line, then
--set, then the case file, then.gtopt.conf, then defaults. - Solver parameter files are found next to the case, follow the solver actually used, and are recorded for reproducible re-runs; a solve time limit is one budget per solve.
- The installer can select and auto-detect solvers.
Fixes
Network and losses
- Kirchhoff's voltage law is kept on all surviving loops when a line is out of service in some blocks.
- A line's loss envelope no longer caps its flow.
Unit commitment and reserves
- Reserve rows of units referenced by name and by number now match; units with both a minimum and a maximum number of starts build correctly; relaxed commitments report their actual status.
- Inertia contributions use the committed minimum output and are capped at the unit rating.
Storage and batteries
- Storage commissioned after the first stage no longer starts with free stored energy; out-of-service storage and converters no longer produce energy, heat or hydrogen; expandable converters pay for the capacity they use.
- Batteries with commitment have separate charge and discharge decisions again, so they can operate with both minimum charge and discharge levels.
Hydro and irrigation
- The water value of a spilling reservoir is correct with multi-hour blocks; water-right ledgers debit and credit in the documented direction.
- Irrigation agreements follow the PLP rules more closely (Laja withdrawal cap at the stage-start filtration, no reward for undelivered water).
- Converted PLP seepage no longer caps the upstream reservoir when the downstream outlets are too small.
SDDP and cascade
- Phases with several stages keep their storage chain after the first phase (storage used to restart from its initial level, giving free water); capacity built mid-horizon is carried to later phases.
- Loaded cuts apply to the end-of-phase volume; the first cut of each cell no longer gives an invalid lower bound with negative costs.
- With model reduction on, each hydrology sample sees its own inflows.
- The run status file always ends with a final status.
Gas and emissions
- Gas line pack cannot be refilled for free between stages; emission and fuel penalty costs are reported on the right basis.
Converters
- PLEXOS: batteries with zero rating are out of service, charge power uses the real rating, hourly bound and minimum-volume files are aligned to the right dates, and restarts after outages are allowed.
- PLP: the first boundary cut of the PLP cut file is kept; reduced cascade networks load correctly.
- PSR SDDP: negative water values are kept in the boundary cuts.
- Sienna: thermal minimum output applies only when committed (units were forced on all day). The converter is now
sienna2gtopt;sienna_to_gtoptstill works as a deprecated alias.
Interfaces
- Result summary and time-series export tools read the current output layout; the topology checker handles lines defined in data files; the monitor exits when a run ends.
Performance
- SDDP backward pass much faster by default (hydrology samples solved in sequence on one model with basis reuse), forward solves start from the latest backward basis, and a redundant re-solve after each cut is skipped.
- Lower memory use for large SDDP cases (shared, compressed model snapshots across scenarios).
- Solver warm starts keep the case's solver settings (threads, tolerances, time limits), and parameter files are read once per run.
Security
- LP debug compression no longer goes through a shell; the external compressors are started directly with an argument list.
- Stages whose block range falls outside the block list, very deeply nested constraint expressions and very large index sets are rejected with an error instead of being processed.
.gtopt.confis no longer read from the current working directory (search order--config,$GTOPT_CONFIG,~/.gtopt.conf).- Builds are hardened by default (stack protection, control-flow protection, fortified library calls, read-only relocations), and the binary and plugins no longer search the current directory or the home directory for libraries.
- Cascade cut files are written to a private temporary directory.
- The GUI service accepts only loopback or explicitly allowed host names (
GTOPT_GUI_ALLOWED_HOSTS), requires its own header on write requests, and escapes case values it displays. - Automatic LP diagnostics never send a model to the public NEOS server.
- The binary download helper accepts only verified artifacts of this repository.
- Operator API keys are read only from environment variables and are never written to logs.
- Python dependency minimums raised to versions without known advisories.
1.1.0 - 2026-11-20
GTOpt 1.1.0 is the first release with packaged binaries, and it widens the set of real systems GTOpt can read. Highlights:
- Ready-to-run binaries: a Linux x86_64 build (Ubuntu 24.04+, Debian 13+) with the HiGHS and COIN-OR CBC/CLP solver plugins, its debug symbols, and the Python tools as a wheel (
gtopt_scripts), all with SHA-256 checksums. - More PLEXOS models:
plexos2gtopt --plexos-modelconverts general multi-model PLEXOS databases for a chosen window (used for the Irish SEM model), andplexos2gtopt.aemo_ispbuilds dispatch weeks from the AEMO 2026 ISP model of the Australian NEM (prototype). - Transmission planning inputs:
plp2gtoptreads the CEN works plan (mantlin.csv), so the PET 2027 transmission planning bases convert with lines entering service and changing ratings as planned. - Other converters:
psse2gtoptcost and line-limit overlays and voltage-dependent loads;pp2gtopttime series and representative blocks;sddp2gtoptmulti-file PSR SDDP cases. - Real cases: the companion repository gtopt-cases with cases from Australia, Chile, Guatemala, Ireland, Peru and Poland.
- One home for end-of-horizon cuts:
FutureCostis now the single source of the boundary cuts and every converter emits it; the old boundary-cut option keys still work as deprecated aliases (tools/migrate_future_cost.pyrewrites them). - Inspection: LP files can also be written as MPS, with an optional scaling sidecar;
gtopt --versionreports the exact build revision. - Fixes: code-scanning security findings in the GUI service, the water-value unit of PLP boundary cuts, and Python data files missing from wheel installs.
Upgrading from 1.0.0: cases keep working; run tools/migrate_future_cost.py to move deprecated boundary-cut keys to FutureCost, and see Deprecated below.
The detailed list of changes follows.
Added
plexos2gtoptgeneral PLEXOS databases:--plexos-model,--plexos-start-date,--plexos-sampleand--plexos-data-dirpick one Model of a multi-model PLEXOS XML (scenarios, dated rows, time-of-day patterns, wind/demand Data Files) for a dispatch window; pumped storage becomes a battery, demand-side bids become price-bid generators, banded heat-rate curves are made convex, and constraints without a penalty stay hard. Missing Data Files are fatal only when a converted property needs them. A bare*.xml/*.xml.xzis accepted as input.plexos2gtopt.aemo_isp(prototype): builds an hourly dispatch case for a short window of one scenario of AEMO's 2026 ISP PLEXOS model (buses, demand traces, generators, batteries, flow paths, hydro storages with inflows, daily energy limits); expansion and the PLEXOS constraint set are not converted yet.plp2gtoptreadsmantlin.csv: the transmission works plan of CEN PLP cases (e.g. the PET 2027 transmission-planning bases) is merged afterplpmanli.datblock by block; lines now enter/leave service and change rating, R and X as planned (per-stage voltage/resistance/reactance schedules).psse2gtoptoverlays:--gen-costs(bus,id[,pmax],mw1,cost1,…) and--line-limits(from,to,ckt,tmax) CSV files.- Real cases in gtopt-cases: the public case repository gtopt-community/
gtopt-cases (Australia, Chile, Guatemala, Ireland, Peru, Poland); tools/get_cases.shandtools/cases.lockpin it for the tests that need large external cases (GTOPT_CASES_DIR). pp2gtoptmonthly stages with representative blocks:--stage-period month|week|day(calendar dates from a date column,--start-date, or a non-leap 2023 default) and--block-method ldc|hour-of-daywith--blocks-per-stage Xbuild non-chronological blocks (net-load-duration-curve groups,--ldc-key,--ldc-split hours|energy; or typical-day hour groups) with every element averaged over the same hours, preserving each element's energy per stage.BlockHourMap/block_hour_map.parquet(+simulation.block_hour_map) records which hours form each block.net.storagenow converts to gtopt batteries in time-series mode (--storage,--storage-efficiency).--method sddp(alias of--solver) emits one phase per stage withsddp_options= 100 iterations / 0.01 tolerance when the case has storage andmax_iterations = 0(forward pass only, same result asmonolithic) when it has none (--sddp-max-iterations,--sddp-convergence-tol).gtopt_shared.time_gridgainsBlockGrid,calendar_stage_of_hour,ldc_groups,hour_of_day_groups,chronological_groupsandTimeGrid.block_durations/to_block_grid(existing signatures unchanged).pp2gtopttime-series mode:--profiles FILE(CSV/Parquet, wide or long) turns a pandapower / MATPOWER network plus hourly load and renewable series into ONE multi-block, multi-stage case covering the whole profile horizon (or the--hours A:B/A+Nsub-window):--block-hours Naverages N hours per block,--stage-hours H(--stage-length) sets stage length with one phase per stage (--single-phaseto disable). Writes<out>.json+<out>/Demand/lmax.parquetand<out>/GeneratorProfile/profile.parquet(capacity_profile_array), plus<out>/pp2gtopt_state.json(paths relative to it) replayable with--from-state. Columns map to elements viaload:<ref>,sgen:<ref>,gen:<ref>,load@bus:<b>,load@zone:<z>,load@all, bare names, or a JSON/YAML--profiles-spec(selectors, MW / p.u. / auto units, scale).--profiles-from-netreads pandapowerConstControlprofiles. Also:--matpower/.matinput (--mpc-var),net.sgenconverted as generators,--solver monolithic(default with profiles),--output-format. Sharedgtopt_shared.time_grid(TimeGrid,parse_hour_range,write_block_schedule) for other hourly converters.sddp2gtoptmulti-file PSR SDDP block cases: converts classic.datSDDP studies (COES Peru, AMM Guatemala; SDDP 17.0–18.0 layouts). The converted case covers demand by block and bus, thermal and hydro plants with maintenance and limits, renewables with block profiles, the hydro cascade with reservoirs and historical inflows (one scenario per series), and the DC network with losses and dated circuit changes. It is written as a gtopt SDDP planning with one phase per monthly stage (Parquet schedules). New CLI options:--num-scenariosand--method.FutureCost.iteration_limit: keeps only the boundary cuts of the last N iterations of the source run (0/unset = all), honoured by every method; replaces{sddp,monolithic}_options.boundary_max_iterations.FutureCost.missing_cut_var_modeis also new, andFutureCost.valuationis now typedBoundaryCutsValuation(end_of_horizon/present_value), the type the cut loader actually uses.tools/migrate_future_cost.py: rewrites the deprecated boundary-cut keys of planning JSON files ontosystem.future_cost_array, preserving formatting (--method-rules,--dry-run).gtopt_check_jsoncheckfuture_cost_aliases: warns on each deprecated boundary-cut key and reports conflicting values as critical.- MPS output for
--lp-file: new--lp-format lp|mpsoption (defaultlp, unchanged); a--lp-fileending in.mpsalso selects MPS. Names and integer columns are preserved (MARKERsections;BVbounds for binaries on OSI/CBC) by every backend (cuOpt writes only MPS). An explicit request the backend cannot honour is an error; the diagnostic dumps fall back to the other format.--lp-compressionalso compresses the--lp-filedump.SolverBackend::write_lp(filename, LpFileFormat)now takes the format and returnsbool, andk_solver_abi_versionis bumped to 16, so out-of-tree solver plugins must implement it for both formats and be rebuilt. - LP scales sidecar (
--lp-scales, optionlp_scales): when an LP file is written with--lp-file, also write<stem>.scales.json(gtopt-lp-scales/1, serialised with daw::json) with what the.lp/.mpscannot carry: the objective scale, the per-block and per-stagecost_factorweights and, at thefulllevel, the columns and rows whose scale is not 1 (columns with their gtopt element and physical unit) in two zstd Parquet tables,<stem>.scales_cols.parquetand<stem>.scales_rows.parquet. A solution read back from an external solver can then be mapped to physical units. The JSON also records the gtopt build (version and git revision) and the model's numerical ranges (matrix, objective, bounds, RHS, scale factors, per constraint family). Levelsnone(default),summary(JSON only) andfull(true); the JSON follows--lp-compression. The model file is unchanged. Seedocs/lp-scales.md. gtopt::build_info(): version andgit describerevision of the running build, refreshed at build time, for audit trails in generated files.
Changed
- FutureCost is the single source of the FCF boundary cuts: the
system.future_cost_arrayelement configures the boundary cuts for every method (monolithic, SDDP, cascade); a method never reads another method's options. The monolithic solver no longer honourssddp_options.boundary_cuts_mean_shift,missing_cut_var_mode,scale_alphaorcut_coeff_eps(it usesFutureCost.scale_alphaand the defaultcut_coeff_eps). A relativecuts_filenow resolves againstoptions.input_directoryunder monolithic too, and a single-phase SDDP run falling back to monolithic now loads the cuts.use_user_alphatogether withcuts_fileis an error under monolithic as under SDDP. Generic extra linear constraints belong inUserConstraint. - Converters emit FutureCost:
plp2gtopt,plexos2gtopt,sddp2gtoptandigtoptwritesystem.future_cost_arrayand never the legacy keys;plp2gtopt's emissions ray no longer overwrites a usercuts_file.
Deprecated
- Boundary-cut option keys are now aliases of FutureCost fields, translated once at planning load (after
--set) with a warning:sddp_options.boundary_cuts_file,boundary_cuts_mode,boundary_cut_sharing_mode,boundary_cuts_mean_shift,boundary_max_iterations,missing_cut_var_mode(honoured only forsddp/cascade);monolithic_options.boundary_cuts_file,boundary_cuts_mode,boundary_cut_sharing_mode,boundary_max_iterations(only formonolithic);simulation.boundary_cuts_file,boundary_cuts_valuation(any method). A key of the other method is ignored with a warning; different values for the same field are a hard error.
Removed
BoundaryCutSoftCostenum: the former type ofFutureCost.valuationwas never read by the cut loader.
Fixed
- Security (code scanning): the guiservice-plus AI chat route no longer fetches a browser-supplied URL (Ollama/custom endpoints must be allow-listed in
GTOPT_AI_ALLOWED_BASE_URLS); guiservice error responses return an error id instead of exception text, and/api/logsomits tracebacks. psse2gtoptloads: constant-current and constant-impedance load components are evaluated at the solved bus voltage (PL + IP·VM + YP·VM²); negative loads become fixed injections instead of being dropped.plp2gtopt: boundary-cutefin_costused the wrong volume unit.PlanosParser.lower_bound_water_value_by_reservoir(the cut water value that overwritesReservoir.efin_costunder--soft-storage-bounds) still scaled plpplem2 gradients by the per-reservoir10^(FEscala-6), the FEscala mis-reading theboundary_cuts.csvwriter dropped on 2026-07-12.efin_costwas off from the cuts gtopt loads by10^(9-FEscala)(×10 low for FEscala=8, ×10 high for FEscala=10). Both now use the shared uniformPLANOS_GRAD_SCALE($/dam³ → $/hm³, ×1000); theapply_fescalakeyword becamegrad_scale.- Python tools: runtime data files missing from non-editable installs.
pip install ./scripts(wheel) did not shipplexos2gtopt/data/cen_pcp_hard_ucs.txt, theplexos2gtopt/plp2gtoptsolvers/*.prm|*.optsfiles, thegtopt_expandwhitelist CSVs, nor the repo-rootshare/gtopt/{emissions,cogen}tables, and every loader silently fell back:plexos2gtoptdemoted ~90–110 CEN user constraints per case from HARD to SOFT, used the bare IPCC emission factors instead ofcen_chile.json, tagged no cogen units and wrote nosolvers/directory. All files are now package data;cen_chile.jsonandcen_chile_cogen.csvmoved fromshare/gtopt/toscripts/gtopt_shared/data/{emissions,cogen}/(single copy; the C++ side only readsshare/gtopt/{naming,unit}_dialects.json), and the duplicateplp2gtopt/templates/ror_equivalence.csvwas dropped in favour ofgtopt_expand/templates/. A missing required file now raisesgtopt_shared.resources.MissingDataFileErrorwith a reinstall hint. The three copies of the cogen loader were merged intogtopt_shared.cen_cogen(thegtopt_marginal_unitscopy looked one directory above the repo root and never found the CSV). A newpytest -m wheeltest builds and installs the wheel and checks every file; the Scripts CI workflow runs it. Cases converted with an affected install must be reconverted. future_cost_arraydropped on planning merge:System::mergedid not mergefuture_cost_array, so a FutureCost element read from a planning file was silently ignored.
Testing
test_water_fail_cost_magnitude.pyruns on the publishedplp_2ycase (previously on a private case). Thelost_pfreference table was recomputed from plp_2y data with its derivation documented, and is checked end to end (efin_cost = anchor × lost_pf × 1e6/3600); the boundary-cut overwrite is checked separately against the emittedboundary_cuts.csv. The old tests asserted obsolete defaults:efin_costis only emitted with--soft-storage-bounds(hard bounds by default) and--no-cuts-govern-terminal, and the defaultphi_expectationCSV is no longer pre-divided byNVarPhi.- Monolithic keeps the boundary cuts of an SDDP-converted case: new doctest pins that a FutureCost element (what the converters emit) loads under
method = monolithic.
1.0.0 - 2026-11-18
First public release of GTOpt, the open-source optimizer for planning and operating energy systems, under AGPL-3.0-or-later with the GTOpt Solver Plugin Exception. It includes:
- One model from minutes to decades: expansion planning of generation, transmission, storage and demand; hydrothermal scheduling with SDDP and multi-level cascade SDDP; unit commitment (three-bin MIP) and economic dispatch with DC power flow and line losses.
- Storage and hydro: reservoirs, cascades, pumped hydro and batteries with water values and storage opportunity costs, and irrigation agreements written as PAMPL user constraints.
- Emissions, reserves and other energy carriers: emission prices and caps by zone, reserves and inertia, hydrogen, ammonia, thermal storage and LNG in the same LP.
- Solvers as plugins: HiGHS, CBC/CLP, CPLEX, Gurobi, MindOpt, SCIP and cuOpt, loaded at run time.
- Converters from PLP, PLEXOS, PSR SDDP, PSS/E, pandapower and other formats, with open JSON/Parquet inputs and outputs.
- Interfaces: command line, Python tools, a browser GUI and a REST web service.
- Documentation: the full LP/MIP formulation and the white paper, with validation on IEEE networks, pandapower, published SDDP benchmarks and the Chilean daily schedule.
1.0.0 is a source release: build from source, or use 1.1.0 or later for packaged binaries. The changes made just before the release are listed below.
Added
- Unit commitment (three-bin formulation): full implementation of the Morales-España tight-and-compact UC model with status ( \(u\)), startup ( \(v\)), and shutdown ( \(w\)) binary variables per committed generator.
- Core constraints: logical transition (C1), generation bounds (C2), exclusion (C3).
- Ramp constraints (C4–C5): tight state-dependent ramp-up/down limits with separate startup/shutdown ramp parameters.
- Minimum up/down time (C6–C7): aggregated formulation at period level with correct handling of non-uniform block durations.
- Hot/warm/cold startup cost tiers (C8–C10): time-dependent startup costs based on offline duration with validation and graceful fallback.
- Piecewise linear heat rate curves: multi-segment fuel cost modeling with per-segment emission accounting and segment-bound constraints.
- Commitment periods: optional coarser binary variable resolution to reduce integer variable count.
- LP relaxation control: per-element (
relaxflag) and per-phase (model_options.relaxed_phases) withPhaseRangeSetexpression parser supporting"all","none", ranges, and comma-separated indices. - Reserve-UC integration: reserve headroom constraints become conditional on commitment status ( \(P_\max \cdot u\) instead of fixed \(P_\max\)).
- Must-run mode: forces \(u = 1\) for baseload or contractually committed units.
- Chronological gating: UC only applies on stages with
chronological: true; non-chronological stages dispatch normally (backward compatible). - New
Commitmentstruct (commitment.hpp) with JSON serialization. - New
CommitmentLPclass (commitment_lp.{hpp,cpp}) with full output. - Comprehensive test suite: 40+ test cases in
test_commitment.cpp(2600+ lines) covering all constraint types, edge cases, and regression tests. - Documentation:
docs/unit-commitment.md— dedicated guide with formulation, JSON reference, worked examples, and academic references.
- Emission cost and cap framework:
generator.emission_factor(tCO₂/MWh): per-generator CO₂ intensity.model_options.emission_cost($/tCO₂): system-wide carbon price, adds cost adder to dispatch and per-segment fuel costs.model_options.emission_cap(tCO₂/year): per-stage CO₂ cap with endogenous carbon pricing via constraint dual variable.
- Stage chronological flag:
stage.chronologicalboolean field enables block-sequential UC constraints on specific stages while leaving non-chronological stages for expansion planning. - SDDP cut types: optimality and feasibility cuts are now distinguished in the SDDP solver, with named cut coefficients for better diagnostics.
- Variable scaling:
VariableScaleMapsupport and decoupledflow_scaleoption for improved numerical conditioning of large hydro models. - Enum options framework: solver options now use typed enums instead of raw strings, with compile-time validation.
- Solver timeouts: configurable time limits for LP solves; the solver abandons and reports partial results when the limit is exceeded.
- Single-phase SDDP-to-monolithic fallback: when the problem has only one phase, the SDDP solver automatically falls back to the monolithic solver instead of failing.
- SDDP hot-start:
sddp_hot_startoption to load cuts from a previous run and resume SDDP iterations. - plp2gtopt scale options:
--auto-rsv-energy-scaleand--auto-energy-scaleflags for automatic variable scaling during PLP conversion. - Hydro worked example: Example 5 (simple hydro cascade) added to
PLANNING_GUIDE.md. - CHANGELOG.md: this file.
Changed
- Batteries now self-discharge 4 %/month by default (behaviour change). A
Batterywhoseannual_lossis absent uses0.48p.u./year (0.04 × 12, linear convention: hourly drainannual_loss/8760), the combined lithium-ion cell + BMS figure from Battery University BU-802b (cell 1–2 %/month + ≈ 3 %/month protection circuit) and the Wikipedia "Self-discharge" table (Li-ion 2–3 %/month). Besides realism it removes the cost-free charge/discharge zig-zag across blocks whenever the marginal energy has a positive price (it does NOT break the tie when the window price is exactly 0, nor same-block simultaneous operation). Newmodel_options.battery_annual_lossoverrides the default case-wide; restore the old lossless behaviour with--set model_options.battery_annual_loss=0(orannual_loss: 0per battery). Explicit per-battery values, including0, win; Reservoir and other storages are unaffected. gtopt logs once (INFO) how many batteries took the default. Results of every case with batteries that omitannual_losschange slightly (CEN PCP weeks, AEMO ISP weeks, PLP-converted cases, PET27). - Battery power-envelope valid inequality on by default (behaviour change): each battery converter emits, per block,
p_charge/Pc_max + p_discharge/Pd_max ≤ 1(Converter/power_enveloperows, row-scaled bymax(Pc, Pd)), cutting simultaneous full-power charge + discharge — the vertex a lossy battery uses to dump surplus energy at zero/negative prices. Partial simultaneous operation inside the envelope is still LP-feasible (only binaries remove it). Skipped when one direction has no rating or the hardpmin_*floors force a point outside the envelope. Disable with--set model_options.battery_power_envelope=false. - Converters write explicit
annual_lossfor non-lithium "batteries":plexos2gtopt --plexos-modelpumped storage rewritten as a Battery (SEM Turlough Hill) andsienna_to_gtoptPHES getannual_loss: 0(type: pumped_hydro/pumped);plp2gtoptemitsannual_loss = −12·ln(1 − mloss/100)for a nonzeroplpess.datmloss[%/month] (exact PLPgenpdess.fper-block drain) and omits it formloss = 0/plpcenbat.datso the gtopt default applies. This also fixes the DCMod=2 regulation-tank Reservoirannual_loss, previouslymloss × 12(100× too large:mlossis a percentage). - FutureCost is the single source of the FCF boundary cuts: the
system.future_cost_arrayelement configures the boundary cuts for every method (monolithic, SDDP, cascade); a method never reads another method's options. The monolithic solver no longer honourssddp_options.boundary_cuts_mean_shift,missing_cut_var_mode,scale_alphaorcut_coeff_eps(it usesFutureCost.scale_alphaand the defaultcut_coeff_eps). A relativecuts_filenow resolves againstoptions.input_directoryunder monolithic too, and a single-phase SDDP run falling back to monolithic now loads the cuts.use_user_alphatogether withcuts_fileis an error under monolithic as under SDDP. Generic extra linear constraints belong inUserConstraint. - Converters emit FutureCost:
plp2gtopt,plexos2gtopt,sddp2gtoptandigtoptwritesystem.future_cost_arrayand never the legacy keys;plp2gtopt's emissions ray no longer overwrites a usercuts_file.
Deprecated
- Boundary-cut option keys are now aliases of FutureCost fields, translated once at planning load (after
--set) with a warning:sddp_options.boundary_cuts_file,boundary_cuts_mode,boundary_cut_sharing_mode,boundary_cuts_mean_shift,boundary_max_iterations,missing_cut_var_mode(honoured only forsddp/cascade);monolithic_options.boundary_cuts_file,boundary_cuts_mode,boundary_cut_sharing_mode,boundary_max_iterations(only formonolithic);simulation.boundary_cuts_file,boundary_cuts_valuation(any method). A key of the other method is ignored with a warning; different values for the same field are a hard error.
Removed
BoundaryCutSoftCostenum: the former type ofFutureCost.valuationwas never read by the cut loader.Emission options replaced by
EmissionZone:model_options.emission_costandmodel_options.emission_capwere removed (and are now rejected as unknown options). A carbon price is now a zonepriceand a cap a zonecap(hard) orcap+cap_cost(soft); generators are linked throughemission_source_array(orGenerator.emissions[]/Fuel.emission_factors[]).Commitment.fuel_emission_factor(withpmax_segments,heat_rate_segments,fuel_cost) was removed fromCommitment; the piecewise curve lives onGenerator. Migration:"emission_array": [{"uid": 1, "name": "co2"}], "emission_zone_array": [ {"uid": 1, "name": "system_co2", "emissions": [{"emission": "co2", "weight": 1.0}], "price": 30.0, "cap": 500000.0} ], "emission_source_array": [ {"uid": 1, "name": "coal_co2", "generator": "coal", "zone": "system_co2", "emission": "co2", "rate": 0.95} ]
replaces
"model_options": {"emission_cost": 30, "emission_cap": 500000}with"emission_rate": 0.95oncoal. Seedocs/emissions.md.- Shared arrow input-index cache: the long-format input reader's
(Stage, Block)row index is built once and shared — across every per-(scene, phase) LP cell within a run, and across cascade levels (each level previously rebuilt it cold). LP-only build on a 5-year 8-scene case: 256 s → 30.7 s and 20 GiB → 7 GiB; the cascadetransport → full_networklevel transition: 213 s → 28 s (7.6×). LinearInterfacedecomposition (state): the matrix conditioning statistics, the name/label subsystem, and the Ruiz/equilibration scaling state were extracted into behaviour-free value types (MatrixStats,LpLabelStore,ScalingState+ relocatedScaledViewinmatrix_stats.hpp/lp_label_store.hpp/lp_scaling.hpp), each with isolation unit tests. Behaviour and COW clone semantics are unchanged.- clang-tidy hygiene: every broad file-wide
NOLINTBEGIN/ENDblanket in production code was replaced by a real fix or a narrow, documented per-site suppression. - Options refactor: SDDP options no longer require the
sddp_prefix (e.g.,max_iterationsinstead ofsddp_max_iterations). Old names are still accepted for backward compatibility. - MonolithicOptions: monolithic solver options are now grouped under a dedicated
MonolithicOptionsstruct for clarity. as_labeloptimization: label generation usesstd::to_charsfor faster integer-to-string conversion, measurably improving LP construction time on large cases.- SDDP cut I/O refactor: extracted
sddp_cut_ioandsddp_monitormodules fromsddp_solverfor better separation of concerns. - SDDP aperture module: extracted
sddp_aperturefor cleaner decomposition of the SDDP algorithm.
Fixed
- File-backed battery schedules on the synthesized elements: a unified battery's file-backed
active,pmax_discharge,discharge_cost,pmax_charge,pmin_charge,charge_costorpmin_discharge(e.g."active": "act") was copied verbatim onto<bat>_gen/<bat>_dem/<bat>_conv/uc_<bat>_gen, which then looked up their own class directory and uid (Generator/actfor the generator's uid) and failed ("Can't read table for class 'Generator'…" / "Can't find element …").expand_batteriesnow rewrites such references to"Battery@<field>#<battery uid>"— a new#<uid>suffix of the<Class>@<field>file-reference grammar — and the synthesized elements also inherit the battery'sactiveschedule. - Battery charge/discharge decoupled when one direction had no rating: when
pmax_chargewas 0 in a block (orpmax_dischargeunder--lp-reduction), the synthetic charge demand (discharge generator) column is elided andConverterLPskipped BOTH coupling rows, leaving the battery'sfinpcolumn free in[0, +inf)— free charging, energy from nowhere — and the discharge generator as free generation atdischarge_cost. The uncoupled battery-side flow is now pinned to 0 and the surviving direction is still coupled. A battery withpmax_charge = 0in EVERY block of a stage also no longer throws (flat_map::at) — tolerantlookup_load_cols. Affects cases with maintenance windows that zero a battery's charge or discharge rating (plp2gtoptplpmanbat/plpmaness, PLEXOS per-block ratings). - Work-pool swap gate no longer latches closed on cold swap: the process-
VmSwapdispatch gate blocked new tasks wheneverVmSwapwas at/above a hard-coded 2048 MB.VmSwapcounts pages that are on swap, so once the kernel had parked cold pages there (other load on the host, with zero swap I/O) the gate never reopened and the pool ran only the one always-admitted task (Active: 1/31, "process VmSwap 3343 MB >= 2048 MB", "stall recovery nudge fired" for over an hour on a host with ~120 GB available). The gate now engages only whileVmSwapis over the limit and still growing by more than a delta per 5 s window (SwapGrowthGate), releases after one quiet window, and logs one info line on engage and on release with the reason. Both knobs are now exposed:sddp_options.pool_max_process_swap_mb(default 2048,0= off; CLI--swap-limit) andsddp_options.pool_swap_growth_mb(default 64; CLI--swap-growth). - Irrigation agreements — PLP-fidelity revision (deep review vs
genpdmaule.f/genpdlajam.f). Maule: La Invernada IQRNIN/IQNINV rule only whenRelaxInvern = Fand no phantomecon_invernada(CIPRESES no longer taxed); ordinary-reserve ledgers provisioned perFijaMaule; annual/seasonal counters emitted as remaining-rights ledgers (non-negative state value); Res. 105qa105 ≤ min(qarmr, QRiego105)with districtretiro + deficit = pct · qa105(Melado an equality + deficit); manual-year tables and Cota 425 honoured. Laja:laja_retiro_maximono longer carries the seepage term (it priced the lake's water NEGATIVE), PLP costs pinned by default (--no-pin-agreement-coststo opt out), economies only under the 1958 agreement, manual withdrawals applied, WARN for unmodelled forced flows andini_econ.validate_planningrejects a rewarded FlowRight (uvalue > 0) with no junction and no UserConstraint reference. VolumeRight.bound_ruleunits: the rule volume [hm³] is converted to a rateV / (0.0036 · stage_hours)before capping the extraction;initial_rule_bound(VolumeRight and FlowRight) reads the predecessor phase's reservoirefininstead of the caseeini;update_lpno longer skips an unchanged bound (stale underlow_memory).- SDDP stop during the forward pass: a
request_stop/ sentinel / API stop hit mid-forward (ErrorCode::Cancelled) is no longer counted as an infeasible scene — no cut rollback, no "all scenes infeasible" abort; the partial iteration is discarded and the run proceeds to the simulation pass and output. - AMPL registry race: the user-constraint silent-zero lookups (
find_ampl_variable_for_element,find_ampl_class_attribute) scanned every (scene, phase) cell while other scene threads were writing theirs — a data race that segfaulted the plp_2y irrigation build. They now read a mutex-guarded registration index. - SDDP hot start: a requested hot start that ends cold (cuts file ignored because
recovery_mode = none— i.e. no--recover—, load error, empty file or missing cut directory) now logsSDDP HotStart: cuts=cold … NOT applied: <reason>at WARN. - Irrigation — end-to-end findings (new PLP → plp2gtopt → gtopt e2e suite): an irrigation-diversion FlowRight whose PotMax is the PLP 9999 sentinel was emitted without
fmax, which the C++ resolves to 0 — the offtake was pinned shut (plp_2y: RieSur123SCDZ, hence every Res. 105 district, and RieSaltos); it now carriesPotMax / Rendi. The season re-provision reads the stage-start reservoir volume (VolIni, genpdlajam.f:575-576) instead of(vini + vfin)/2. The Laja anticipado up-counter has no outflow (fmax: 0; a free extraction let the LP drain it and dodge the December debit). A fixed-discharge Flow folded bylp_reductionstays resolvable in user constraints (constant moved to the RHS).validate_planningwarns on abound_rulewith no segments. - Rights ledgers — free disposal (
VolumeRight.forfeit): a zero-costforfeitcolumn lets unused rights be dropped, like a free spillway. On plp_2y the Maule ledgers carried negative balance duals (degenerate cap vertex, oremax < einiforcing use) that SDDP cuts propagated upstream (allmaule_vol_gasto_riego_tempcut slopes were negative). The Laja and Maule templates now setforfeit: trueon every depletion ledger (not on up-counters or economies). plexos2gtopt.aemo_isphydro: reservoirs carryflow_conversion_rate = 0.0036andMax Spill; pumped-storage units (Pump Load/Pump Efficiency: Kidston, Shoalhaven, Wivenhoe, Tumut 3) pump through a tail → headWaterway+Pump+ flexibleDemand; week-start levels follow the source data (horizon-startInitial Volume, elseTarget Week/Target, elseInitial VolumeaboveMin Volume, else mid level). The end of the week is constrained only by the source data (Target Week→efin,End Effects MethodRecycle →efin = eini); the other (Free) storages get a hard, unpricedefin = eini(--hydro-end hold, the default;--hydro-end freedrops it). A single week has no future value of water (it should come from SDDP cuts).--hydro-water-value Vis an opt-in end value (softefin = eini, shortfall at V × the cascade's MWh per hm³).--legacyis unchanged.- Solver registry crash on failed plugin validation: requesting a solver whose plugin fails subprocess validation (e.g. a transient license error) crashed with SIGSEGV instead of falling back to the next backend — an erased-iterator increment in
SolverRegistry::ensure_solver_loaded. - Planning-level solver pin honored: the programmatic
options.lp_matrix_options.solver_namepin was silently ignored — LP construction always re-resolved the default solver (GTOPT_SOLVER / plugin priority), including across cascade levels. - MindOpt backend:
MDOstartenvlicense validation is retried with backoff (transientMDO_INVALID_LICENSEunder heavy parallel load);LIBMILP_PATHis self-derived from the loadedlibmindopt.soso MIP solves work without user environment setup. SOS2 stays unsupported on purpose: MindOpt 2.3.0 mis-handles SOS2 on real models (silent non-enforcement or spurious infeasibility — verified with minimal probes), so the fail-fast "switch solver" error is kept. - Exit codes: the solver now returns correct exit codes (0=optimal, 1=non-optimal, 2=input error, 3=internal error) instead of always returning 0.
- Logging: log messages no longer interleave in multi-scene SDDP solves; per-scene log context is now properly scoped.
flat_mapportability: replacedstd::flat_mapwithgtopt::flat_mapinsddp_cut_ioto ensure compatibility across compilers.
Testing
- +160 unit tests: coverage increased from 71.5% to 77.3%, with new tests for
sddp_cut_io,sddp_monitor, battery expansion, reservoir efficiency, variable scaling, and enum options.