Parsing MATPOWER or PSS/e Files
The following code will create a System from a MATPOWER .m or PSS/e .raw file:
julia> using PowerSystems
julia> file_dir = joinpath(pkgdir(PowerSystems), "docs", "src", "tutorials", "tutorials_data")
"/home/runner/work/PowerSystems.jl/PowerSystems.jl/docs/src/tutorials/tutorials_data"
julia> sys = System(joinpath(file_dir, "case5.m"))
[ Info: Correcting vm in bus 1 to 1.07762 to match generator set-point [ Info: Correcting vm in bus 3 to 1.1 to match generator set-point [ Info: Correcting vm in bus 4 to 1.06414 to match generator set-point [ Info: Correcting vm in bus 10 to 1.06907 to match generator set-point [ Info: extending matpower format with data: areas 1x3 [ Info: No conformity field found. Setting to default value of 1 (Conforming Load). [ Info: No conformity field found. Setting to default value of 1 (Conforming Load). [ Info: No conformity field found. Setting to default value of 1 (Conforming Load). [ Info: No conformity field found. Setting to default value of 1 (Conforming Load). [ Info: No conformity field found. Setting to default value of 1 (Conforming Load). [ Info: reversing the orientation of branch 6 (4, 3) to be consistent with other parallel branches [ Info: removing 1 cost terms from generator 5: [1000.0, 0.0] [ Info: removing 1 cost terms from generator 4: [4000.0, 0.0] [ Info: removing 1 cost terms from generator 2: [1500.0, 0.0] [ Info: removing 1 cost terms from generator 3: [3000.0, 0.0] [ Info: removing 1 cost terms from generator 1: [1400.0, 0.0] ┌ Info: Constructing System from Power Models │ data["name"] = "nesta_case5_pjm" └ data["source_type"] = "matpower" [ 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 Zone data [ Info: There is no Zone data in this file [ Info: Reading generator data [ Info: Reading switch data [ Info: Reading breaker data [ Info: There is no breaker data in this file [ Info: Reading branch data [ Info: Reading Impedance Correction Table data [ Info: There is no Impedance Correction Table data in this file [ Info: rating 240.0 MW for bus-4-bus-10-i_7 is outside the expected range (min = 327.0, max = 797.0) MW for Line at a 230.0 kV Voltage level. [ Info: rating_b 240.0 MW for bus-4-bus-10-i_7 is outside the expected range (min = 327.0, max = 797.0) MW for Line at a 230.0 kV Voltage level. [ Info: rating_c 240.0 MW for bus-4-bus-10-i_7 is outside the expected range (min = 327.0, max = 797.0) MW for Line at a 230.0 kV Voltage level. [ Info: Reading switched shunt data [ Info: There is no switched shunt data in this file [ Info: Reading shunt data [ Info: Reading DC Line data [ Info: Reading VSC Line data [ Info: There is no VSC lines data in this file [ Info: Reading FACTS data [ Info: There is no facts data in this file [ Info: Reading multi-section line data [ Info: There is no multi-section line data in this file [ Info: Reading storage data [ Info: Reading 3W transformer data [ Info: There is no 3W transformer data in this file System ┌───────────────────┬─────────────┐ │ Property │ Value │ ├───────────────────┼─────────────┤ │ Name │ │ │ Description │ │ │ System Units Base │ SYSTEM_BASE │ │ Base Power │ 100.0 │ │ Base Frequency │ 60.0 │ │ Num Components │ 28 │ └───────────────────┴─────────────┘ Static Components ┌──────────────────────────┬───────┐ │ Type │ Count │ ├──────────────────────────┼───────┤ │ ACBus │ 5 │ │ Arc │ 6 │ │ Area │ 1 │ │ Line │ 5 │ │ LoadZone │ 1 │ │ PhaseShiftingTransformer │ 2 │ │ PowerLoad │ 3 │ │ ThermalStandard │ 5 │ └──────────────────────────┴───────┘
This parsing code was copied with permission from PowerModels.jl
.
See also:
- Parsing PSS/e .dyr Files, which also includes an example of parsing a .raw file
- Parsing table data (CSV Files)
- Parsing time series