Quick Start Guide

The data for these tutorials is provided in PowerSystemCaseBuilder. If you want to build your own case, take a look at the tutorial Creating and Handling Data for Dynamic Simulations

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

For a detailed tutorial about this case visit One Machine against Infinite Bus (OMIB) Simulation

Loading data

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

julia> using PowerSystems
julia> using PowerSimulationsDynamics
julia> using PowerSystemCaseBuilderERROR: LoadError: MethodError: no method matching carry_char(::String) The applicable method may be too new: running in world age 37121, while current world is 68684. Closest candidates are: carry_char(::String) (method too new to be called from this world context.) @ TimeSeries ~/.julia/packages/TimeSeries/FZlMM/src/utilities.jl:151 carry_char() (method too new to be called from this world context.) @ TimeSeries ~/.julia/packages/TimeSeries/FZlMM/src/utilities.jl:151 in expression starting at /juliateam/.julia/artifacts/e72e0ad2722dc7be918ec2879d80adedb4d65576/PowerSystemsTestData-2.1/psy_data/data_5bus_pu.jl:982 in expression starting at /juliateam/.julia/packages/PowerSystemCaseBuilder/vlTjU/src/system_library.jl:1 in expression starting at /juliateam/.julia/packages/PowerSystemCaseBuilder/vlTjU/src/PowerSystemCaseBuilder.jl:1
julia> using Sundials
julia> using Plots
julia> omib_sys = build_system(PSIDSystems, "OMIB System")ERROR: UndefVarError: `build_system` not defined

Define the Simulation

julia> time_span = (0.0, 30.0)(0.0, 30.0)
julia> perturbation_trip = BranchTrip(1.0, Line, "BUS 1-BUS 2-i_1")BranchTrip(1.0, Line, "BUS 1-BUS 2-i_1")
julia> sim = Simulation!(ResidualModel, omib_sys, pwd(), time_span, perturbation_trip)ERROR: UndefVarError: `omib_sys` not defined

Explore initial conditions for the simulation

julia> x0_init = read_initial_conditions(sim)ERROR: UndefVarError: `sim` not defined
julia> show_states_initial_value(sim)ERROR: UndefVarError: `sim` not defined

Obtain small signal results for initial conditions

Show eigenvalues for operating point

julia>     small_sig = small_signal_analysis(sim)ERROR: UndefVarError: `sim` not defined
julia> summary_eigenvalues(small_sig)ERROR: UndefVarError: `small_sig` not defined

Execute the simulation

julia>     execute!(sim, IDA(), dtmax = 0.02, saveat = 0.02, enable_progress_bar = false)ERROR: UndefVarError: `sim` not defined

Make a plot of the results

julia> results = read_results(sim)ERROR: UndefVarError: `sim` not defined
julia> angle = get_state_series(results, ("generator-102-1", :δ));ERROR: UndefVarError: `results` not defined
julia> plot(angle, xlabel = "time", ylabel = "rotor angle [rad]", label = "gen-102-1")Plot{Plots.GRBackend() n=1}

plot

If you miss PSS/e's plotting aesthetics and want something that resembles that, you can use UnicodePlots.

julia> using UnicodePlots
julia> unicodeplots()Plots.UnicodePlotsBackend()
julia> plot(angle, xlabel = "time", ylabel = "rotor angle [rad]", label = "gen-102-1");

plot