{ "cells": [ { "cell_type": "markdown", "source": [ "# `System` library management with `PowerSystemCaseBuilder.jl`" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Originally Contributed by**: Clayton Barrows" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Introduction" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "[PowerSystemCaseBuilder.jl](github.com/NREL-SIIP/PowerSystemCaseBuilder.jl) provides a utility to manage a library of `System`s.\n", "The package has utilities to list the available system data and to create instances of each system. By keeping track of which systems\n", "have been constructed locally, it makes the re-instantiation of systems efficient by utilizing the serialization features and avoiding\n", "the parsing process for systems that have been previously constructed." ], "metadata": {} }, { "cell_type": "markdown", "source": [ "### Dependencies" ], "metadata": {} }, { "outputs": [], "cell_type": "code", "source": [ "using PowerSystemCaseBuilder" ], "metadata": {}, "execution_count": 1 }, { "cell_type": "markdown", "source": [ "### List all systems in library" ], "metadata": {} }, { "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Category: MatPowerTestSystems\n", "\n", "┌──────────────────────────────┬───────────────────────────────────┐\n", "│ Name │ Descriptor │\n", "├──────────────────────────────┼───────────────────────────────────┤\n", "│ matpower_ACTIVSg10k_sys │ ACTIVSg10k Test system │\n", "│ matpower_ACTIVSg2000_sys │ MATPOWER ACTIVSg2000 Test system │\n", "│ matpower_RTS_GMLC_sys │ Matpower RTS-GMLC Test system │\n", "│ matpower_case14_sys │ Matpower Test system │\n", "│ matpower_case24_sys │ Matpower Test system │\n", "│ matpower_case2_sys │ Matpower Test system │\n", "│ matpower_case30_sys │ Matpower Test system │\n", "│ matpower_case3_tnep_sys │ Matpower Test system │\n", "│ matpower_case5_asym_sys │ Matpower Test system │\n", "│ matpower_case5_dc_sys │ Matpower Test system │\n", "│ matpower_case5_gap_sys │ Matpower Test system │\n", "│ matpower_case5_pwlc_sys │ Matpower Test system │\n", "│ matpower_case5_re_intid_sys │ Matpower Test system │\n", "│ matpower_case5_re_sys │ Matpower Test system │\n", "│ matpower_case5_re_uc_pwl_sys │ Matpower Test system │\n", "│ matpower_case5_re_uc_sys │ Matpower Test system │\n", "│ matpower_case5_strg_sys │ Matpower Test system │\n", "│ matpower_case5_sys │ Matpower Test system │\n", "│ matpower_case5_th_intid_sys │ Matpower Test system │\n", "│ matpower_case5_tnep_sys │ Matpower Test system │\n", "│ matpower_case6_sys │ Matpower Test system │\n", "│ matpower_case7_tplgy_sys │ Matpower Test system │\n", "│ matpower_frankenstein_00_sys │ Matpower Frankenstein Test system │\n", "└──────────────────────────────┴───────────────────────────────────┘\n", "\n", "Category: PSITestSystems\n", "\n", "┌───────────────────────────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐\n", "│ Name │ Descriptor │\n", "├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n", "│ RTS_GMLC_sys │ RTS-GMLC Full system from git repo for day-ahead simulations │\n", "│ batt_test_case_b_sys │ test system for Storage Energy Target formulation(case-b) │\n", "│ batt_test_case_c_sys │ test system for Storage Energy Target formulation(case-c) │\n", "│ batt_test_case_d_sys │ test system for Storage Energy Target formulation(case-d) │\n", "│ batt_test_case_e_sys │ test system for Storage Energy Target formulation(case-e) │\n", "│ batt_test_case_f_sys │ test system for Storage Energy Target formulation(case-f) │\n", "│ c_duration_test │ 1 Bus for duration testing │\n", "│ c_linear_pwl_test │ 1 Bus lineal PWL linear testing │\n", "│ c_market_bid_cost │ 1 bus system with MarketBidCost Model │\n", "│ c_ramp_test │ 1-bus for ramp testing │\n", "│ c_sos_pwl_test │ 1 Bus lineal PWL sos testing │\n", "│ c_sys14 │ 14-bus system │\n", "│ c_sys14_dc │ 14-bus system with DC line │\n", "│ c_sys5 │ 5-bus system │\n", "│ c_sys5_bat │ 5-bus system with Storage Device │\n", "│ c_sys5_bat_ems │ 5-bus system with Storage Device with EMS │\n", "│ c_sys5_dc │ Systems with HVDC data in the branches │\n", "│ c_sys5_ed │ 5-bus System for Economic Dispatch Simulations │\n", "│ c_sys5_hy │ 5-bus system with HydroDispatch │\n", "│ c_sys5_hy_ed │ 5-bus system with Hydro-Power for Economic Dispatch Simulations │\n", "│ c_sys5_hy_ems_ed │ 5-bus system with Hydro-Power for Economic Dispatch Simulations │\n", "│ c_sys5_hy_ems_uc │ 5-bus system with Hydro-Power for Unit Commitment Simulations │\n", "│ c_sys5_hy_uc │ 5-bus system with Hydro-Power for Unit Commitment Simulations │\n", "│ c_sys5_hybrid │ 5-bus system with Hybrid devices │\n", "│ c_sys5_hybrid_ed │ 5-bus system with Hybrid devices and thermal devices for ED. │\n", "│ c_sys5_hybrid_uc │ 5-bus system with Hybrid devices and thermal UC devices │\n", "│ c_sys5_hyd │ 5-bus system with Hydro Energy Reservoir │\n", "│ c_sys5_hyd_ems │ 5-bus system with Hydro Energy Reservoir │\n", "│ c_sys5_il │ System with Interruptible Load │\n", "│ c_sys5_ml │ │\n", "│ c_sys5_pglib │ 5-bus with ThermalMultiStart │\n", "│ c_sys5_pglib_sim │ 5-bus with ThermalMultiStart for simulation │\n", "│ c_sys5_phes_ed │ 5-bus system with Hydro Pumped Energy Storage for Economic Dispatch Simulations │\n", "│ c_sys5_pwl_ed │ 5-bus with pwl cost function │\n", "│ c_sys5_pwl_ed_nonconvex │ 5-bus with SOS cost function for Economic Dispatch Simulations │\n", "│ c_sys5_pwl_uc │ 5-bus with SOS cost function for Unit Commitment Simulations │\n", "│ c_sys5_re │ 5-bus system with Renewable Energy │\n", "│ c_sys5_re_only │ 5-bus system with only Renewable Energy │\n", "│ c_sys5_reg │ 5-bus with regulation devices and AGC │\n", "│ c_sys5_uc │ 5-bus system for Unit Commitment Simulations │\n", "│ c_sys5_uc_non_spin │ 5-bus system for Unit Commitment with Non-Spinning Reserve Simulations │\n", "│ c_sys5_uc_re │ 5-bus system for Unit Commitment Simulations with Renewable Units │\n", "│ hydro_test_case_b_sys │ test system for HydroGen Energy Target formulation(case-b) │\n", "│ hydro_test_case_c_sys │ test system for HydroGen Energy Target formulation(case-c) │\n", "│ hydro_test_case_d_sys │ test system for HydroGen Energy Target formulation(case-d) │\n", "│ hydro_test_case_e_sys │ test system for HydroGen Energy Target formulation(case-e) │\n", "│ hydro_test_case_f_sys │ test system for HydroGen Energy Target formulation(case-f) │\n", "│ modified_RTS_GMLC_DA_sys │ Modified RTS-GMLC Full system for day-ahead simulations\\n with modifications to reserve definitions to improve feasibility │\n", "│ modified_RTS_GMLC_RT_sys │ Modified RTS-GMLC Full system for real-time simulations\\n with modifications to reserve definitions to improve feasibility │\n", "│ modified_RTS_GMLC_realization_sys │ Modified RTS-GMLC Full system for real-time simulations\\n with modifications to reserve definitions to improve feasibility │\n", "│ modified_tamu_ercot_da_system │ Modified tamu ercot day ahead system │\n", "│ test_RTS_GMLC_sys │ RTS-GMLC test system with day-ahead forecast │\n", "└───────────────────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘\n", "\n", "Category: PSSETestSystems\n", "\n", "┌─────────────────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────┐\n", "│ Name │ Descriptor │\n", "├─────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────┤\n", "│ psse_240_case_renewable_sys │ PSSE 240 Bus Case system with Renewables https://www.nrel.gov/grid/test-case-repository.html │\n", "│ psse_3bus_SEXS_sys │ PSSE 3-bus Test system with SEXS │\n", "│ psse_3bus_gen_cls_sys │ PSSE 3-bus Test system with CLS │\n", "│ psse_3bus_no_cls_sys │ PSSE 3-bus Test system without CLS │\n", "│ psse_ACTIVSg2000_sys │ PSSE ACTIVSg2000 Test system │\n", "│ psse_Benchmark_4ger_33_2015_sys │ PSSE Benchmark system │\n", "│ psse_OMIB_sys │ PSSE OMIB Test system │\n", "│ psse_RTS_GMLC_sys │ PSSE .raw RTS-GMLC system │\n", "│ psse_renewable_parsing_1 │ PSSE 3-bus Test system with REPCA, REECB and REGCA │\n", "│ pti_case14_sys │ PSSE 14-bus Test system │\n", "│ pti_case24_sys │ PSSE 24-bus Test system │\n", "│ pti_case30_sys │ PSSE 30-bus Test system │\n", "│ pti_case3_sys │ PSSE 3-bus Test system │\n", "│ pti_case5_alc_sys │ PSSE 5-bus alc Test system │\n", "│ pti_case5_sys │ PSSE 5-bus Test system │\n", "│ pti_case73_sys │ PSSE 73-bus Test system │\n", "│ pti_case7_tplgy_sys │ PSSE 7-bus Test system │\n", "│ pti_frankenstein_00_2_sys │ PSSE frankenstein Test system │\n", "│ pti_frankenstein_00_sys │ PSSE frankenstein Test system │\n", "│ pti_frankenstein_20_sys │ PSSE frankenstein Test system │\n", "│ pti_frankenstein_70_sys │ PSSE frankenstein Test system │\n", "│ pti_parser_test_a_sys │ PSSE Test system │\n", "│ pti_three_winding_mag_test_sys │ PSSE Test system │\n", "│ pti_three_winding_test_2_sys │ PSSE Test system │\n", "│ pti_three_winding_test_sys │ PSSE Test system │\n", "│ pti_two_terminal_hvdc_test_sys │ PSSE Test system │\n", "│ pti_two_winding_mag_test_sys │ PSSE Test system │\n", "│ pti_vsc_hvdc_test_sys │ PSSE Test system │\n", "└─────────────────────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────┘\n", "\n", "Category: PSYTestSystems\n", "\n", "┌──────────────────────┬──────────────────────────────────┐\n", "│ Name │ Descriptor │\n", "├──────────────────────┼──────────────────────────────────┤\n", "│ dynamic_inverter_sys │ PSY test dynamic inverter system │\n", "│ tamu_ACTIVSg2000_sys │ TAMU ACTIVSg2000 Test system │\n", "└──────────────────────┴──────────────────────────────────┘\n", "\n", "Category: SIIPExampleSystems\n", "\n", "┌─────────────────────────────────┬────────────────────────────────────────────────────────────┐\n", "│ Name │ Descriptor │\n", "├─────────────────────────────────┼────────────────────────────────────────────────────────────┤\n", "│ 5_bus_hydro_ed_sys │ 5-bus hydro economic dispatch data │\n", "│ 5_bus_hydro_ed_sys_with_targets │ 5-bus hydro economic dispatch data with energy targets │\n", "│ 5_bus_hydro_uc_sys │ 5-bus hydro unit commitment data │\n", "│ 5_bus_hydro_uc_sys_with_targets │ 5-bus hydro unit commitment data with energy targets │\n", "│ 5_bus_hydro_wk_sys │ 5-bus hydro system for weekly dispatch │\n", "│ 5_bus_hydro_wk_sys_with_targets │ 5-bus hydro system for weekly dispatch with energy targets │\n", "│ 5_bus_matpower_AGC │ matpower 5-bus system with AGC time series │\n", "│ 5_bus_matpower_DA │ matpower 5-bus system with DA time series │\n", "│ 5_bus_matpower_RT │ matpower 5-bus system with RT time series │\n", "└─────────────────────────────────┴────────────────────────────────────────────────────────────┘\n" ] } ], "cell_type": "code", "source": [ "show_systems()" ], "metadata": {}, "execution_count": 2 }, { "cell_type": "markdown", "source": [ "### Systems can be listed by category\n", "the available categories can be displayed with:" ], "metadata": {} }, { "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "MatPowerTestSystems\n", "PSITestSystems\n", "PSSETestSystems\n", "PSYTestSystems\n", "SIIPExampleSystems\n" ] } ], "cell_type": "code", "source": [ "show_categories()" ], "metadata": {}, "execution_count": 3 }, { "cell_type": "markdown", "source": [ "the available systems can be displayed with:" ], "metadata": {} }, { "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "┌─────────────────────────────────┬────────────────────────────────────────────────────────────┐\n", "│ Name │ Descriptor │\n", "├─────────────────────────────────┼────────────────────────────────────────────────────────────┤\n", "│ 5_bus_hydro_ed_sys │ 5-bus hydro economic dispatch data │\n", "│ 5_bus_hydro_ed_sys_with_targets │ 5-bus hydro economic dispatch data with energy targets │\n", "│ 5_bus_hydro_uc_sys │ 5-bus hydro unit commitment data │\n", "│ 5_bus_hydro_uc_sys_with_targets │ 5-bus hydro unit commitment data with energy targets │\n", "│ 5_bus_hydro_wk_sys │ 5-bus hydro system for weekly dispatch │\n", "│ 5_bus_hydro_wk_sys_with_targets │ 5-bus hydro system for weekly dispatch with energy targets │\n", "│ 5_bus_matpower_AGC │ matpower 5-bus system with AGC time series │\n", "│ 5_bus_matpower_DA │ matpower 5-bus system with DA time series │\n", "│ 5_bus_matpower_RT │ matpower 5-bus system with RT time series │\n", "└─────────────────────────────────┴────────────────────────────────────────────────────────────┘\n" ] } ], "cell_type": "code", "source": [ "show_systems(SIIPExampleSystems)" ], "metadata": {}, "execution_count": 4 }, { "cell_type": "markdown", "source": [ "### Create a `System`\n", "*The first time this is run, it will parse csv data. Subsequent executions will rely on serialized data and will execute much faster*" ], "metadata": {} }, { "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "┌ Info: Building new system 5_bus_hydro_ed_sys from raw data\n", "└ sys_descriptor.raw_data = \"/home/runner/.julia/packages/PowerSystemCaseBuilder/RYBMw/data\"\n", "[ Info: Parsing csv data in Hydro_Upstream_Input.csv ...\n", "[ Info: Successfully parsed Hydro_Upstream_Input.csv\n", "[ Info: Parsing csv data in branch.csv ...\n", "[ Info: Successfully parsed branch.csv\n", "[ Info: Parsing csv data in bus.csv ...\n", "[ Info: Successfully parsed bus.csv\n", "[ Info: Parsing csv data in gen.csv ...\n", "[ Info: Successfully parsed gen.csv\n", "[ Info: Parsing csv data in reserves.csv ...\n", "[ Info: Successfully parsed reserves.csv\n", "[ Info: Parsing csv data in storage.csv ...\n", "[ Info: Successfully parsed storage.csv\n", "[ Info: Unit System changed to InfrastructureSystems.UnitSystemModule.UnitSystem.DEVICE_BASE = 1\n", "┌ Warning: Missing PowerSystems.InputCategoryModule.InputCategory.DC_BRANCH = 3 data.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/gGFFl/src/parsers/power_system_table_data.jl:213\n", "┌ Warning: Missing PowerSystems.InputCategoryModule.InputCategory.LOAD = 5 data.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/gGFFl/src/parsers/power_system_table_data.jl:213\n", "┌ Warning: Missing PowerSystems.InputCategoryModule.InputCategory.DC_BRANCH = 3 data.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/gGFFl/src/parsers/power_system_table_data.jl:213\n", "┌ Warning: Missing PowerSystems.InputCategoryModule.InputCategory.LOAD = 5 data.\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/gGFFl/src/parsers/power_system_table_data.jl:213\n", "[ Info: Adding contributing generators for REG1 by category\n", "┌ Warning: no component category=PowerSystems.Generator name=SolarBusC\n", "└ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/Z74ym/src/system_data.jl:541\n", "┌ Warning: no component category=PowerSystems.Generator name=WindBusA\n", "└ @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/Z74ym/src/system_data.jl:541\n", "[ Info: Serialized time series data to /home/runner/.julia/packages/PowerSystemCaseBuilder/RYBMw/data/serialized_system/ForecastOnly/5_bus_hydro_ed_sys_time_series_storage.h5.\n", "[ Info: Serialized System to /home/runner/.julia/packages/PowerSystemCaseBuilder/RYBMw/data/serialized_system/ForecastOnly/5_bus_hydro_ed_sys.json\n" ] }, { "output_type": "execute_result", "data": { "text/plain": "System\n┌───────────────────┬─────────────┐\n│ Property │ Value │\n├───────────────────┼─────────────┤\n│ System Units Base │ DEVICE_BASE │\n│ Base Power │ 100.0 │\n│ Base Frequency │ 60.0 │\n│ Num Components │ 35 │\n└───────────────────┴─────────────┘\n\nStatic Components\n┌─────────────────────────────────────────┬───────┬────────────────────────┬────\n│ Type │ Count │ Has Static Time Series │ H ⋯\n├─────────────────────────────────────────┼───────┼────────────────────────┼────\n│ Arc │ 6 │ false │ f ⋯\n│ Area │ 2 │ false │ f ⋯\n│ Bus │ 5 │ false │ f ⋯\n│ HydroDispatch │ 1 │ true │ t ⋯\n│ HydroEnergyReservoir │ 2 │ true │ t ⋯\n│ HydroPumpedStorage │ 1 │ false │ f ⋯\n│ Line │ 5 │ false │ f ⋯\n│ LoadZone │ 2 │ false │ f ⋯\n│ PowerLoad │ 3 │ true │ t ⋯\n│ TapTransformer │ 2 │ false │ f ⋯\n│ ThermalStandard │ 5 │ false │ f ⋯\n│ VariableReserve{PowerSystems.ReserveUp} │ 1 │ false │ f ⋯\n└─────────────────────────────────────────┴───────┴────────────────────────┴────\n 1 column omitted\n\nTime Series Summary\n┌──────────────────────────────────┬─────────────────────┐\n│ Property │ Value │\n├──────────────────────────────────┼─────────────────────┤\n│ Components with time series data │ 6 │\n│ Total StaticTimeSeries │ 12 │\n│ Total Forecasts │ 12 │\n│ Resolution │ 60 minutes │\n│ First initial time │ 2020-01-01T00:00:00 │\n│ Last initial time │ 2020-03-24T12:00:00 │\n│ Horizon │ 12 │\n│ Interval │ 60 minutes │\n│ Forecast window count │ 2005 │\n└──────────────────────────────────┴─────────────────────┘\n", "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
System
PropertyValue
System Units BaseDEVICE_BASE
Base Power100.0
Base Frequency60.0
Num Components35
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Static Components
TypeCountHas Static Time SeriesHas Forecasts
Arc6falsefalse
Area2falsefalse
Bus5falsefalse
HydroDispatch1truetrue
HydroEnergyReservoir2truetrue
HydroPumpedStorage1falsefalse
Line5falsefalse
LoadZone2falsefalse
PowerLoad3truetrue
TapTransformer2falsefalse
ThermalStandard5falsefalse
VariableReserve{PowerSystems.ReserveUp}1falsefalse
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Time Series Summary
PropertyValue
Components with time series data6
Total StaticTimeSeries12
Total Forecasts12
Resolution60 minutes
First initial time2020-01-01T00:00:00
Last initial time2020-03-24T12:00:00
Horizon12
Interval60 minutes
Forecast window count2005
\n", "\n", "\n" ] }, "metadata": {}, "execution_count": 5 } ], "cell_type": "code", "source": [ "sys = build_system(SIIPExampleSystems, \"5_bus_hydro_ed_sys\")" ], "metadata": {}, "execution_count": 5 }, { "cell_type": "markdown", "source": [ "---\n", "\n", "*This notebook was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*" ], "metadata": {} } ], "nbformat_minor": 3, "metadata": { "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.7.2" }, "kernelspec": { "name": "julia-1.7", "display_name": "Julia 1.7.2", "language": "julia" } }, "nbformat": 4 }