Parsing Files

Originally Contributed by: Clayton Barrows

Introduction

An example of how to parse MATPOWER and PSSe raw files and create a System using PowerSystems.jl

Create a System from a Matpower File

julia> # Load directory
       using PowerSystems
julia> sys = System(joinpath(file_dir, "case5_re.m"))┌ Error: Matlab parser skipping line number 85 consisting of: │ }; └ @ PowerSystems ~/work/PowerSystems.jl/PowerSystems.jl/src/parsers/im_io/matlab.jl:64 [ 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: extending matpower format with data: gen_name 7x4 [ Info: extending matpower format by appending matrix "gen_name" in to "gen" [ Info: reversing the orientation of branch 6 (4, 3) to be consistent with other parallel branches [ Info: removing 1 cost terms from generator 4: [4000.0, 0.0] [ Info: removing 1 cost terms from generator 1: [1400.0, 0.0] [ Info: removing 1 cost terms from generator 5: [1000.0, 0.0] [ Info: removing 1 cost terms from generator 2: [1500.0, 0.0] [ Info: removing 3 cost terms from generator 6: Float64[] [ Info: removing 3 cost terms from generator 7: Float64[] [ Info: removing 1 cost terms from generator 3: [3000.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 generator data [ Info: Reading branch data [ Info: Reading branch data [ Info: Reading DC Line data [ Info: Reading storage data System ┌───────────────────┬─────────────┐ │ Property │ Value │ ├───────────────────┼─────────────┤ │ Name │ │ │ Description │ │ │ System Units Base │ SYSTEM_BASE │ │ Base Power │ 100.0 │ │ Base Frequency │ 60.0 │ │ Num Components │ 30 │ └───────────────────┴─────────────┘ Static Components ┌──────────────────────────┬───────┬────────────────────────┬───────────────┐ │ Type │ Count │ Has Static Time Series │ Has Forecasts │ ├──────────────────────────┼───────┼────────────────────────┼───────────────┤ │ ACBus │ 5 │ false │ false │ │ Arc │ 6 │ false │ false │ │ Area │ 1 │ false │ false │ │ Line │ 5 │ false │ false │ │ LoadZone │ 1 │ false │ false │ │ PhaseShiftingTransformer │ 2 │ false │ false │ │ PowerLoad │ 3 │ false │ false │ │ RenewableDispatch │ 2 │ false │ false │ │ ThermalStandard │ 5 │ false │ false │ └──────────────────────────┴───────┴────────────────────────┴───────────────┘

Create a System a PSS/e File


julia> sys = System(joinpath(file_dir, "RTS-GMLC.RAW"))[ 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: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ Info: The following fields in LOAD are missing: INTRPT [ 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 ~/work/PowerSystems.jl/PowerSystems.jl/src/parsers/pm_io/psse.jl:985 ┌ Warning: This PSS(R)E parser currently doesn't support Switch data parsing... └ @ PowerSystems ~/work/PowerSystems.jl/PowerSystems.jl/src/parsers/pm_io/psse.jl:991 [ Info: angmin and angmax values are 0, widening these values on branch 32 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 29 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 1 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 54 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 78 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 81 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 101 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 2 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 105 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 109 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 74 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 41 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 65 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 51 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 53 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 106 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 119 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 27 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 75 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 42 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 33 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 28 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 50 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 52 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 111 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 63 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 115 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 92 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 88 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 93 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 26 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 10 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 120 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 77 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 24 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 87 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 117 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 58 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 25 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 114 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 23 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 49 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 59 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 5 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 31 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 89 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 62 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 43 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 90 to +/- 60.0 deg. [ Info: angmin and angmax values are 0, widening these values on branch 39 to +/- 60.0 deg. [ Info: no active generators found at bus 309, updating to bus type from 2 to 1 [ Info: no active generators found at bus 320, updating to bus type from 2 to 1 [ Info: no active generators found at bus 119, updating to bus type from 2 to 1 [ Info: no active generators found at bus 303, updating to bus type from 2 to 1 [ Info: no active generators found at bus 310, updating to bus type from 2 to 1 [ Info: no active generators found at bus 104, updating to bus type from 2 to 1 [ Info: no active generators found at bus 308, updating to bus type from 2 to 1 [ Info: no active generators found at bus 319, updating to bus type from 2 to 1 [ Info: no active generators found at bus 212, updating to bus type from 2 to 1 [ Info: no active generators found at bus 312, updating to bus type from 2 to 1 [ Info: no active generators found at bus 317, updating to bus type from 2 to 1 [ Info: no active generators found at bus 324, updating to bus type from 2 to 1 [ Info: no active generators found at bus 103, updating to bus type from 2 to 1 [ Info: the voltage setpoint on generator 32 does not match the value at bus 118 [ Info: the voltage setpoint on generator 29 does not match the value at bus 118 [ Info: the voltage setpoint on generator 1 does not match the value at bus 101 [ Info: the voltage setpoint on generator 54 does not match the value at bus 201 [ Info: the voltage setpoint on generator 78 does not match the value at bus 221 [ Info: the voltage setpoint on generator 81 does not match the value at bus 222 [ Info: the voltage setpoint on generator 101 does not match the value at bus 307 [ Info: the voltage setpoint on generator 2 does not match the value at bus 101 [ Info: the voltage setpoint on generator 105 does not match the value at bus 310 [ Info: the voltage setpoint on generator 109 does not match the value at bus 313 [ Info: the voltage setpoint on generator 74 does not match the value at bus 215 [ Info: the voltage setpoint on generator 41 does not match the value at bus 121 [ Info: the voltage setpoint on generator 132 does not match the value at bus 315 [ Info: the voltage setpoint on generator 153 does not match the value at bus 322 [ Info: the voltage setpoint on generator 65 does not match the value at bus 213 [ Info: the voltage setpoint on generator 155 does not match the value at bus 322 [ Info: the voltage setpoint on generator 51 does not match the value at bus 123 [ Info: the voltage setpoint on generator 53 does not match the value at bus 123 [ Info: the voltage setpoint on generator 106 does not match the value at bus 312 [ Info: the voltage setpoint on generator 119 does not match the value at bus 313 [ Info: the voltage setpoint on generator 27 does not match the value at bus 115 [ Info: the voltage setpoint on generator 75 does not match the value at bus 215 [ Info: the voltage setpoint on generator 42 does not match the value at bus 122 [ Info: the voltage setpoint on generator 33 does not match the value at bus 118 [ Info: the voltage setpoint on generator 28 does not match the value at bus 116 [ Info: the voltage setpoint on generator 50 does not match the value at bus 123 [ Info: the voltage setpoint on generator 52 does not match the value at bus 123 [ Info: the voltage setpoint on generator 159 does not match the value at bus 324 [ Info: the voltage setpoint on generator 111 does not match the value at bus 313 [ Info: the voltage setpoint on generator 63 does not match the value at bus 207 [ Info: the voltage setpoint on generator 121 does not match the value at bus 313 [ Info: the voltage setpoint on generator 115 does not match the value at bus 313 [ Info: the voltage setpoint on generator 141 does not match the value at bus 319 [ Info: the voltage setpoint on generator 92 does not match the value at bus 301 [ Info: the voltage setpoint on generator 88 does not match the value at bus 223 [ Info: the voltage setpoint on generator 93 does not match the value at bus 301 [ Info: the voltage setpoint on generator 26 does not match the value at bus 115 [ Info: the voltage setpoint on generator 10 does not match the value at bus 102 [ Info: the voltage setpoint on generator 120 does not match the value at bus 313 [ Info: the voltage setpoint on generator 77 does not match the value at bus 218 [ Info: the voltage setpoint on generator 24 does not match the value at bus 114 [ Info: the voltage setpoint on generator 87 does not match the value at bus 223 [ Info: the voltage setpoint on generator 117 does not match the value at bus 313 [ Info: the voltage setpoint on generator 58 does not match the value at bus 202 [ Info: the voltage setpoint on generator 25 does not match the value at bus 115 [ Info: the voltage setpoint on generator 114 does not match the value at bus 313 [ Info: the voltage setpoint on generator 23 does not match the value at bus 113 [ Info: the voltage setpoint on generator 160 does not match the value at bus 324 [ Info: the voltage setpoint on generator 154 does not match the value at bus 322 [ Info: the voltage setpoint on generator 149 does not match the value at bus 321 ┌ Info: Constructing System from Power Models │ data["name"] = "rts-gmlc" └ 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 branch data [ Info: Reading DC Line data [ Info: Reading storage data System ┌───────────────────┬─────────────┐ │ Property │ Value │ ├───────────────────┼─────────────┤ │ Name │ │ │ Description │ │ │ System Units Base │ SYSTEM_BASE │ │ Base Power │ 100.0 │ │ Base Frequency │ 60.0 │ │ Num Components │ 539 │ └───────────────────┴─────────────┘ Static Components ┌─────────────────┬───────┬────────────────────────┬───────────────┐ │ Type │ Count │ Has Static Time Series │ Has Forecasts │ ├─────────────────┼───────┼────────────────────────┼───────────────┤ │ ACBus │ 73 │ false │ false │ │ Arc │ 108 │ false │ false │ │ Area │ 3 │ false │ false │ │ FixedAdmittance │ 3 │ false │ false │ │ Line │ 105 │ false │ false │ │ LoadZone │ 21 │ false │ false │ │ StandardLoad │ 51 │ false │ false │ │ TapTransformer │ 15 │ false │ false │ │ ThermalStandard │ 160 │ false │ false │ └─────────────────┴───────┴────────────────────────┴───────────────┘

This data set does not contain any time series data. For this, check the next tutorial.