Quick Start Guide

PowerSystems.jl is structured to enable data creation scripts, flexible interfaces for data intake and extension of the data model. These features are enabled through three main features:

  • Abstract type hierarchy,
  • Optimized read/write data container (the container is called System),
  • Utilities to facilitate modeling, extensions, and integration.

It is possible to load examples systems directly using PowerSystemCaseBuilder.

julia> using PowerSystems

Loading data from files

Data can be loaded from several file formats and return a summary of the system's components and time-series. Some example files can be found in the tutorials data folder


julia> system_data = System(joinpath(file_dir, "RTS_GMLC.m"))┌ Error: Matlab parser skipping line number 802 consisting of: │ ]; └ @ PowerSystems ~/work/PowerSystems.jl/PowerSystems.jl/src/parsers/im_io/matlab.jl:64 [ Info: Correcting vm in bus 101 to 1.0468 to match generator set-point [ Info: Correcting vm in bus 102 to 1.0467 to match generator set-point [ Info: Correcting vm in bus 107 to 1.05 to match generator set-point [ Info: Correcting vm in bus 113 to 1.0347 to match generator set-point [ Info: Correcting vm in bus 115 to 1.0428 to match generator set-point [ Info: Correcting vm in bus 116 to 1.0461 to match generator set-point [ Info: Correcting vm in bus 201 to 1.05 to match generator set-point [ Info: Correcting vm in bus 202 to 1.05 to match generator set-point [ Info: Correcting vm in bus 207 to 0.9699 to match generator set-point [ Info: Correcting vm in bus 213 to 1.05 to match generator set-point [ Info: Correcting vm in bus 215 to 1.0437 to match generator set-point [ Info: Correcting vm in bus 216 to 1.0473 to match generator set-point [ Info: Correcting vm in bus 301 to 1.05 to match generator set-point [ Info: Correcting vm in bus 302 to 1.05 to match generator set-point [ Info: Correcting vm in bus 307 to 0.9568 to match generator set-point [ Info: Correcting vm in bus 313 to 1.0 to match generator set-point [ Info: Correcting vm in bus 315 to 1.0422 to match generator set-point [ Info: Correcting vm in bus 316 to 1.0449 to match generator set-point [ Info: Correcting vm in bus 114 to 1.0441 to match generator set-point [ Info: Correcting vm in bus 214 to 1.05 to match generator set-point [ Info: Correcting vm in bus 314 to 1.0 to match generator set-point [ Info: Correcting vm in bus 118 to 1.0 to match generator set-point [ Info: Correcting vm in bus 122 to 1.0 to match generator set-point [ Info: extending matpower format with data: areas 3x3 [ Info: extending matpower format with data: gen_name 158x4 [ Info: added zero cost function data for dclines [ Info: extending matpower format by appending matrix "gen_name" in to "gen" [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 32 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 32 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 29 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 29 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 1 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 1 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 54 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 54 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 78 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 78 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 81 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 81 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 101 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 101 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 2 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 2 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 105 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 105 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 109 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 109 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 74 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 74 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 41 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 41 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 65 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 65 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 51 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 51 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 53 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 53 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 106 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 106 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 119 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 119 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 27 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 27 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 75 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 75 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 42 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 42 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 33 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 33 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 28 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 28 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 50 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 50 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 52 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 52 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 111 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 111 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 63 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 63 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 115 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 115 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 92 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 92 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 88 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 88 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 93 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 93 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 26 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 26 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 10 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 10 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 120 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 120 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 77 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 77 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 24 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 24 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 87 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 87 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 117 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 117 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 58 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 58 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 25 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 25 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 114 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 114 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 23 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 23 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 49 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 49 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 59 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 59 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 5 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 5 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 31 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 31 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 89 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 89 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 62 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 62 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 43 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 43 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 90 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 90 from 90.0 to 60.0 deg. [ Info: this code only supports angmin values in -90 deg. to 90 deg., tightening the value on branch 39 from -90.0 to -60.0 deg. [ Info: this code only supports angmax values in -90 deg. to 90 deg., tightening the value on branch 39 from 90.0 to 60.0 deg. [ Info: the voltage setpoint on generator 78 does not match the value at bus 122 [ Info: the voltage setpoint on generator 105 does not match the value at bus 324 [ Info: the voltage setpoint on generator 109 does not match the value at bus 324 [ Info: the voltage setpoint on generator 155 does not match the value at bus 317 [ Info: the voltage setpoint on generator 106 does not match the value at bus 312 [ Info: the voltage setpoint on generator 75 does not match the value at bus 122 [ Info: the voltage setpoint on generator 111 does not match the value at bus 319 [ Info: the voltage setpoint on generator 121 does not match the value at bus 103 [ Info: the voltage setpoint on generator 141 does not match the value at bus 320 [ Info: the voltage setpoint on generator 77 does not match the value at bus 122 [ Info: the voltage setpoint on generator 117 does not match the value at bus 212 [ Info: the voltage setpoint on generator 154 does not match the value at bus 309 [ Info: the voltage setpoint on generator 122 does not match the value at bus 119 [ Info: the voltage setpoint on generator 137 does not match the value at bus 320 [ Info: the voltage setpoint on generator 79 does not match the value at bus 122 [ Info: the voltage setpoint on generator 80 does not match the value at bus 122 [ Info: the voltage setpoint on generator 104 does not match the value at bus 310 [ Info: the voltage setpoint on generator 123 does not match the value at bus 308 [ Info: the voltage setpoint on generator 140 does not match the value at bus 320 [ Info: the voltage setpoint on generator 107 does not match the value at bus 310 [ Info: the voltage setpoint on generator 97 does not match the value at bus 320 [ Info: the voltage setpoint on generator 156 does not match the value at bus 303 [ Info: the voltage setpoint on generator 136 does not match the value at bus 320 [ Info: the voltage setpoint on generator 148 does not match the value at bus 320 [ Info: the voltage setpoint on generator 108 does not match the value at bus 324 [ Info: the voltage setpoint on generator 116 does not match the value at bus 104 [ Info: the voltage setpoint on generator 76 does not match the value at bus 122 [ Info: the voltage setpoint on generator 138 does not match the value at bus 320 [ Info: the voltage setpoint on generator 18 does not match the value at bus 118 [ Info: the from bus voltage setpoint on dc line 1 does not match the value at bus 113 [ Info: the to bus voltage setpoint on dc line 1 does not match the value at bus 316 [ Info: simplifying pwl cost on generator 78, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 81, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 101, [0.0, 0.0, 0.309, 0.0, 0.618, 0.0, 0.927, 0.0] -> [0.0, 0.0, 0.927, 0.0] [ Info: simplifying pwl cost on generator 105, [0.0, 0.0, 0.16566669999999997, 0.0, 0.3313333, 0.0, 0.49700000000000005, 0.0] -> [0.0, 0.0, 0.49700000000000005, 0.0] [ Info: simplifying pwl cost on generator 109, [0.0, 0.0, 0.17, 0.0, 0.34, 0.0, 0.51, 0.0] -> [0.0, 0.0, 0.51, 0.0] [ Info: simplifying pwl cost on generator 74, [3.96, 3208.986, 3.9733332999999997, 3219.79067, 3.9866667000000002, 3230.59533, 4.0, 3241.4] -> [3.96, 3208.986, 4.0, 3241.4] [ Info: simplifying pwl cost on generator 132, [0.0, 0.0, 0.20800000000000002, 0.0, 0.41600000000000004, 0.0, 0.624, 0.0] -> [0.0, 0.0, 0.624, 0.0] [ Info: simplifying pwl cost on generator 153, [0.0, 0.0, 0.044000000000000004, 0.0, 0.08800000000000001, 0.0, 0.132, 0.0] -> [0.0, 0.0, 0.132, 0.0] [ Info: simplifying pwl cost on generator 155, [0.0, 0.0, 2.6636667, 0.0, 5.3273333, 0.0, 7.9910000000000005, 0.0] -> [0.0, 0.0, 7.9910000000000005, 0.0] [ Info: simplifying pwl cost on generator 106, [0.0, 0.0, 0.31366669999999996, 0.0, 0.6273333, 0.0, 0.941, 0.0] -> [0.0, 0.0, 0.941, 0.0] [ Info: simplifying pwl cost on generator 119, [0.0, 0.0, 0.0873333, 0.0, 0.1746667, 0.0, 0.262, 0.0] -> [0.0, 0.0, 0.262, 0.0] [ Info: simplifying pwl cost on generator 75, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 111, [0.0, 0.0, 0.6273333, 0.0, 1.2546667, 0.0, 1.882, 0.0] -> [0.0, 0.0, 1.882, 0.0] [ Info: simplifying pwl cost on generator 121, [0.0, 0.0, 0.205, 0.0, 0.41, 0.0, 0.615, 0.0] -> [0.0, 0.0, 0.615, 0.0] [ Info: simplifying pwl cost on generator 115, [0.0, 0.0, 0.0843333, 0.0, 0.1686667, 0.0, 0.253, 0.0] -> [0.0, 0.0, 0.253, 0.0] [ Info: simplifying pwl cost on generator 141, [0.0, 0.0, 0.094, 0.0, 0.188, 0.0, 0.282, 0.0] -> [0.0, 0.0, 0.282, 0.0] [ Info: pwl x value 0.0033333 is outside the bounds 0.0-0.0 on generator 92 [ Info: pwl x value 0.0066667 is outside the bounds 0.0-0.0 on generator 92 [ Info: pwl x value 0.01 is outside the bounds 0.0-0.0 on generator 92 [ Info: simplifying pwl cost on generator 92, [0.0, 0.0, 0.0033333, 0.0, 0.0066667, 0.0, 0.01, 0.0] -> [0.0, 0.0, 0.01, 0.0] [ Info: simplifying pwl cost on generator 88, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 93, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 120, [0.0, 0.0, 0.086, 0.0, 0.172, 0.0, 0.258, 0.0] -> [0.0, 0.0, 0.258, 0.0] [ Info: simplifying pwl cost on generator 77, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 87, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 117, [0.3, 0.0, 0.66, 0.0, 1.2, 0.0, 1.6, 0.0] -> [0.3, 0.0, 1.6, 0.0] [ Info: simplifying pwl cost on generator 114, [0.0, 0.0, 0.0863333, 0.0, 0.1726667, 0.0, 0.259, 0.0] -> [0.0, 0.0, 0.259, 0.0] [ Info: simplifying pwl cost on generator 154, [0.0, 0.0, 0.4943333, 0.0, 0.9886667, 0.0, 1.483, 0.0] -> [0.0, 0.0, 1.483, 0.0] [ Info: simplifying pwl cost on generator 149, [0.0, 0.0, 0.0393333, 0.0, 0.0786667, 0.0, 0.11800000000000001, 0.0] -> [0.0, 0.0, 0.11800000000000001, 0.0] [ Info: simplifying pwl cost on generator 89, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 122, [0.0, 0.0, 0.222, 0.0, 0.444, 0.0, 0.6659999999999999, 0.0] -> [0.0, 0.0, 0.6659999999999999, 0.0] [ Info: simplifying pwl cost on generator 90, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 143, [0.0, 0.0, 0.0323333, 0.0, 0.0646667, 0.0, 0.09699999999999999, 0.0] -> [0.0, 0.0, 0.09699999999999999, 0.0] [ Info: simplifying pwl cost on generator 112, [0.0, 0.0, 0.41700000000000004, 0.0, 0.8340000000000001, 0.0, 1.251, 0.0] -> [0.0, 0.0, 1.251, 0.0] [ Info: simplifying pwl cost on generator 129, [0.0, 0.0, 0.21266670000000001, 0.0, 0.42533329999999997, 0.0, 0.638, 0.0] -> [0.0, 0.0, 0.638, 0.0] [ Info: simplifying pwl cost on generator 150, [0.0, 0.0, 0.0373333, 0.0, 0.0746667, 0.0, 0.11199999999999999, 0.0] -> [0.0, 0.0, 0.11199999999999999, 0.0] [ Info: simplifying pwl cost on generator 137, [0.0, 0.0, 0.09, 0.0, 0.18, 0.0, 0.27, 0.0] -> [0.0, 0.0, 0.27, 0.0] [ Info: simplifying pwl cost on generator 94, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 86, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 126, [0.0, 0.0, 0.218, 0.0, 0.436, 0.0, 0.654, 0.0] -> [0.0, 0.0, 0.654, 0.0] [ Info: simplifying pwl cost on generator 99, [0.0, 0.0, 0.172, 0.0, 0.344, 0.0, 0.516, 0.0] -> [0.0, 0.0, 0.516, 0.0] [ Info: simplifying pwl cost on generator 152, [0.0, 0.0, 0.015, 0.0, 0.03, 0.0, 0.045, 0.0] -> [0.0, 0.0, 0.045, 0.0] [ Info: pwl x value 0.0033333 is outside the bounds 0.0-0.0 on generator 73 [ Info: pwl x value 0.0066667 is outside the bounds 0.0-0.0 on generator 73 [ Info: pwl x value 0.01 is outside the bounds 0.0-0.0 on generator 73 [ Info: simplifying pwl cost on generator 73, [0.0, 0.0, 0.0033333, 0.0, 0.0066667, 0.0, 0.01, 0.0] -> [0.0, 0.0, 0.01, 0.0] [ Info: pwl x value 0.0033333 is outside the bounds 0.0-0.0 on generator 82 [ Info: pwl x value 0.0066667 is outside the bounds 0.0-0.0 on generator 82 [ Info: pwl x value 0.01 is outside the bounds 0.0-0.0 on generator 82 [ Info: simplifying pwl cost on generator 82, [0.0, 0.0, 0.0033333, 0.0, 0.0066667, 0.0, 0.01, 0.0] -> [0.0, 0.0, 0.01, 0.0] [ Info: simplifying pwl cost on generator 79, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 146, [0.0, 0.0, 0.030333299999999997, 0.0, 0.060666700000000004, 0.0, 0.091, 0.0] -> [0.0, 0.0, 0.091, 0.0] [ Info: simplifying pwl cost on generator 142, [0.0, 0.0, 0.031, 0.0, 0.062, 0.0, 0.09300000000000001, 0.0] -> [0.0, 0.0, 0.09300000000000001, 0.0] [ Info: simplifying pwl cost on generator 84, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 80, [0.0, 0.0, 0.1666667, 0.0, 0.33333329999999994, 0.0, 0.5, 0.0] -> [0.0, 0.0, 0.5, 0.0] [ Info: simplifying pwl cost on generator 104, [0.0, 0.0, 0.1723333, 0.0, 0.3446667, 0.0, 0.517, 0.0] -> [0.0, 0.0, 0.517, 0.0] [ Info: simplifying pwl cost on generator 124, [0.0, 0.0, 0.33899999999999997, 0.0, 0.6779999999999999, 0.0, 1.0170000000000001, 0.0] -> [0.0, 0.0, 1.0170000000000001, 0.0] [ Info: simplifying pwl cost on generator 125, [0.0, 0.0, 0.2103333, 0.0, 0.4206667, 0.0, 0.631, 0.0] -> [0.0, 0.0, 0.631, 0.0] [ Info: simplifying pwl cost on generator 98, [0.0, 0.0, 0.172, 0.0, 0.344, 0.0, 0.516, 0.0] -> [0.0, 0.0, 0.516, 0.0] ┌ Info: Constructing System from Power Models │ data["name"] = "RTS_GMLC" └ 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 ┌ Warning: GenericBattery should be defined as a PowerModels storage... Skipping └ @ PowerSystems ~/work/PowerSystems.jl/PowerSystems.jl/src/parsers/power_models_data.jl:551 [ 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 │ 538 │ └───────────────────┴─────────────┘ Static Components ┌─────────────────────┬───────┬────────────────────────┬───────────────┐ │ Type │ Count │ Has Static Time Series │ Has Forecasts │ ├─────────────────────┼───────┼────────────────────────┼───────────────┤ │ ACBus │ 73 │ false │ false │ │ Arc │ 109 │ false │ false │ │ Area │ 3 │ false │ false │ │ FixedAdmittance │ 3 │ false │ false │ │ HydroDispatch │ 20 │ false │ false │ │ Line │ 104 │ false │ false │ │ LoadZone │ 21 │ false │ false │ │ PowerLoad │ 51 │ false │ false │ │ RenewableDispatch │ 30 │ false │ false │ │ RenewableFix │ 31 │ false │ false │ │ TapTransformer │ 15 │ false │ false │ │ ThermalStandard │ 76 │ false │ false │ │ Transformer2W │ 1 │ false │ false │ │ TwoTerminalHVDCLine │ 1 │ false │ false │ └─────────────────────┴───────┴────────────────────────┴───────────────┘

More details about parsing text files from different formats in this section


Using PowerSystems.jl for modeling

This example function implements a function where the modeler can choose the technology by its type and use the different implementations of get_max_active_power. Using the "dot" access to get a parameter value from a device is actively discouraged, use "getter" functions instead

Refer to Modeling with JuMP for a more detailed use of PowerSystems.jl to develop a model

julia> function installed_capacity(system::System; technology::Type{T} = Generator) where T <: Generator
           installed_capacity = 0.0
           for g in get_components(T, system)
               installed_capacity += get_max_active_power(g)
           end
           return installed_capacity
       endinstalled_capacity (generic function with 1 method)
  • Total installed capacity
julia> installed_capacity(system_data)144.99800000000002
  • Installed capacity of the thermal generation
julia> installed_capacity(system_data; technology = ThermalStandard)80.75999999999998
  • Installed capacity of renewable generation
julia> installed_capacity(system_data; technology = RenewableGen)54.23800000000002

Adding Time Series data to a System

PowerSystems.jl provides interfaces to augment the data sets already created. You can also add time series data to a system from one or more CSV files, more details in Time Series Data. This example implements SingleTimeSeries

julia> using TimeSeries
julia> using Dates
julia> system = 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: 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 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 │ 28 │ └───────────────────┴─────────────┘ 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 │ │ ThermalStandard │ 5 │ false │ false │ └──────────────────────────┴───────┴────────────────────────┴───────────────┘
julia> new_renewable = RenewableDispatch( name = "WindPowerNew", available = true, bus = get_component(ACBus, system, "3"), active_power = 2.0, reactive_power = 1.0, rating = 1.2, prime_mover_type = PrimeMovers.WT, reactive_power_limits = (min = 0.0, max = 0.0), base_power = 100.0, operation_cost = TwoPartCost(22.0, 0.0), power_factor = 1.0 ) WindPowerNew (RenewableDispatch): name: WindPowerNew available: true bus: 3 (ACBus) active_power: 200.0 reactive_power: 100.0 rating: 120.0 prime_mover_type: PrimeMovers.WT = 22 reactive_power_limits: (min = 0.0, max = 0.0) power_factor: 1.0 operation_cost: TwoPartCost base_power: 100.0 services: 0-element Vector{Service} dynamic_injector: nothing ext: Dict{String, Any}() time_series_container: internal: InfrastructureSystems.InfrastructureSystemsInternal
julia> add_component!(system, new_renewable)
julia> ts_data = [0.98, 0.99, 0.99, 1.0, 0.99, 0.99, 0.99, 0.98, 0.95, 0.92, 0.90, 0.88, 0.84, 0.76, 0.65, 0.52, 0.39, 0.28, 0.19, 0.15, 0.13, 0.11, 0.09, 0.06,]24-element Vector{Float64}: 0.98 0.99 0.99 1.0 0.99 0.99 0.99 0.98 0.95 0.92 ⋮ 0.52 0.39 0.28 0.19 0.15 0.13 0.11 0.09 0.06
julia> time_stamps = range(DateTime("2020-01-01"); step = Hour(1), length = 24)Dates.DateTime("2020-01-01T00:00:00"):Dates.Hour(1):Dates.DateTime("2020-01-01T23:00:00")
julia> time_series_data_raw = TimeArray(time_stamps, ts_data)24×1 TimeSeries.TimeArray{Float64, 1, Dates.DateTime, Vector{Float64}} 2020-01-01T00:00:00 to 2020-01-01T23:00:00 │ │ A │ ├─────────────────────┼───────┤ │ 2020-01-01T00:00:00 │ 0.98 │ │ 2020-01-01T01:00:00 │ 0.99 │ │ 2020-01-01T02:00:00 │ 0.99 │ │ 2020-01-01T03:00:00 │ 1.0 │ │ 2020-01-01T04:00:00 │ 0.99 │ │ 2020-01-01T05:00:00 │ 0.99 │ │ 2020-01-01T06:00:00 │ 0.99 │ │ 2020-01-01T07:00:00 │ 0.98 │ │ ⋮ │ ⋮ │ │ 2020-01-01T17:00:00 │ 0.28 │ │ 2020-01-01T18:00:00 │ 0.19 │ │ 2020-01-01T19:00:00 │ 0.15 │ │ 2020-01-01T20:00:00 │ 0.13 │ │ 2020-01-01T21:00:00 │ 0.11 │ │ 2020-01-01T22:00:00 │ 0.09 │ │ 2020-01-01T23:00:00 │ 0.06 │
julia> time_series = SingleTimeSeries(name = "active_power", data = time_series_data_raw) #Add the forecast to the system and componentSingleTimeSeries time_series (24): name: active_power data: 24×1 TimeSeries.TimeArray{Float64, 1, Dates.DateTime, Vector{Float64}} 2020-01-01T00:00:00 to 2020-01-01T23:00:00 │ │ A │ ├─────────────────────┼───────┤ │ 2020-01-01T00:00:00 │ 0.98 │ │ 2020-01-01T01:00:00 │ 0.99 │ │ 2020-01-01T02:00:00 │ 0.99 │ │ 2020-01-01T03:00:00 │ 1.0 │ │ 2020-01-01T04:00:00 │ 0.99 │ │ 2020-01-01T05:00:00 │ 0.99 │ │ 2020-01-01T06:00:00 │ 0.99 │ │ 2020-01-01T07:00:00 │ 0.98 │ │ ⋮ │ ⋮ │ │ 2020-01-01T17:00:00 │ 0.28 │ │ 2020-01-01T18:00:00 │ 0.19 │ │ 2020-01-01T19:00:00 │ 0.15 │ │ 2020-01-01T20:00:00 │ 0.13 │ │ 2020-01-01T21:00:00 │ 0.11 │ │ 2020-01-01T22:00:00 │ 0.09 │ │ 2020-01-01T23:00:00 │ 0.06 │ resolution: 3600000 milliseconds scaling_factor_multiplier: nothing
julia> add_time_series!(system, new_renewable, time_series)