VirtualLODF

The VirtualLODF structure follows the same philosofy as the VirtualPTDF: it contains rows of the original LODF matrix, evaluated and cached on demand.

Refer to the different arguments of the VirtualLODF methods by looking at the "Public API Reference" page.

How the VirtualLODF works

The VirtualLODF structure retains many of the similarities of the VirtualPTDF. However, its computation is more complex and requires some additional data.

Starting from the system data, the IncidenceMatrix, BA_Matrix and ABA_Matrix (with relative LU factorization matrices) are evaluated. The ABA_Matrix and BA_Matrix are used for the computation of the diagonal elements of the PTDF matrix, and this vector is stored in the VirtualLODF structure together with the other structures mentioned above.

Once the VirtualLODF is initialized, each row of the matrix can be evaluated separately and on user request. The algorithmic procedure is the following:

  1. Define the VirtualPTDF structure
  2. Call any element of the matrix to define and store the relative row as well as showing the selected element

Regarding point 2, if the row has been stored previosly then the desired element is just loaded from the cache and shown.

The flowchart below shows how the VirtualLODF is structured and how it works. Examples will be presented in the following sections.

Initialize VirtualLODF and compute/access row/element

As for the LODF matrix, at first the System data must be loaded. The "RTS-GMLC" systems is considered as example:

julia> using PowerNetworkMatrices
julia> using PowerSystemCaseBuilder
julia> const PNM = PowerNetworkMatrices;
julia> const PSB = PowerSystemCaseBuilder;
julia> sys = PSB.build_system(PSB.PSISystems, "RTS_GMLC_DA_sys");┌ Info: Building new system RTS_GMLC_DA_sys from raw data └ sys_descriptor.raw_data = "/home/runner/.julia/artifacts/5098f357bad765bfefcff58f080818863ca776bd/RTS-GMLC-0.2.2" [ Info: Parsing csv data in branch.csv ... [ Info: Successfully parsed branch.csv [ Info: Parsing csv data in bus.csv ... [ Info: Successfully parsed bus.csv [ Info: Parsing csv data in dc_branch.csv ... [ Info: Successfully parsed dc_branch.csv [ Info: Parsing csv data in gen.csv ... [ Info: Successfully parsed gen.csv [ Info: Parsing csv data in reserves.csv ... [ Info: Successfully parsed reserves.csv [ Info: Parsing csv data in simulation_objects.csv ... [ Info: Successfully parsed simulation_objects.csv [ Info: Parsing csv data in storage.csv ... [ Info: Successfully parsed storage.csv [ Info: Parsing csv data in timeseries_pointers.csv ... [ Info: Successfully parsed timeseries_pointers.csv [ Info: Unit System changed to InfrastructureSystems.UnitSystemModule.UnitSystem.DEVICE_BASE = 1 ┌ Warning: Missing PowerSystems.InputCategoryModule.InputCategory.LOAD = 5 data. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:212 ┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Status at Start is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Time at Status is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Cold is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Warm is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Hot is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Must Run is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Heat rate parsing not valid for RenewableGen replacing with zero cost └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:903 ┌ Warning: Missing PowerSystems.InputCategoryModule.InputCategory.LOAD = 5 data. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:212 [ Info: Adding contributing generators for Spin_Up_R1 by category ┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Status at Start is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Time at Status is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Cold is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Warm is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Hot is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Must Run is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 [ Info: Adding contributing generators for Spin_Up_R2 by category ┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Status at Start is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Time at Status is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Cold is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Warm is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Hot is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Must Run is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 [ Info: Adding contributing generators for Spin_Up_R3 by category ┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Status at Start is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Time at Status is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Cold is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Warm is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Hot is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Must Run is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 [ Info: Adding contributing generators for Flex_Up by category ┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Status at Start is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Time at Status is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Cold is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Warm is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Hot is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Must Run is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 [ Info: Adding contributing generators for Flex_Down by category ┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Status at Start is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Time at Status is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Cold is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Warm is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Hot is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Must Run is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 [ Info: Adding contributing generators for Reg_Up by category ┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Status at Start is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Time at Status is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Cold is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Warm is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Hot is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Must Run is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 [ Info: Adding contributing generators for Reg_Down by category ┌ Warning: User-defined column name Startup Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Shutdown Ramp Rate MW/min is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Status at Start is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Time at Status is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Cold is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Warm is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Start Cost Hot is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 ┌ Warning: User-defined column name Must Run is not in dataframe. └ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1548 [ Info: Serialized time series data to /home/runner/.julia/packages/PowerSystemCaseBuilder/uZO8H/data/serialized_system/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/RTS_GMLC_DA_sys_time_series_storage.h5. [ Info: Serialized System to /home/runner/.julia/packages/PowerSystemCaseBuilder/uZO8H/data/serialized_system/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/RTS_GMLC_DA_sys.json [ Info: Serialized System metadata to /home/runner/.julia/packages/PowerSystemCaseBuilder/uZO8H/data/serialized_system/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/RTS_GMLC_DA_sys_metadata.json

At this point the VirtualLODF is initialized with the following simple command:

julia> v_lodf = VirtualLODF(sys);

Now, an element of the matrix can be computed by calling the branch name and bus number:

julia> el_C31_2_105 = v_lodf["C31-2", "A3"]-0.0043345153204109605

This element represent the portion flowing on line "A3" now diverted on line "C31-2" as a consequence of its outage.

Alternatively, the number of the branch and bus (corresponding to the number of the PTDF row and column) can be used. In this case the row and column numbers are mapped by the dictonaries contained in the lookup field.

julia> row_number = v_lodf.lookup[1]["C31-2"]112
julia> col_number = v_lodf.lookup[2]["A3"]3
julia> el_C31_2_105_bis = v_lodf[row_number, col_number]-0.0043345153204109605

NOTE: this example was made for the sake of completeness and considering the actual branch names is recommended.

As previosly mentioned, in order to evaluate a single element of the VirtualLODF, the entire row related to the selected branch must be considered. For this reason it is cached for later calls. This is evident by looking at the following example:

julia> sys_2k = PSB.build_system(PSB.PSYTestSystems, "tamu_ACTIVSg2000_sys");┌ Info: Building new system tamu_ACTIVSg2000_sys from raw data
└   sys_descriptor.raw_data = "/home/runner/.julia/artifacts/afb608473cf4d5eb22147856de1a1a651f36d40b/PowerSystemsTestData-3.1"
[ Info: The PSS(R)E parser currently supports buses, loads, shunts, generators, branches, transformers, and dc lines
[ Info: The PSS(R)E parser currently supports buses, loads, shunts, generators, branches, transformers, and dc lines
[ Info: Parsing PSS(R)E Bus data into a PowerModels Dict...
[ Info: Parsing PSS(R)E Load data into a PowerModels Dict...
[ Info: Parsing PSS(R)E Shunt data into a PowerModels Dict...
[ Info: Switched shunt converted to fixed shunt, with default value gs=0.0
[ Info: Parsing PSS(R)E Generator data into a PowerModels Dict...
[ Info: Parsing PSS(R)E Branch data into a PowerModels Dict...
[ Info: Parsing PSS(R)E Transformer data into a PowerModels Dict...
[ Info: Parsing PSS(R)E Two-Terminal and VSC DC line data into a PowerModels Dict...
┌ Warning: This PSS(R)E parser currently doesn't support Storage data parsing...
└ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/pm_io/psse.jl:998
┌ Warning: This PSS(R)E parser currently doesn't support Switch data parsing...
└ @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/pm_io/psse.jl:1004
[ Info: angmin and angmax values are 0, widening these values on branch 2243 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 1881 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 1907 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2923 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 599 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2491 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 228 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2590 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2579 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 1880 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2562 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 1106 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2366 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 3196 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 1783 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 928 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 859 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 1863 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 561 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 1825 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2631 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2714 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 3157 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 815 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 981 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 1429 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 39 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2713 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 112 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 3153 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 1665 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 590 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 17 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 333 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 550 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 341 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 664 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 912 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 1598 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2509 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 598 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 14 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 613 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 1052 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2334 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 510 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2166 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2585 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 2127 to +/- 60.0 deg.
[ Info: angmin and angmax values are 0, widening these values on branch 197 to +/- 60.0 deg.
[ Info: reversing the orientation of branch 36 (1071, 1019) to be consistent with other parallel branches
[ Info: no active generators found at bus 7122, updating to bus type from 2 to 1
[ Info: no active generators found at bus 8060, updating to bus type from 2 to 1
[ Info: no active generators found at bus 6049, updating to bus type from 2 to 1
[ Info: no active generators found at bus 5035, updating to bus type from 2 to 1
[ Info: no active generators found at bus 6259, updating to bus type from 2 to 1
[ Info: no active generators found at bus 3044, updating to bus type from 2 to 1
[ Info: no active generators found at bus 2103, updating to bus type from 2 to 1
[ Info: no active generators found at bus 3043, updating to bus type from 2 to 1
[ Info: no active generators found at bus 7334, updating to bus type from 2 to 1
[ Info: no active generators found at bus 6270, updating to bus type from 2 to 1
[ Info: no active generators found at bus 8152, updating to bus type from 2 to 1
[ Info: no active generators found at bus 2019, updating to bus type from 2 to 1
[ Info: no active generators found at bus 8115, updating to bus type from 2 to 1
[ Info: no active generators found at bus 1063, updating to bus type from 2 to 1
[ Info: no active generators found at bus 4163, updating to bus type from 2 to 1
[ Info: no active generators found at bus 7207, updating to bus type from 2 to 1
[ Info: no active generators found at bus 6052, updating to bus type from 2 to 1
[ Info: no active generators found at bus 2084, updating to bus type from 2 to 1
[ Info: no active generators found at bus 8036, updating to bus type from 2 to 1
[ Info: no active generators found at bus 4137, updating to bus type from 2 to 1
[ Info: no active generators found at bus 4096, updating to bus type from 2 to 1
[ Info: no active generators found at bus 5320, updating to bus type from 2 to 1
[ Info: no active generators found at bus 6050, updating to bus type from 2 to 1
[ Info: no active generators found at bus 8051, updating to bus type from 2 to 1
[ Info: no active generators found at bus 4075, updating to bus type from 2 to 1
[ Info: no active generators found at bus 8116, updating to bus type from 2 to 1
[ Info: no active generators found at bus 3087, updating to bus type from 2 to 1
[ Info: no active generators found at bus 4092, updating to bus type from 2 to 1
[ Info: no active generators found at bus 5036, updating to bus type from 2 to 1
[ Info: no active generators found at bus 8047, updating to bus type from 2 to 1
[ Info: no active generators found at bus 5057, updating to bus type from 2 to 1
[ Info: no active generators found at bus 8087, updating to bus type from 2 to 1
[ Info: no active generators found at bus 5283, updating to bus type from 2 to 1
[ Info: no active generators found at bus 5424, updating to bus type from 2 to 1
[ Info: no active generators found at bus 7280, updating to bus type from 2 to 1
[ Info: no active generators found at bus 1048, updating to bus type from 2 to 1
[ Info: no active generators found at bus 7284, updating to bus type from 2 to 1
[ Info: no active generators found at bus 8061, updating to bus type from 2 to 1
[ Info: no active generators found at bus 7309, updating to bus type from 2 to 1
[ Info: no active generators found at bus 6144, updating to bus type from 2 to 1
[ Info: no active generators found at bus 1081, updating to bus type from 2 to 1
[ Info: no active generators found at bus 6271, updating to bus type from 2 to 1
[ Info: no active generators found at bus 1060, updating to bus type from 2 to 1
[ Info: no active generators found at bus 6148, updating to bus type from 2 to 1
[ Info: no active generators found at bus 6087, updating to bus type from 2 to 1
[ Info: no active generators found at bus 8035, updating to bus type from 2 to 1
[ Info: no active generators found at bus 2004, updating to bus type from 2 to 1
[ Info: no active generators found at bus 6301, updating to bus type from 2 to 1
[ Info: no active generators found at bus 7015, updating to bus type from 2 to 1
[ Info: no active generators found at bus 8034, updating to bus type from 2 to 1
[ Info: the voltage setpoint on generator 306 does not match the value at bus 6166
[ Info: the voltage setpoint on generator 407 does not match the value at bus 7166
[ Info: the voltage setpoint on generator 1 does not match the value at bus 1004
[ Info: the voltage setpoint on generator 54 does not match the value at bus 2076
[ Info: the voltage setpoint on generator 519 does not match the value at bus 8050
[ Info: the voltage setpoint on generator 101 does not match the value at bus 3095
[ Info: the voltage setpoint on generator 371 does not match the value at bus 7063
[ Info: the voltage setpoint on generator 41 does not match the value at bus 2004
[ Info: the voltage setpoint on generator 464 does not match the value at bus 7361
[ Info: the voltage setpoint on generator 65 does not match the value at bus 2104
[ Info: the voltage setpoint on generator 475 does not match the value at bus 7379
[ Info: the voltage setpoint on generator 447 does not match the value at bus 7325
[ Info: the voltage setpoint on generator 335 does not match the value at bus 6297
[ Info: the voltage setpoint on generator 362 does not match the value at bus 7025
[ Info: the voltage setpoint on generator 505 does not match the value at bus 7428
[ Info: the voltage setpoint on generator 491 does not match the value at bus 7422
[ Info: the voltage setpoint on generator 326 does not match the value at bus 6268
[ Info: the voltage setpoint on generator 543 does not match the value at bus 8158
[ Info: the voltage setpoint on generator 299 does not match the value at bus 6145
[ Info: the voltage setpoint on generator 168 does not match the value at bus 4181
[ Info: the voltage setpoint on generator 159 does not match the value at bus 4138
[ Info: the voltage setpoint on generator 403 does not match the value at bus 7162
[ Info: the voltage setpoint on generator 228 does not match the value at bus 5325
[ Info: the voltage setpoint on generator 332 does not match the value at bus 6274
[ Info: the voltage setpoint on generator 190 does not match the value at bus 5041
[ Info: the voltage setpoint on generator 227 does not match the value at bus 5324
[ Info: the voltage setpoint on generator 270 does not match the value at bus 6049
[ Info: the voltage setpoint on generator 536 does not match the value at bus 8130
[ Info: the voltage setpoint on generator 476 does not match the value at bus 7389
[ Info: the voltage setpoint on generator 223 does not match the value at bus 5303
[ Info: the voltage setpoint on generator 453 does not match the value at bus 7350
[ Info: the voltage setpoint on generator 531 does not match the value at bus 8099
[ Info: the voltage setpoint on generator 88 does not match the value at bus 3060
[ Info: the voltage setpoint on generator 467 does not match the value at bus 7371
[ Info: the voltage setpoint on generator 297 does not match the value at bus 6111
[ Info: the voltage setpoint on generator 26 does not match the value at bus 1072
[ Info: the voltage setpoint on generator 289 does not match the value at bus 6087
[ Info: the voltage setpoint on generator 250 does not match the value at bus 5418
[ Info: the voltage setpoint on generator 77 does not match the value at bus 3020
[ Info: the voltage setpoint on generator 230 does not match the value at bus 5342
[ Info: the voltage setpoint on generator 449 does not match the value at bus 7329
[ Info: the voltage setpoint on generator 394 does not match the value at bus 7135
[ Info: the voltage setpoint on generator 258 does not match the value at bus 5444
[ Info: the voltage setpoint on generator 328 does not match the value at bus 6270
[ Info: the voltage setpoint on generator 204 does not match the value at bus 5167
[ Info: the voltage setpoint on generator 387 does not match the value at bus 7113
[ Info: the voltage setpoint on generator 23 does not match the value at bus 1063
[ Info: the voltage setpoint on generator 160 does not match the value at bus 4142
[ Info: the voltage setpoint on generator 416 does not match the value at bus 7193
[ Info: the voltage setpoint on generator 450 does not match the value at bus 7334
┌ Info: Constructing System from Power Models
│   data["name"] = "activsg2000"
└   data["source_type"] = "pti"
[ Info: Reading bus data
[ Info: Reading Load data in PowerModels dict to populate System ...
[ Info: Reading LoadZones data in PowerModels dict to populate System ...
[ Info: Reading generator data
[ Info: Reading branch data
[ Info: Reading shunt data
[ Info: Reading DC Line data
[ Info: Reading storage data
[ Info: Serialized System to /home/runner/.julia/packages/PowerSystemCaseBuilder/uZO8H/data/serialized_system/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/tamu_ACTIVSg2000_sys.json
[ Info: Serialized System metadata to /home/runner/.julia/packages/PowerSystemCaseBuilder/uZO8H/data/serialized_system/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/tamu_ACTIVSg2000_sys_metadata.json
julia> v_lodf_2k = VirtualLODF(sys_2k); # evaluate PTDF row related to branch "ODESSA 2 0 -1001-ODESSA 3 0 -1064-i_1"
julia> @time v_lodf_2k["ODESSA 2 0 -1001-ODESSA 3 0 -1064-i_1", "BRYAN 1 1 -8159-BRYAN 1 0 -8158-i_1"] # call same element after the row has been stored 0.000127 seconds (16 allocations: 107.484 KiB) 1.921713916731812e-5
julia> @time v_lodf_2k["ODESSA 2 0 -1001-ODESSA 3 0 -1064-i_1", "BRYAN 1 1 -8159-BRYAN 1 0 -8158-i_1"] 0.000013 seconds (1 allocation: 16 bytes) 1.921713916731812e-5

"Sparse" VirtualPTDF

Sparsification of each row can be achieved in the same fashion as for the LODF matrix, by removing those elements whose absolute values is below a certain threshold.

As for the example show for the LODF matrix, here to a very high values of 0.4 is considered for the tol field. Again, this value is considered just for the sake of this example.

julia> # smaller system for the next examples
       sys_2 = PSB.build_system(PSB.PSITestSystems, "c_sys5");[ Info: Loaded time series from storage file existing=/home/runner/.julia/packages/PowerSystemCaseBuilder/uZO8H/data/serialized_system/614e094ea985a55912fc1321256a49b755f9fc451c0f264f24d6d04af20e84d7/c_sys5_time_series_storage.h5 new=/tmp/jl_k10MB5 compression=InfrastructureSystems.CompressionSettings(false, InfrastructureSystems.CompressionTypesModule.CompressionTypes.DEFLATE = 1, 3, true)
julia> v_lodf_dense = VirtualLODF(sys_2);
julia> v_lodf_sparse = VirtualLODF(sys_2, tol=0.4);

Let's now evaluate the same row as before and compare the results:

julia> original_row = [v_lodf_dense["1", j] for j in v_lodf_dense.axes[2]]6-element Vector{Float64}:
 -1.0
  0.3447946513849092
  0.30707070707070555
 -0.9999999999999991
 -1.0000000000000002
 -0.307070707070707
julia> sparse_row = [v_lodf_sparse["1", j] for j in v_lodf_sparse.axes[2]]6-element Vector{Float64}: -1.0 0.0 0.0 -0.9999999999999991 -1.0000000000000002 0.0