PSSE 240 Bus Case system with Renewables

To follow along, you can download this tutorial as a Julia script (.jl) or Jupyter notebook (.ipynb).

Originally Contributed by: José Daniel Lara

Introduction

This tutorial will introduce the industry models of Renewable Energy the comparisons between DiffEq Integration techniques for comparison. We show the uses of Sundials and OrdinaryDiffEq to obtain the transient response of a system to a perturbation.

using PowerSimulationsDynamics
using PowerSystemCaseBuilder
using PowerSystems
const PSY = PowerSystems
using Sundials
using Plots
using OrdinaryDiffEq
Note

PowerSystemCaseBuilder.jl is a helper library that makes it easier to reproduce examples in the documentation and tutorials. Normally you would pass your local files to create the system data instead of calling the function build_system. For more details visit PowerSystemCaseBuilder Documentation

Load the system and transform load data

To load the system we use PowerSystemCaseBuilder.jl:

# We remove the checks in this example to avoid large prints
sys = build_system(PSIDSystems, "WECC 240 Bus"; runchecks = false)

# Transform the system's load
for l in get_components(PSY.StandardLoad, sys)
    transform_load_to_constant_impedance(l)
end
┌ Info: Building new system WECC 240 Bus from raw data
  sys_descriptor.raw_data = ""
┌ Warning: The System was deserialized with checks disabled, and so was not validated.
@ PowerSystems ~/.julia/packages/PowerSystems/qry34/src/base.jl:2546
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81
┌ Warning: Load data is transformed under the assumption of a 1.0 p.u. Voltage Magnitude
@ PowerSimulationsDynamics ~/work/PowerSimulationsDynamics.jl/PowerSimulationsDynamics.jl/src/utils/psy_utils.jl:81

Build the simulation and initialize the problem

The next step is to create the simulation structure. This will create the indexing of our system that will be used to formulate the differential-algebraic system of equations. To do so, it is required to specify the perturbation that will occur in the system. In this case, we will use a ResidualModel formulation, for more details about the formulation checkout the Models Section in PowerSimulationsDynamics.jl documentation.

using Logging
sim_ida = Simulation(
    ResidualModel,
    sys, #system
    pwd(),
    (0.0, 20.0), #time span
    BranchTrip(1.0, Line, "CORONADO    -1101-PALOVRDE    -1401-i_10");
    console_level = Logging.Info,
)
Simulation Summary
Property Value
Status BUILT
Simulation Type Residual Model
Initialized? Yes
Multimachine system? Yes
Time Span (0.0, 20.0)
Number of States 2164
Number of Perturbations 1

Run the simulation using Sundials

We will now run the simulation using Sundials.jl solver IDA() by specifying the maximum dt we want for the simulation. In our experience with this solver, solution times are faster when supplying information about the maximum time step than the tolerances as we can see in the example

execute!(sim_ida, IDA(); dtmax = 0.01)
SIMULATION_FINALIZED::BUILD_STATUS = 6

Read the results and plot a system variable

After the simulation is completed, we can extract the results and make plots as desired. In this case, we will plot the voltage magnitude at the bus at which the line was connected.

res_ida = read_results(sim_ida)
v1101_ida = get_voltage_magnitude_series(res_ida, 1101);
plot(v1101_ida)
Example block output

Run the simulation using Rodas4()

In this case, we will use a MassMatrixModel formulation, for more details about the formulation checkout the Models Section in PowerSimulationsDynamics.jl documentation

sim_rodas = Simulation(
    MassMatrixModel,
    sys, #system
    pwd(),
    (0.0, 20.0), #time span
    BranchTrip(1.0, Line, "CORONADO    -1101-PALOVRDE    -1401-i_10");
    console_level = Logging.Info,
)
Simulation Summary
Property Value
Status BUILT
Simulation Type Mass Matrix Model
Initialized? Yes
Multimachine system? Yes
Time Span (0.0, 20.0)
Number of States 2164
Number of Perturbations 1

We will now run the simulation using OrdinaryDiffEq.jl solver Rodas4() by specifying the tolerance we want for the simulation. In our experience with this solver, solution times are faster when supplying information about the atol and rtol values as we can see in the example. The solver will also work with a specified dtmax but take a significantly longer time to solve. When using OrdinaryDiffEq.jl solvers always pass the option initializealg = NoInit() to avoid unnecessary re-initialization of the algebraic equations.

execute!(
    sim_rodas,
    Rodas4();
    saveat = 0.01,
    abstol = 1e-6,
    reltol = 1e-6,
    initializealg = NoInit(),
)
SIMULATION_FINALIZED::BUILD_STATUS = 6

Read the results

After the simulation is completed, we can extract the results and make plots as desired. In this case, we will plot the voltage magnitude at the bus at which the line was connected.

res_rodas = read_results(sim_rodas)
Simulation Results Summary
Property Value
System Base Power [MVA] 100.0
System Base Frequency [Hz] 60.0
Time Span (0.0, 20.0)
Total Time Steps 2002
Number of States 2164
Total solve time 49.298002577

Compare the results

After the simulation is completed, we can extract the results and make plots as desired. In this case, we will plot the voltage magnitude at the bus at which the line was connected. For both of the solution techniques.

v1101 = get_voltage_magnitude_series(res_rodas, 1101);
plot(v1101; label = "RODAS4");
plot!(v1101_ida; label = "IDA")
Example block output