sdom.export_results#

sdom.export_results(results, case: str, output_dir: str = './results_pyomo/')[source]#

Export optimization results to CSV files.

Writes the results from an OptimizationResults object to CSV files in the specified directory. Creates output directory if it doesn’t exist.

Parameters:
  • results (OptimizationResults) – The optimization results object from run_solver().

  • case (str or int) – Case identifier used in output filenames to distinguish between different scenarios or runs.

  • output_dir (str, optional) – Directory path for output files. Defaults to ‘./results_pyomo/’. Directory will be created if it doesn’t exist.

Returns:

  • None

  • Output Files

  • ————

  • OutputGeneration_{case}.csv – Hourly dispatch results containing: Scenario, Hour, Solar PV/Wind generation and curtailment, Thermal, hydro, nuclear, other renewables generation, Storage net charge/discharge, imports, exports, Load.

  • OutputStorage_{case}.csv – Hourly storage operation for each technology: Hour, Technology, Charging power (MW), Discharging power (MW), State of charge (MWh).

  • OutputSummary_{case}.csv – Summary metrics including: Total costs, Installed capacities by technology, Total generation by technology, Demand statistics, Cost breakdowns (VRE, storage, thermal CAPEX/FOM/VOM).

  • OutputThermalGeneration_{case}.csv – Disaggregated hourly thermal generation by plant (only if more than one thermal plant exists).

  • OutputInterregionalExchanges_{case}.csv – Hourly per-line interregional exchanges (PRD §2.4 schema). Emitted only for zonal runs (Network = AreaTransportationModelNetwork) when results.interregional_exchanges_df is non-empty. Columns: line_id, from_area, to_area, hour, flow_signed_MW, flow_FT_MW, flow_TF_MW, cap_FT_MW, cap_TF_MW, utilization_FT, utilization_TF. Row count is |L| * n_hours.

Notes

This function accepts either an OptimizationResults dataclass (new API) or the legacy tuple return from run_solver (deprecated).