11
2325-5897/21©2021IEEE IEEE Electrification Magazine / JUNE 2021 72 URRENT TRENDS IN ENERGY SYSTEMS point to renewable energy sources (RESs) and battery energy storage systems (BESSs) becoming prevalent in power sys- tem operations. As of writing this article, the United States has more than 37 GW of utility-scale solar capacity and an additional 112 GW under develop- ment. With the rapidly declining capital costs of many of these technologies, we can expect significant deploy- ments in the coming years. The change in the primary energy supply mix isn’t the only large-scale shift happening in power systems. Inte- grating massive numbers of generators interfaced through power electronics is also updating our basic understanding of system stability and control. One such example of an advancement is the displacement of traditional rotating generation, which reduces system inertia. It results in higher rates of change of frequency, a lower-frequency nadir following disturbances, and complex interactions between the dynamics of power electronics converters and other power systems components. Over many decades, the power system community has developed standards to model and study synchronous machines and controls. These standards include IEEE 1110 and IEEE 421, which provide guidelines about the model- ing practices required to adequately assess system stabili- ty and performance. But the introduction of RESs and BESSs render the study of these relationships more chal- lenging because many of the assumptions upon which existing standards are based may no longer be valid (see Milano et al. 2018 and Markovic et al. 2021). Due to the complexity and scale of power system analysis, researchers rely on computational tools and simulations to explore and understand the new phe- nomena that might emerge in the future systems Transient Simulations With a Large Penetration of Converter- Interfaced Generation Scientific computing challenges and opportunities. ©SHUTTERSTOCK.COM/PLUIE_R By Rodrigo Henriquez-Auba, Jose Daniel Lara, Duncan S. Callaway, and Clayton Barrows Transient Simulations With a Large Penetration of Converter- Interfaced Generation Digital Object Identifier 10.1109/MELE.2021.3070939 Date of current version: 8 June 2021

By Rodrigo Henriquez-Auba, Jose Daniel Lara, Duncan S

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

2325-5897/21©2021IEEEIEEE Electr i f icat ion Magazine / JUNE 202172

URRENT TRENDS IN ENERGY SYSTEMSpoint to renewable energy sources (RESs) and battery energy storage systems (BESSs) becoming prevalent in power sys-tem operations. As of writing this article,

the United States has more than 37 GW of utility-scale solar capacity and an additional 112 GW under develop-ment. With the rapidly declining capital costs of many of these technologies, we can expect significant deploy-ments in the coming years.

The change in the primary energy supply mix isn’t the only large-scale shift happening in power systems. Inte-grating massive numbers of generators interfaced through power electronics is also updating our basic understanding of system stability and control. One such example of an advancement is the displacement of traditional rotating

generation, which reduces system inertia. It results in higher rates of change of frequency, a lower-frequency nadir following disturbances, and complex interactions between the dynamics of power electronics converters and other power systems components.

Over many decades, the power system community has developed standards to model and study synchronous machines and controls. These standards include IEEE 1110 and IEEE 421, which provide guidelines about the model-ing practices required to adequately assess system stabili-ty and performance. But the introduction of RESs and BESSs render the study of these relationships more chal-lenging because many of the assumptions upon which existing standards are based may no longer be valid (see Milano et al. 2018 and Markovic et al. 2021).

Due to the complexity and scale of power system analysis, researchers rely on computational tools and simulations to explore and understand the new phe-nomena that might emerge in the future systems

CCC

Transient Simulations With a Large Penetration of Converter-Interfaced Generation

Scientific computing challenges and opportunities.©SHUTTERSTOCK.COM/PLUIE_R

By Rodrigo Henriquez-Auba, Jose Daniel Lara, Duncan S. Callaway, and Clayton Barrows

Transient Simulations With a Large Penetration of Converter-Interfaced Generation

Digital Object Identifier 10.1109/MELE.2021.3070939Date of current version: 8 June 2021

IEEE Electr i f icat ion Magazine / JUNE 2021 73

characterized by widespread RESs and BESSs. In 2021, the U.S. National Academy of Sciences recognized the importance of understanding how the grid of the future will behave and how operators and policy mak-ers can ensure its continued reliability. The capacity to do this rests on improving the simulation capabilities necessary to build and test the integration of new devices and components.

Fortunately, the array of software tools available for researchers to conduct large-scale studies has also grown significantly. Progress in numerical solver algo-rithms, model-order-reduction techniques, automatic differentiation (AD), and symbolic and numerical com-putation, among other areas, are advances essential to the development of the new analysis techniques demanded by the realities of a modernizing grid. The power systems field is ripe with current and future opportunities to exploit these techniques for novel mod-eling and control methods. However, critical obstacles remain and among these, researchers must develop the capacity to surmount the dramatic increases in model-ing complexity.

This article focuses on the importance of scientific computing principles and showcases the modern software developments that enable large-scale power system studies. We stress that computer-aided simu-lation research has to be replicable, the results must be validated, and systems should be scalable such that they are of realistic proportions and make a sig-nificant contribution to our understanding. We dis-cuss how the Julia programming language can be used to tackle these challenges and outline the ways that The Scalable Integrated Infrastructure Planning (SIIP) (https://www.nrel.gov/analysis/siip.html) initia-tive at the National Renewable Energy Laboratory (NREL) is capturing these opportunities in power sys-tems analyses.

Scientific Computing PracticesThere is no single definition of scientific computing as the field has evolved from purely computational issues to the general use of computers and software to answer scientific questions. However, all scientific computing definitions share the objective of enabling 1) the repro-ducibility of the experiments and 2) the mechanisms used to verify the validity of the conclusions derived. Lara et al. 2020 provides a detailed discussion of these definitions for power system operational studies. Fig-ure 1 summarizes the three steps required to perform a simulation experiment, which follow best practices in scientific computing: data, computational modeling, and results subprocesses.

In practical terms, achieving reproducibility and valida-tion requires that two major components, the environ-ment and the experimental workflow, are considered.

xx Environment: The environment comprises the hard-ware components and the configuration of all the software used to implement a computational experi-ment. The environment may include elements such as cloud services, third-party software, file manage-ment scripts, and external tests.xx Workflow: The workflow is the full process of data intake, computation, and results. The development and careful documentation of a workflow is a require-ment for validation and reproducibility.

In this respect, open source tools provide the required capabilities to facilitate scientific computing for power systems research. Despite challenges, several open source efforts have grown to be successful in the com-munity and reduce the barriers to entry for those seek-ing to perform high-quality research and reliable analysis. MATPOWER (https://matpower.org) is a MAT-LAB-based tool that is widely used to perform steady-state analyses such as power flow, continuation power flow, and optimal power flow. OpenDSS (https://

ExperimentalData

Select TrialData

...

Test Set1

Test Set2

Test Setn

Data Process

Simulation

DecisionModel

+Emulator

Computing Process

...

SimulationOutput 1

SimulationOutput 2

SimulationOutput n

Metricsfor theTrial

Results and Reporting Process

Figure 1. The computing steps required for conducting a single trial in a simulation experiment. These steps follow the best practices in scien-tific computing to achieve reproducibility and validation: data, computational modeling, and results subprocesses. (Adapted from Lara et al. 2020; used with permission.)

IEEE Electr i f icat ion Magazine / JUNE 202174

smartgrid.epri.com/Simulation Tool.aspx) is used for multiple distri-bution systems analysis. In the field of transient simulations, the MAT-LAB-based Power System Analysis Toolbox (PSAT) (http://faraday1 .ucd.ie/psat.html) provides elec-tromechanical simulations with multiple models. More recently, the Python-based tool ANDES (https://docs.andes.app/en/stable/) has become available for power system simulation. It uses a hybrid symbol-ic-numeric framework for numeri-cal analysis.

However, there is a high setup cost associated with developing dynamic simulation applications that can run large-scale experiments. For this rea-son, researchers resort to using industrial tools once their systems of interest grow larger than hundreds of buses. However, these proprietary models and algo-rithms are not openly available; this means that both using them and replicating the results obtained by other researchers who use them require large sums of

money for license acquisition. This common practice reduces the capac-ity for innovation in the power sys-tems field for researchers who must, rather than use industrial tools, reimplement these well-established models, develop their own data sets, and handle the integration libraries. This reality translates to the fact that scientific reproducibility is often either not achieved or limited to “code sharing.”

Simulation reproducibility requires the separation of models and algo-rithms when developing modeling libraries. Figure 2 depicts the software stack of a dynamic modeling applica-tion as follows:

xx Modeling layer: This layer contains all of the code repre-sentations of the system behavior in differential and/or algebraic equations; for instance, charging and dis-charging capacitors or proportional–integral–derivative (PID) controllers. xx Integration algorithms: The libraries that implement an integration scheme and are used to obtain the

LinearAlgebraLibraries

Integration AlgorithmLibraries

Models

ElectromagneticGenerator

ModelInverterModel

ClassicalGenerator

Model

ImplicitMultistepMethods

(BDF)Explicit

MultistepMethods

(AB2)

LAPACK

BLAS

SuperLUMT

One-StepMethods

(Euler, RK)

Figure 2. A description of the common software layers in a scientific research software program. A modeling layer is shown with the code repre-sentation of the equations and algorithms used to solve the models, along with the numerical linear algebra libraries utilized to perform the cal-culations. RK: Runge–Kutta; AB2: Adams–Bashforth-2; BDF: backward differentiation formula.

The environment comprises the hardware components and the configuration of all the software used to implement a computational experiment.

IEEE Electr i f icat ion Magazine / JUNE 2021 75

numerical solution of the mod-els’ differential equations. For instance, Euler, backwards differ-entiation formulas, and Runge-Kutta, among others.xx Linear algebra libraries: In this layer, low-level algorithms are used to perform numerical lin-ear algebra calculations for sys-tem solutions, a lower–upper (LU) decomposition, or eigenvalue calculations.

Novel research needs improve-ments at all levels of the software stack; however, progress requires that the computational experiments be replicated under many conditions. Free and open source-validated models that provide a benchmark for the development of algorithms are a criti-cal step that is not currently available. Stable and reliable implementations of integration algorithms usually require tremendous development efforts and limit the scope of the models to small systems.

More tools are emerging to address each of these mod-eling needs, thanks to the advent of code-sharing reposi-tories, broad access to software development tools, and the popularity of open source programming languages like R, Julia, and Python. However, without a deliberate effort to develop a platform that can be reused by many researchers, we risk limiting the scope and scale of power system research or duplicating efforts. In this context, the Julia program-ming language offers a host of unique features that significantly reduce the effort to implement sci-entific computing practices to sim-ulate low-inertia power systems. Before discussing Julia, we first highlight some key challenges of low-inertia systems.

Computational Challenges of Low-Inertia SystemsThe dynamic analysis of power sys-tems resorts to mainly two compu-tational numerical methods: 1) time-domain simulations and) small-signal stability analysis. For many decades, there has been a focus on reducing time-domain simulations’ computational com-plexity through model order re -ductions. Some of the modeling practices and analytical assump-tions currently in use derive from

the singular perturbation theory pop-ularized in the 1980s. The seminal papers showed that a simplified model is still a valid representation of certain system dynamics under the premise of time scale separation.

Traditionally, time-domain simu-lations assume that the fundamental frequency of the system dominates current and voltage waveforms. As a result, the network can be simplified to a voltage and current phasor rep-resentation, known as the root mean square (RMS) or quasi-static phasor modeling approach . Additionally, synchronous generator stator fluxes relationships reduce to algebraic

equations, further simplifying RMS modeling ap -proaches. However, this representation cannot capture some of the converters’ high-frequency dynamics. Fig-ure 3 displays the dependency between frequency phe-nomena and modeling requirements to capture the system’s behavior.

In power systems dominated by synchronous machines, the source of dynamics is physical phenomena with a behavior described by physics laws. These include, for instance, magnetic fluxes, electromechanics, mechani-cal control reaction times, or thermodynamic processes. Moreover, the control logic is commonly tuned to the

Lightning Propagation

Switching Surges

Inverter-Based Controls

Stator Transients andSubsynchronous Resonance

Rotor-Angle Dynamics

Governor and LoadFrequency Control

Voltage Control

Boiler Dynamics

How to model?Phasor representation

or full waveform?

WavePhenomena

Electromagnetic

Phenomena

Electromechanical

Phenomena

Thermodynamic

Phenomena

10–7 10–5 10–3 10–1 101 103 105

Time (s)

Figure 3. The time scales used for power systems’ dynamic behavior. Current power systems have dynamic behaviors dominated by physical laws. New inverter dynamics introduces new dynamics from logical components and poses new challenges in model complexity for time-domain simulations. (Adapted from Hatziargyriou et al. 2020).

From an analytical perspective, RMS and EMT modeling approaches are similar: They both use differential-algebraic equations to represent system dynamics.

IEEE Electr i f icat ion Magazine / JUNE 202176

respective time scale of the relevant process, creating a “natural” separation among the time processes.

On the other hand, inverter-based generation is domi-nated by dynamics induced by logic and controls, such as a phase-locked loop (PLL), voltage and current controllers, and power controllers. In the control block diagram of the virtual synchronous machine (VSM) inverter model pre-sented in Figure 4, the only states defined by physical phe-nomena are the six resistor-inductor-capacitor (RLC) filter states. As a result, the inverter dynamics can span a wide range of time scales and interact with existing controls or physical components.

These two dynamic behavior sources can interact unexpectedly, and the guidance of time scale separation may not apply. Hence, when studying the massive integra-tion of converter-interfaced sources, it is impossible to know a priori if and at which time scales the interactions may occur and requiring dynamic simulations that cap-ture fast electromagnetic phenomena, such as electro-magnetic transients (EMT), on a large scale introduces computational challenges.

From an analytical perspective, RMS and EMT model-ing approaches are similar: They both use differential-algebraic equations (DAEs) to represent system dynamics. The dynamic models used in the power industry tend to be stiff because they represent phenomena at multiple rates. Depending on the model’s time constants, the required integrator time steps can impose substantial

computational requirements. In RMS models, the maxi-mum time step is ~1–10 ms. Simultaneously, EMT time step usually is about ~1–50 μs. As a result, RMS simula-tions are typical when modeling large, interconnected areas like continental Europe or the Eastern Interconnec-tion in the United States. They are typically used to study the transient response of different disturbances and require significant simplifications. On the other hand, EMT simulations have a smaller scope. They are common-ly used to analyze a single device’s dynamic behavior against infinite buses.

The difference in modeling complexity also means that the RMS and EMT simulations’ solution methods differ in important ways. The commercial tools for RMS modeling typically implement Adams–Bashforth-2 and use explicit formulation through mass matrix representations. On the other hand, EMT software tools use the trapezoidal rule and directly model the electromagnetic differential equations (also known as the Dommel method) in the solu-tion process.

In large systems with detailed models, the calculation of Jacobian matrices and eigenvalues can require signifi-cant computational effort. There are multiple opportuni-ties available from the recent advances in AD thanks to the machine learning community that obtain exact Jaco-bians in this area. Exact Jacobians have myriad uses in dynamic modeling, from algorithmic design to parame-ter evaluation.

OuterControlLoop

Three States: [θoc, ωoc, qoc]

VirtualImpedance

PLL

InnerControlLoop

PWM

ToGrid

RLC FilterSix States:

p∗

q∗

w∗v∗

ωpll

Four States:[vpll , εpll, θpll]

dq

i dqo i abc

o

vabcovdq

o

i dqcnv

i abccnv

dq

abc

ωoc

ωoc

v~

v

"

[ξdq, γ dq, φdq ]ic ic ic vdc

v

θoc

m

If

rf

rt It

cf

[icnv, iri, v ri ]ri

o o

Six States:

Figure 4. A block diagram of a commonly used 19-state grid-supporting inverter for simulation experiments. This architecture features the main components of inverter models: the outer control that uses a VSM model, the PLL, the inner controls, and the filter. PWM: pulsewidth modulation.

IEEE Electr i f icat ion Magazine / JUNE 2021 77

Calculating the system eigenvalues for multiple operat-ing conditions and parameter values is standard practice to study power systems’ stability. Fast and exact Jacobian matrix calculations and sparse linear algebra are two basic capabilities that will improve low-inertia studies.

The new demand for larger scales and more details in modeling require changing how we approach developing simulation experiments. To do this, we need innovative approaches to obtain reliable system assessments using better computational tools. The power system sector needs to accelerate the adoption of the recent improve-ments in algorithms and hardware. To this end, adopting scientific computing practices is critical to reducing development and deployment barriers.

The Julia Programming LanguageChoosing a programming language to develop a simula-tion tool can seem like a marginally relevant decision; however, this choice can have significant impacts on reproducibility and scalability. Scripted programming lan-guages usually do not implement high-performance code natively. High-performance applications require low-level compiled languages to handle large-scale computations. For instance, there are many distinct implementations of NumPy for linear algebra in Python with identical pro-gramming interfaces. The same applies to many other large-scale numerical libraries, like LSODE (Livermore Solver for Ordinary Differential Equations), SUNDIALS (suite of nonlinear and differential/algebraic equation solvers), or PETSc (portable, extensible toolkit for scientific computation). These well-established high-performance numerical libraries are hard to extend. Usually, they have dependencies on other compiled libraries, like BLAS, LAPACK, or SuiteSparse, as shown in Figure 2, which add further complexity.

Julia is a dynamically typed programming language developed by Bezanson et al. 2017, intended to bridge the gap between scripting languages like Python or MATLAB and high-performance languages like C++ or Fortran. Julia uses a low-level, virtual machine-based just-in-time (JIT) compiler and incorporates some essential features from the beginning of its design, such as excellent support for parallelism and GPU programming, and features a practi-cal, functional programming orientation. Julia can gener-ate the same assembly code as C or C++ with the convenience of scripted languages.

Besides the language’s computational capabilities, the Julia environment itself provides several features that facilitate the development of large-scale dynamic models following scientific computing practices. Impor-tantly, it addresses the shortcomings of other scripted languages, such as dependency handling. These capa-bilities make Julia an excellent match to tackle scientific computing challenges in the power systems communi-ty. The following are a few critical examples of Julia’s good environment.

xx A comprehensive package manager that enables reproducibility among researchers by setting up the exact package and binary versions. Integrating “Arti-facts” into the package manager, Julia can include information that is not related to Julia packages, which includes platform-specific binaries or data sets. This enables researchers to pack all of the experiment requirements in a reproducible environment that can be executed in multiple platforms. This mechanism is also used to provide reproducible binary dependencies for packages built with BinaryBuilder.jl.xx Julia is a flexible language that has the convenience of scripting languages without the performance penalty. As a JIT-compiled language, Julia can be as fast as C or C++ but without the learning curve (see Bezanzon et al. 2017). Multiple dispatch is crucial to the effective-ness of Julia as a programming language for scientific software. Associating methods with generic functions rather than the type they on which they operate is a highly effective strategy for code reuse and extension. This capability promotes the implementation of generic interfaces for custom models without requir-ing changes to the source code.xx Julia has s suite of packages for scientific machine learning with multiple differential equation solvers, DifferentialEquations.jl (see Rackauckas and Nie 2017), and automated model discovery (DiffEqFlux.jl). DifferentialEquations.jl offers more than 30 different numerical solvers for ordinary differential equation/DAE systems, including both explicit (via mass matrices) and implicit representation. Some solvers, including classic algorithms and novel ones from recent research, can outperform the “standard” C/For-tran methods. In addition, it provides a wrapper for those C/Fortran methods, allowing for the use of them when necessary. In a nutshell, DifferentialEqua-tions.jl enables solving differential equations using different algorithms (from even other packages or languages) by providing a common interface. Effec-tively, it allows exchanging the algorithm layer with a single line of code. This feature provides benchmark-ing and testing different solution methods according to the specific problem.xx Small-signal stability analyses such as eigenvalue location, root locus, or Bode plots rely on computing the Jacobian of the nonlinear DAE system. Usually, deriva-tives are computed via a finite differences approach, which is inefficient due to the high number of evalua-tions of the system function, and only approximates its result due to the usage of the finite small value of step h. AD is a method used to compute the exact deriva-tives given only the function itself. ForwardDiff.jl and ReverseDiff.jl are the most common established pack-ages utilized to perform AD to compute derivatives in Julia. Both of these methods generally outperform non-AD algorithms in both speed and accuracy.

IEEE Electr i f icat ion Magazine / JUNE 202178

PowerSystems.jl and PowerSimulationsDynamics.jlThe aforementioned features and capabilities are used extensively as part of the SIIP initiative to provide tools that implement the scientific computing workflow in Fig-ure 1. PowerSystems.jl provides a consistent and high-per-formance data model and modular modeling platform for power systems across multiple time scales. Along with the data containers, PowerSystems.jl furnishes parsing capa-bilities from commonly used text-based data files (MAT-POWER, *.raw, and *.dyr). Once the system is loaded, users can make modifications, add custom models, and serial-ize to disk. The serialization/deserialization of custom data sets is one of the key enablers of the Julia ecosystem that supports scientific computing practices for power systems modeling.

For developers, PowerSystems.jl provides a generic, reusable, and customizable data model agnostic to the implementation details of the mathematical models and is applicable to multiple software strategies. It also pro-vides extension capabilities by design that make it easier to integrate into other initiatives.

Figure 5 shows the implementation of the DynamicIn-jection data containers in PowerSystems.jl. Each device is composed of the corresponding dynamic components that define the model. As a result, it is possible to flexibly define dynamic data models and methods according to the analysis requirements. DynamicInjection compo-nents use a parametric-type pattern to materialize the full specification of the dynamic injection model with parameters. This design enables a modular implementa-tion of the mathematical model for each dynamic com-ponent separately.

The modeling is implemented in PowerSimulationsDy-namics.jl (PSID) and uses PowerSystems.jl data structures to define power system dynamic devices and their corre-sponding components. The modeling layer is designed to mix and match different component models with a small number of script modifications. The flexibility of model specification enables precise control when specifying the complexity of each power system device.

Julia’s multiple dispatch lies at the core of PSID power as a scientific scripting and computing library for dynamic

DynamicInjectionConverter

OuterControl

InnerControl

DCSource

FrequencyEstimator

Machine

Shaft

AVR

TurbineGov

PSS

Filter

get_nameget_ω_refget_extget_statesget_n_statesget_converterget_outer_controlget_inner_controlget_dc_sourceget_freq_estimatorget_filterget_P_refget_V_ref

DynamicInverter

ConverterOuterControlInnerControlDCSource

FrequencyEstimatorFilter

get_nameget_statesget_n_statesget_w_refget_machineget_shaftget_avrget_prime_moverget_pssget_extget_internalget_V_refget_P_ref

DynamicGenerator

MachineShaftAVR

TurbineGovPSS

Figure 5. The dynamic data structures for DynamicInverter and DynamicGenerator in PowerSystems.jl. Each subtype is composed of the corre-sponding dynamic components that define the model. As a result, it is possible to flexibly define dynamic data models and methods according to the analysis requirements. AVR: automatic voltage regulator; PSS: power system stabilizer.

IEEE Electr i f icat ion Magazine / JUNE 2021 79

models. It uses the compiler to de -termine which method to call based solely on the types of the argument passed into a generic function. This enables code reuse and the imple-mentation of generic interfaces for custom models without re -quiring modifications to the main source code.

The flexibility in PSID originates from the use of polymorphism and encapsulation in the device model’s definition, which enables treating objects of different types similarly if they provide common interfaces. Generators and inverters are defined as a composition of components, as shown in Figure 5; the functionalities of the component instances determine the device model providing a flat interface to the complex object. This design enables the interoperability of components within a generic device definition. As a result, it is possible to implement custom component models and interface them with other exist-ing models using minimal effort.

Figure 6 presents the dependencies between PSID and the DifferentialEquations.jl libraries. The archi-tecture of PSID is such that the power system models are all self-contained and return the model func-tion evaluations. The Jacobian is calculated through a common interface with ForwardDiff.jl, enabling the use of any solver available in Julia through Differen-tialEquations.jl or any other following the common interface specification.

PSID provides mechanisms that handle commonly required routines when developing dynamic modeling libraries, such as the following.

xx The robust, systemwide initialization of the model: Find-ing valid initial conditions is notoriously tricky in large-scale nonlinear dynamic models. PSID uses rou-tines based on the dynamic model structure to pro-vide reliable initial points.xx The addition of perturbation through callbacks: Classical-ly, the study of perturbations in dynamic systems requires a series of steps to obtain valid system condi-tions postperturbation. PSID implements perturbation through callbacks, allowing the solver’s algorithm to perform the reinitialization in a compatible fashion.xx Small-signal analysis: Performing small-signal analysis requires providing the Jacobian matrix or estimating through numerical methods. PSID uses ForwardDiff.jl to calculate the exact Jacobians of the models and enables small-signal analysis at no additional devel-opment cost.

PSID exploits the Julia programming language and its eco-system to facilitate the computational exploration of power systems with converter-interfaced generation.

Example Case A: Machine, Inverter, and Network Model InteractionsAs discussed previously, exploring the interactions among inverter models and other dynamics in the system is one of the critical tasks in the devel-opment of the analytical techniques used to study modern power systems. One of the capabilities of PSID mixing and matching different levels of model complexities to study how they can change the conclusions.

This example simulation presents the time-domain simulation of an inverter and compares the results using three different generator models and two distinct network models in a three-

bus system. The simulations use a 19-state grid-supporting VSM inverter with average pulsewidth modulation dynam-ics. The control block diagram of the inverter is shown in Fig-ure 4. The example code is available in the SIIP Examples repository (https://github.com/NREL-SIIP/SIIPExamples.jl) and in PSID’s documentation.

Figure 7 depicts the evolution of the generator’s voltage magnitude at bus 2 after a circuit trip connecting the invert-er and the infinite bus at t = 1 s. PSID enables the explora-tion of several assumptions in the study of the dynamics of the system.

xx In the “Static lines” network model, the relationship between the voltage and current phasors is algebraic

DifferentialEquations.jlCommon Interface

PowerSystems.jlData Structures

Models and Methods

Differential EquationsSolver

ForwardDiff.jlSmall-Signal Analysis

PowerSimulationsDynamics.jl

f (x )

f (x ), J (x )

x

Figure 6. The architecture of PSID is such that the power system models are all self-contained and return the model’s function evalua-tions. The Jacobian is calculated through DifferentialEquations.jl’s common interface, enabling the use of any solver available in Julia.

DynamicInjection components use a parametric-type pattern to materialize the full specification of the dynamic injection model with parameters.

IEEE Electr i f icat ion Magazine / JUNE 202180

via the admittance matrix. In the “Dynamic lines” network model, the relationship is via differential equations, commonly known as dynamic phasors, which allow for the capture of electromag-netic dynamics.xx A fourth-order model is a simpli-fied one with only transient elec-tromotive forces (emfs). The sixth-order model, commonly known as the GENROU model (round rotor generator), considers both the transient and subtran-sient emfs, but the stator fluxes dynamics are approximated via algebraic representations. Finally, the eighth-order model, known as the Marconato model, considers both the transient and subtransient electromagnetic fields, with dynamic stator flux representation through dif-ferential equations.

Thus, PSID can run an RMS simula-tion, using a fourth- or sixth-order model with “Static lines,” or an EMT simulation using the eighth-order model with “Dynamic lines.” It is also possible to combine the sixth-order model (typically used in RMS) with a “Dynamic lines” model and study such hybrid behavior, as depicted in Figure 7. As mentioned previously, this flexibility is one of the core features provided in PSID.

A model with more detail, such as the eighth-order model case, has sig-nificantly faster dynamics, as shown in Figure 7. The additional modeling

detail comes with an extra computational cost. Solving this EMT model requires a time step of no larger than 500 μs. The other example RMS simulations require a time step of only 20 ms. In addition, we analyze the response of the inverter under the four models presented. Figure 8

depicts the time series of the virtu-al speed under the same perturba-tion. As observed, no significant differences can be observed in this inverter state for the cases studied. This limited example showcases the challenges of making EMT sim-ulations a requirement of power systems in the presence of power electronics converters.

This simple case demonstrates how different model assumptions may change the simulation results. Figure 7 indicates that additional details from the EMT model furnish an understanding comparable to that which is provided by simpler or hybrid models. Although this is not a general result, it highlights the possible trade offs between the result details and model complexity.

Example Case B: A 14-Bus SystemAn additional objective of PSID is to facilitate the development of study cases for low-inertia systems, similar to traditional RMS benchmark sys-tems. Example case B shows the well-known IEEE 14-bus system with five generators. All of the results pre-sented here are also available to the reader as Jupyter Notebooks in the SIIP Examples repository.

Using PSID, we model each gen-erator with a sixth-order machine

Vol

tage

Mag

nitu

de (

p.u.

)

Vol

tage

Mag

nitu

de (

p.u.

)

1.0075

1.01

1.0125

1.015

1.0175

1.0075

0.975 1 1.025 1.05 1.075 1.1

1.01

1.0125

1.015

1.0175

|V | Fourth-Order Gen: Static Lines|V | Sixth-Order Gen: Static Lines|V | Sixth-Order Gen: Dynamic Lines|V | Eighth-Order Gen: Dynamic Lines

0 10 20Time (s)

30 40

Figure 7. The generator bus voltage |V | in example case A using different machine and network mod-els. These results show how using different model complexity alters the dynamic response results. In certain cases, the additional dynamics can induce instabilities not observed in simpler models.

PSID implements perturbation through callbacks, allowing the solver’s algorithm to perform the reinitialization in a compatible fashion.

IEEE Electr i f icat ion Magazine / JUNE 2021 81

model: GENROU. Additionally, we use an IEEE AC1A auto-matic voltage regulator (AVR) system and a gas steam tur-bine model turbine governor in the slack bus. The ability to quickly switch devices and models is another core feature of PSID. In this example, we conduct two simulations: one with synchronous machines only and a second case in which we replace the generator located at bus 6 for an aggregated model of a VSM grid-supporting inverter with 19 states, the same model used in example case A. This example allows us to explore the effects of substituting synchronous machines with converter-interfaced generation.

After the system’s components are defined, all the devices are automatically initialized based on the power flow results. If a feasible point exists, then the system is appropriately initialized and can be used for simulation. Using AD, PSID provides small-signal information for the operating point, such as eigenvalues, damping of each mode, and participation factors. In this example simulation, we use an admittance matrix formulation for the network model representation.

Figure 9 presents a comparison of the eigenvalues (at the operating point) for both systems with and without the inverter, separated into “fast” and “slow” dynamics. The states are assigned to eigenvalues via their participa-tion factors. This comparison is crucial for determining, in each simulation, the fastest dynamics that could be approximated via an algebraic representation.

As shown in Figure 9, the electromagnetic dynamics of the RLC filter in the inverter are the fastest dynam-ics, and for this operating point could reasonably be neglected in our study case because they are, effective-ly, on different time scales.

Similarly, the low-pass filter model used to measure the bus voltage of the excitation systems could also be ignored and considered an ideal measurement. However, based on this analysis, the inverter eigenvalue associated with the virtual speed and the PLL dynamics are suffi-ciently close to the AVR exciter time scale and should be considered in a time-domain simulation. These results highlight the complexity of defining modeling strategies to study converter and system dynamics interactions.

We perform a time-domain simulation to explore the behavior of the system under a perturbation. Figure 10 depicts the rotor speed of the generator and the virtual speed of the inverter after an ideal trip of the line

0 1 2 3

Time (s)

0.999

1.001

1.002

1.003

1.004

1

Virt

ual S

peed

(p.

u.)

ωvsm Fourth-Order Case: Static Lines

ωvsm Sixth-Order Case: Static Linesωvsm Sixth-Order Case: Dynamic Lines

ωvsm Eighth-Order Case: Dynamic Lines

Figure 8. The virtual speed ~vsm using different machine and net-work models for example case A. Continuing from the results in Fig-ure 7, the machine’s and lines’ modeling assumptions do not affect the evolution of inverter’s virtual speed.

Original 14-Bus EigenvaluesGenerators and Inverter: 14-Bus Eigenvalues

–200–800–1,400–2,000–2,600 0–10–20–30–40–50–60

–5,000

–2,500

–5,000

–2,500

0

–10

–5

5

10

0

Virtual-Speed

EigenvalueEigenvalues: AVR States andInverter Voltage Controller

lm (λ)

lm (λ)

Re (λ)

(a)

Re (λ)

(b)

RLC FilterEigenvalues

Eigenvalues: GeneratorDamping Flux Linkages Statesand Inverter Current Controller

AVR-VoltageMeasurementEigenvalues

PLLEigenvalues

Figure 9. The eigenvalues for machines based on example case B: a 14-bus system (blue circles) and a modified 14-bus system (red crosses). (a) “Fast” dynamics and (b) “slow” dynamics. The inverter model introduces new fast dynamics that interact with the dynamics of synchronous machines and cannot be neglected when performing dynamic simulations.

IEEE Electr i f icat ion Magazine / JUNE 202182

connecting buses 2 and 4. As expected, the dynamics observed in the inverter are faster, but the system manag-es to converge to a new stable operating point.

This simplified generator substitution demonstrates that exchanging generators for converters can significantly impact the dynamic mode interactions. It also shows that there are opportunities available to simplify modeling details to speed up simulations. However, these simplifica-tions may require sophisticated approaches to choose model complexity correctly.

ConclusionThe increasing penetration of converter-interfaced gener-ation will undoubtedly lead to new challenges and oppor-tunities in computational power system studies. In this article, we reviewed the main computational challenges of low-inertia systems, such as modeling complexity, the interaction between synchronous machine controllers and inverter controllers, and numerical time-step integra-tion requirements. This article highlighted the importance of scientific computing principles to tackle these issues by enabling the reproducibility and validity of such simula-tion experiments.

We discussed how the Julia programming language is designed to make high-performance computing more accessible and provides reproducibility and scal-ability tools. In particular, we presented PowerSystems.jl and PSID, two Julia packages that tackle new chal-lenges in dynamic modeling while retaining the flex-ibility to facilitate the implementation of scientific computing principles.

Finally, we presented two simulation cases that focused on the use of these packages to investigate differ-ent models and their responses in various settings. We used time-domain simulations and small-signal analysis to study the assumptions in modeling and their con-verter-system interactions. The two simplified examples

showcase the need to rethink the approaches when devel-oping models for power systems’ dynamic analysis.

For Further ReadingJ. D. Lara, J. T. Lee, D. S. Callaway, and B.-M. Hodge, “Computation-al experiment design for operations model simulation,” Electr. Power Syst. Res., vol. 189, p. 106,680, Dec. 2020. doi: 10.1016/ j.epsr.2020.106680.

F. Milano, F. Dörfler, G. Hug, D. J. Hill, and G. Verbic, “Founda-tions and challenges of low-inertia systems,” in Proc. 2018 Power Syst. Comput. Conf., pp. 1–25. doi: 10.23919/PSCC.2018.8450880.

U. Markovic, O. Stanojev, P. Aristidou, E. Vrettos, D. S. Calla-way, and G. Hug, “Understanding small-signal stability of low-inertia systems,” IEEE Trans. Power Syst., p. 1, Feb. 2021.

N. Hatziargyriou et al., “Task force on stability definitions and characterization of dynamic behavior in systems with high penetration of power electronic interfaced technologies,” IEEE Power & Energy Society, Tech. Rep. PES-TR77, Apr. 2020.

J. Bezanson, A. Edelman, S. Karpinski, and V. B. Shah, “Julia: A fresh approach to numerical computing,” SIAM Rev., vol. 59, no. 1, pp. 65–98, 2017. doi: 10.1137/141000671.

C. Rackauckas and Q. Nie, “DifferentialEquations.jl: A per-formant and feature-rich ecosystem for solving differential equations in Julia,” J. Open Res. Softw., vol. 5, no. 1, pp. 1–10, 2017. doi: 10.5334/jors.151.

J. D. Lara, C. Barrows, D. Thom, D. Krishnamurthy, and D. S. Callaway, “PowerSystems.jl: A power system data management package for large scale modeling,” SoftwareX, to be published.

BiographiesRodrigo Henriquez-Auba ([email protected]) is with the University of California, Berkeley, Berkeley, Cali-fornia, 94720, USA.

Jose Daniel Lara ([email protected]) is with the Uni-versity of California, Berkeley, Berkeley, California, 94720, USA.

Duncan S. Callaway ([email protected]) is with the University of California, Berkeley, Berkeley, California, 94720, USA.

Clayton Barrows ([email protected]) is with the National Renewable Energy Laboratory, Golden, Colora-do, 80401, USA.

0 1 2 3 4 5

0.9993

0.9996

0.9999

1.0002

1.0005

0 1 2 3 4 5Time (s)

(a)Time (s)

(b)

Spe

ed (

p.u.

)

0.9993

0.9996

0.9999

1.0002

1.0005

Spe

ed (

p.u.

)

Generator-3-1: ωGenerator-8-1: ωGenerator-1-1: ωGenerator-2-1: ωInverter-6-1: ω

Generator-3-1: ωGenerator-8-1: ωGenerator-1-1: ωGenerator-2-1: ωGenerator-6-1: ω

Figure 10. The generators’ rotor speed and inverter’s virtual-speed time series for example case B after a perturbation. (a) A 14-bus system-only synchronous machine and (b) a modified 14-bus system. The virtual speed of the inverter is significantly faster than the rotor speed of synchronous machines, giving the system a faster frequency-recovery rate when compared with the original system.