Quick Start Guide

Note

PowerSystemCaseBuilder.jl is a helper library that makes it easier to reproduce examples in the documentation and tutorials. Normally you would pass your local files to create the system data instead of calling the function build_system. For more details visit PowerSystemCaseBuilder Documentation

For more details about loading data and adding more dynamic components check the Creating a System with Dynamic devices section of the documentation in PowerSystems.jl.

Loading data

Data can be loaded from a pss/e raw file and a pss/e dyr file.

julia> using PowerNetworkMatrices
julia> using PowerSystemCaseBuilder
julia> const PNM = PowerNetworkMatricesPowerNetworkMatrices
julia> const PSB = PowerSystemCaseBuilderPowerSystemCaseBuilder
julia> sys = PSB.build_system(PSB.PSITestSystems, "c_sys5")┌ Info: Building new system c_sys5 from raw data └ sys_descriptor.raw_data = "/home/runner/.julia/artifacts/afb608473cf4d5eb22147856de1a1a651f36d40b/PowerSystemsTestData-3.1/psy_data/data_5bus_pu.jl" [ Info: Serialized time series data to /home/runner/.julia/packages/PowerSystemCaseBuilder/uZO8H/data/serialized_system/614e094ea985a55912fc1321256a49b755f9fc451c0f264f24d6d04af20e84d7/c_sys5_time_series_storage.h5. [ Info: Serialized System to /home/runner/.julia/packages/PowerSystemCaseBuilder/uZO8H/data/serialized_system/614e094ea985a55912fc1321256a49b755f9fc451c0f264f24d6d04af20e84d7/c_sys5.json [ Info: Serialized System metadata to /home/runner/.julia/packages/PowerSystemCaseBuilder/uZO8H/data/serialized_system/614e094ea985a55912fc1321256a49b755f9fc451c0f264f24d6d04af20e84d7/c_sys5_metadata.json System ┌───────────────────┬─────────────┐ │ Property │ Value │ ├───────────────────┼─────────────┤ │ Name │ │ │ Description │ │ │ System Units Base │ SYSTEM_BASE │ │ Base Power │ 100.0 │ │ Base Frequency │ 60.0 │ │ Num Components │ 25 │ └───────────────────┴─────────────┘ Static Components ┌─────────────────┬───────┐ │ Type │ Count │ ├─────────────────┼───────┤ │ ACBus │ 5 │ │ Arc │ 6 │ │ Line │ 6 │ │ PowerLoad │ 3 │ │ ThermalStandard │ 5 │ └─────────────────┴───────┘ Time Series Summary ┌────────────┬────────────────┬──────────────────┬──────────────────────┬─────── │ owner_type │ owner_category │ time_series_type │ time_series_category │ init ⋯ │ String │ String │ String │ String │ Stri ⋯ ├────────────┼────────────────┼──────────────────┼──────────────────────┼─────── │ PowerLoad │ Component │ Deterministic │ Forecast │ 2024 ⋯ └────────────┴────────────────┴──────────────────┴──────────────────────┴─────── 3 columns omitted

Computation of the PTDF matrix

Once system data is loaded, netwrok matrices can be evaluated. The following example shows how the PTDF matrix is computed.

The function PTDF is called for the evaluation of the matrix and other data. These are stored in a structure of type PTDF.

julia> # evaluate the PTDF structure containing the matrix and other data.
       ptdf_matrix = PNM.PTDF(sys);
       
       # show the PTDF matrix.
julia> PNM.get_data(ptdf_matrix)5×6 Matrix{Float64}: 0.193917 0.437588 0.368495 0.193917 0.193917 -0.368495 -0.475895 0.258343 0.217552 0.524105 0.524105 -0.217552 -0.348989 0.189451 0.159538 -0.348989 0.651011 -0.159538 0.0 0.0 0.0 0.0 0.0 0.0 0.159538 0.36001 -0.519548 0.159538 0.159538 -0.480452

As it can be seen, PTDF matrix is stored such that the number of rows is equal to the number of buses, number of columns equal to the number of branches.