<<

By Rodrigo Henriquez-Auba, Jose Daniel Lara, Duncan S. Callaway, and Clayton Barrows Transient Simulations With a Large Penetration of Converter- Interfaced Generation

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

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

72 IEEE Electrification Magazine / JUNE 2021 2325-5897/21©2021IEEE characterized by widespread RESs and BESSs. In 2021, Scientific Computing Practices the U.S. National Academy of Sciences recognized the There is no single definition of scientific computing as importance of understanding how the grid of the the field has evolved from purely computational issues future will behave and how operators and policy mak- to the general use of computers and software to answer ers can ensure its continued reliability. The capacity to scientific questions. However, all scientific computing do this rests on improving the simulation capabilities definitions share the objective of enabling 1) the repro- necessary to build and test the integration of new ducibility of the experiments and 2) the mechanisms devices and components. used to verify the validity of the conclusions derived. Fortunately, the array of software tools available for Lara et al. 2020 provides a detailed discussion of these researchers to conduct large-scale studies has also definitions for power system operational studies. Fig- grown significantly. Progress in numerical solver algo- ure 1 summarizes the three steps required to perform a rithms, model-order-reduction techniques, automatic simulation experiment, which follow best practices in differentiation (AD), and symbolic and numerical com- scientific computing: data, computational modeling, and putation, among other areas, are advances essential to results subprocesses. the development of the new analysis techniques In practical terms, achieving reproducibility and valida- demanded by the realities of a modernizing grid. The tion requires that two major components, the environ- power systems field is ripe with current and future ment and the experimental workflow, are considered. opportunities to exploit these techniques for novel mod- xxEnvironment: The environment comprises the hard- eling and control methods. However, critical obstacles ware components and the configuration of all the remain and among these, researchers must develop the software used to implement a computational experi- capacity to surmount the dramatic increases in model- ment. The environment may include elements such ing complexity. as cloud services, third-party software, file manage- This article focuses on the importance of scientific ment scripts, and external tests. computing principles and showcases the modern xxWorkflow: The workflow is the full process of data software developments that enable large-scale power intake, computation, and results. The development system studies. We stress that computer-aided simu- and careful documentation of a workflow is a require- lation research has to be replicable, the results must ment for validation and reproducibility. be validated, and systems should be scalable such In this respect, open source tools provide the required that they are of realistic proportions and make a sig- capabilities to facilitate scientific computing for power nificant contribution to our understanding. We dis- systems research. Despite challenges, several open cuss how the Julia programming language can be source efforts have grown to be successful in the com- used to tackle these challenges and outline the ways munity and reduce the barriers to entry for those seek- that The Scalable Integrated Infrastructure Planning ing to perform high-quality research and reliable (SIIP) (https://www.nrel.gov/analysis/siip.html) initia- analysis. MATPOWER (https://matpower.org) is a MAT- tive at the National Renewable Energy Laboratory LAB-based tool that is widely used to perform steady- (NREL) is capturing these opportunities in power sys- state analyses such as power flow, continuation tems analyses. power flow, and optimal power flow. OpenDSS (https://

Test Set Simulation 1 Output 1 Simulation Metrics Experimental Select Trial Test Set Simulation for the Data Data 2 Output 2 Trial . Decision . . Model . . + . Test Set Emulator Simulation n Output n

Data Process Computing Process 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 Electrification Magazine / JUNE 2021 73 smartgrid.epri.com/Simulation The environment money for license acquisition. This Tool.aspx) is used for multiple distri- common practice reduces the capac- bution systems analysis. In the field comprises the ity for innovation in the power sys- of transient simulations, the MAT- tems field for researchers who must, LAB-based Power System Analysis hardware rather than use industrial tools, Toolbox (PSAT) (http://faraday1 components and the reimplement these well-established .ucd.ie/psat.html) provides elec- models, develop their own data sets, tromechanical simulations with configuration of all and handle the integration libraries. multiple models. More recently, the This reality translates to the fact that Python-based tool ANDES (https:// the software used to scientific reproducibility is often docs.andes.app/en/stable/) has implement a either not achieved or limited to become available for power system “code sharing.” simulation. It uses a hybrid symbol- computational Simulation reproducibility requires ic-numeric framework for numeri- the separation of models and algo- cal analysis. experiment. rithms when developing modeling However, there is a high setup libraries. Figure 2 depicts the software cost associated with developing stack of a dynamic modeling applica- dynamic simulation applications tion as follows: that can run large-scale experiments. For this rea- xxModeling layer: This layer contains all of the code repre- son, researchers resort to using industrial tools once sentations of the system behavior in differential and/or their systems of interest grow larger than hundreds of algebraic equations; for instance, charging and dis- buses. However, these proprietary models and algo- charging capacitors or proportional–integral–derivative rithms are not openly available; this means that both (PID) controllers. using them and replicating the results obtained by xxIntegration algorithms: The libraries that implement other researchers who use them require large sums of an integration scheme and are used to obtain the

Electromagnetic Generator Model Inverter Model Classical Generator Models Model Implicit Multistep One-Step Methods Methods (BDF) Integration (Euler, RK) Algorithm Explicit Libraries Multistep Methods (AB2) SuperLU MT Linear Algebra LAPACK Libraries BLAS

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.

74 IEEE Electrification Magazine / JUNE 2021 numerical solution of the mod- From an analytical the singular perturbation theory pop- els’ differential equations. For ularized in the 1980s. The seminal instance, Euler, backwards differ- perspective, RMS papers showed that a simplified entiation formulas, and Runge- model is still a valid representation of Kutta, among others. and EMT modeling certain system dynamics under the xxLinear algebra libraries: In this approaches are premise of time scale separation. layer, low-level algorithms are Traditionally, time-domain simu- used to perform numerical lin- similar: They both lations assume that the fundamental ear algebra calculations for sys- frequency of the system dominates tem solutions, a lower–upper (LU) use differential- current and voltage waveforms. As a decomposition, or eigenvalue algebraic equations result, the network can be simplified calculations. to a voltage and current phasor rep- Novel research needs improve- to represent system resentation, known as the root mean ments at all levels of the software square (RMS) or quasi-static phasor stack; however, progress requires that dynamics. modeling approach. Additionally, the computational experiments be synchronous generator stator fluxes replicated under many conditions. relationships reduce to algebraic Free and open source-validated models that provide a equations, further simplifying RMS modeling ap­­ benchmark for the development of algorithms are a criti- proaches. However, this representation cannot capture cal step that is not currently available. Stable and reliable some of the converters’ high-frequency dynamics. Fig- implementations of integration algorithms usually require ure 3 displays the dependency between frequency phe- tremendous development efforts and limit the scope of nomena and modeling requirements to capture the the models to small systems. system’s behavior. More tools are emerging to address each of these mod- In power systems dominated by synchronous eling needs, thanks to the advent of code-sharing reposi- machines, the source of dynamics is physical phenomena tories, broad access to software development tools, and with a behavior described by physics laws. These include, the popularity of open source programming languages for instance, magnetic fluxes, electromechanics, mechani- like , Julia, and Python. However, without a deliberate cal control reaction times, or thermodynamic processes. effort to develop a platform that can be reused by many Moreover, the control logic is commonly tuned to the researchers, we risk limiting the scope and scale of power system research or duplicating efforts. In How to model? this context, the Julia program- Phasor representation ming language offers a host of or full waveform? unique features that significantly Lightning Propagation Electromechanical reduce the effort to implement sci- Phenomena entific computing practices to sim- Switching Surges ulate low-inertia power systems. Inverter-Based Controls Before discussing Julia, we first Thermodynamic Stator Transients and Phenomena highlight some key challenges of Subsynchronous Resonance low-inertia systems. Rotor-Angle Dynamics Computational Challenges Governor and Load of Low-Inertia Systems Frequency Control The dynamic analysis of power sys- Voltage Control tems resorts to mainly two compu- Boiler Dynamics tational numerical methods: 1) time-domain simulations and) Wave Electromagnetic small-signal stability analysis. For Phenomena Phenomena many decades, there has been a focus on reducing time-domain 10–7 10–5 10–3 10–1 101 103 105 simulations’ computational com- Time (s) plexity through model order re­­ ductions. Some of the modeling 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 practices and analytical assump- dynamics from logical components and poses new challenges in model complexity for time-domain tions currently in use derive from simulations. (Adapted from Hatziargyriou et al. 2020).

IEEE Electrification Magazine / JUNE 2021 75 respective time scale of the relevant process, creating a computational requirements. In RMS models, the maxi- “natural” separation among the time processes. mum time step is ~1–10 ms. Simultaneously, EMT time On the other hand, inverter-based generation is domi- step usually is about ~1–50 μs. As a result, RMS simula- nated by dynamics induced by logic and controls, such as tions are typical when modeling large, interconnected a phase-locked loop (PLL), voltage and current controllers, areas like continental Europe or the Eastern Interconnec- and power controllers. In the control block diagram of the tion in the United States. They are typically used to study virtual synchronous machine (VSM) inverter model pre- the transient response of different disturbances and sented in Figure 4, the only states defined by physical phe- require significant simplifications. On the other hand, nomena are the six resistor-inductor-capacitor (RLC) filter EMT simulations have a smaller scope. They are common- states. As a result, the inverter dynamics can span a wide ly used to analyze a single device’s dynamic behavior range of time scales and interact with existing controls or against infinite buses. physical components. The difference in modeling complexity also means that These two dynamic behavior sources can interact the RMS and EMT simulations’ solution methods differ in unexpectedly, and the guidance of time scale separation important ways. The commercial tools for RMS modeling may not apply. Hence, when studying the massive integra- typically implement Adams–Bashforth-2 and use explicit tion of converter-interfaced sources, it is impossible to formulation through mass representations. On know a priori if and at which time scales the interactions the other hand, EMT software tools use the trapezoidal may occur and requiring dynamic simulations that cap- rule and directly model the electromagnetic differential ture fast electromagnetic phenomena, such as electro- equations (also known as the Dommel method) in the solu- magnetic transients (EMT), on a large scale introduces tion process. computational challenges. In large systems with detailed models, the calculation From an analytical perspective, RMS and EMT model- of Jacobian matrices and eigenvalues can require signifi- ing approaches are similar: They both use differential- cant computational effort. There are multiple opportuni- algebraic equations (DAEs) to represent system dynamics. ties available from the recent advances in AD thanks to The dynamic models used in the power industry tend to the machine learning community that obtain exact Jaco- be stiff because they represent phenomena at multiple bians in this area. Exact Jacobians have myriad uses in rates. Depending on the model’s time constants, the dynamic modeling, from algorithmic design to parame- required integrator time steps can impose substantial ter evaluation.

Three States: [ oc, oc, qoc] r I t t To i dq abc p∗ o io Grid dq q∗ Outer v dq v abc Control o o RLC Filter w∗ Loop abc i dq Six States: cnv v∗ ri pll ri ri [icnv, ioo, v ] Four States: dq [vpll , pll, pll]

PLL cf If oc

~ v oc rf

oc Virtual Inner v m Impedance Control PWM

" abc v Loop icnv Six States: [ dq,  dq, dq] ic ic ic vdc

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.

76 IEEE Electrification Magazine / JUNE 2021 Calculating the system eigenvalues for multiple operat- xxA comprehensive package manager that enables ing conditions and parameter values is standard practice reproducibility among researchers by setting up the to study power systems’ stability. Fast and exact Jacobian exact package and binary versions. Integrating “Arti- matrix calculations and sparse linear algebra are two facts” into the package manager, Julia can include basic capabilities that will improve low-inertia studies. information that is not related to Julia packages, The new demand for larger scales and more details in which includes platform-specific binaries or data sets. modeling require changing how we approach developing This enables researchers to pack all of the experiment simulation experiments. To do this, we need innovative requirements in a reproducible environment that can approaches to obtain reliable system assessments using be executed in multiple platforms. This mechanism is better computational tools. The power system sector also used to provide reproducible binary dependencies needs to accelerate the adoption of the recent improve- for packages built with BinaryBuilder.jl. ments in algorithms and hardware. To this end, adopting xxJulia is a flexible language that has the convenience of scientific computing practices is critical to reducing scripting languages without the performance penalty. development and deployment barriers. As a JIT-compiled language, Julia can be as fast as C or C++ but without the learning curve (see Bezanzon et The Julia Programming Language al. 2017). Multiple dispatch is crucial to the effective- Choosing a programming language to develop a simula- ness of Julia as a programming language for scientific tion tool can seem like a marginally relevant decision; software. Associating methods with generic functions however, this choice can have significant impacts on rather than the type they on which they operate is a reproducibility and scalability. Scripted programming lan- highly effective strategy for code reuse and extension. guages usually do not implement high-performance code This capability promotes the implementation of natively. High-performance applications require low-level generic interfaces for custom models without requir- compiled languages to handle large-scale computations. ing changes to the source code. For instance, there are many distinct implementations of xxJulia has s suite of packages for scientific machine NumPy for linear algebra in Python with identical pro- learning with multiple differential equation solvers, gramming interfaces. The same applies to many other DifferentialEquations.jl (see Rackauckas and Nie large-scale numerical libraries, like LSODE (Livermore 2017), and automated model discovery (DiffEqFlux.jl). Solver for Ordinary Differential Equations), SUNDIALS DifferentialEquations.jl offers more than 30 different (suite of nonlinear and differential/algebraic equation numerical solvers for ordinary differential equation/ solvers), or PETSc (portable, extensible toolkit for scientific DAE systems, including both explicit (via mass computation). These well-established high-performance matrices) and implicit representation. Some solvers, numerical libraries are hard to extend. Usually, they have including classic algorithms and novel ones from dependencies on other compiled libraries, like BLAS, recent research, can outperform the “standard” C/For- LAPACK, or SuiteSparse, as shown in Figure 2, which add tran methods. In addition, it provides a wrapper for further complexity. those C/Fortran methods, allowing for the use of Julia is a dynamically typed programming language them when necessary. In a nutshell, DifferentialEqua- developed by Bezanson et al. 2017, intended to bridge the tions.jl enables solving differential equations using gap between scripting languages like Python or MATLAB different algorithms (from even other packages or and high-performance languages like C++ or Fortran. Julia languages) by providing a common interface. Effec- uses a low-level, virtual machine-based just-in-time (JIT) tively, it allows exchanging the algorithm layer with a compiler and incorporates some essential features from single line of code. This feature provides benchmark- the beginning of its design, such as excellent support for ing and testing different solution methods according parallelism and GPU programming, and features a practi- to the specific problem. cal, functional programming orientation. Julia can gener- xxSmall-signal stability analyses such as eigenvalue ate the same assembly code as C or C++ with the location, root locus, or Bode plots rely on computing the convenience of scripted languages. Jacobian of the nonlinear DAE system. Usually, deriva- Besides the language’s computational capabilities, tives are computed via a finite differences approach, the Julia environment itself provides several features which is inefficient due to the high number of evalua- that facilitate the development of large-scale dynamic tions of the system function, and only approximates its models following scientific computing practices. Impor- result due to the usage of the finite small value of step tantly, it addresses the shortcomings of other scripted h. AD is a method used to compute the exact deriva- languages, such as dependency handling. These capa- tives given only the function itself. ForwardDiff.jl and bilities make Julia an excellent match to tackle scientific ReverseDiff.jl are the most common established pack- computing challenges in the power systems communi- ages utilized to perform AD to compute derivatives in ty. The following are a few critical examples of Julia’s Julia. Both of these methods generally outperform non- good environment. AD algorithms in both speed and accuracy.

IEEE Electrification Magazine / JUNE 2021 77 PowerSystems.jl and PowerSimulationsDynamics.jl Figure 5 shows the implementation of the DynamicIn- The aforementioned features and capabilities are used jection data containers in PowerSystems.jl. Each device is extensively as part of the SIIP initiative to provide tools composed of the corresponding dynamic components that implement the scientific computing workflow in Fig- that define the model. As a result, it is possible to flexibly ure 1. PowerSystems.jl provides a consistent and high-per- define dynamic data models and methods according to formance data model and modular modeling platform for the analysis requirements. DynamicInjection compo- power systems across multiple time scales. Along with the nents use a parametric-type pattern to materialize the data containers, PowerSystems.jl furnishes parsing capa- full specification of the dynamic injection model with bilities from commonly used text-based data files (MAT- parameters. This design enables a modular implementa- POWER, *.raw, and *.dyr). Once the system is loaded, users tion of the mathematical model for each dynamic com- can make modifications, add custom models, and serial- ponent separately. ize to disk. The serialization/deserialization of custom The modeling is implemented in PowerSimulationsDy- data sets is one of the key enablers of the Julia ecosystem namics.jl (PSID) and uses PowerSystems.jl data structures that supports scientific computing practices for power to define power system dynamic devices and their corre- systems modeling. sponding components. The modeling layer is designed to For developers, PowerSystems.jl provides a generic, mix and match different component models with a small reusable, and customizable data model agnostic to the number of script modifications. The flexibility of model implementation details of the mathematical models and specification enables precise control when specifying the is applicable to multiple software strategies. It also pro- complexity of each power system device. vides extension capabilities by design that make it easier Julia’s multiple dispatch lies at the core of PSID power to integrate into other initiatives. as a scientific scripting and computing library for dynamic

Converter Machine OuterControl Shaft InnerControl AVR DCSource TurbineGov FrequencyEstimator PSS Filter DynamicInverter DynamicGenerator get_name get_name get_ω_ref get_states get_ext get_n_states get_states get_w_ref get_n_states get_machine get_converter get_shaft get_outer_control get_avr get_inner_control get_prime_mover get_dc_source get_pss get_freq_estimator get_ext get_filter get_internal get_P_ref get_V_ref get_V_ref get_P_ref

Converter Machine DynamicInjection OuterControl Shaft InnerControl AVR DCSource TurbineGov FrequencyEstimator PSS Filter

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.

78 IEEE Electrification Magazine / JUNE 2021 models. It uses the compiler to de­­ DynamicInjection Example Case A: Machine, Inverter, termine which method to call based and Network Model Interactions solely on the types of the argument components use a As discussed previously, exploring the passed into a generic function. This interactions among inverter models enables code reuse and the imple- parametric-type and other dynamics in the system is mentation of generic interfaces pattern to one of the critical tasks in the devel- for custom models without re­­ opment of the analytical techniques quiring modifications to the main materialize the full used to study modern power systems. source code. One of the capabilities of PSID mixing The flexibility in PSID originates specification of the and matching different levels of from the use of polymorphism and dynamic injection model complexities to study how they encapsulation in the device model’s can change the conclusions. definition, which enables treating model with This example simulation presents objects of different types similarly if the time-domain simulation of an they provide common interfaces. parameters. inverter and compares the results using Generators and inverters are defined three different generator models and as a composition of components, as two distinct network models in a three- shown in Figure 5; the functionalities of the component bus system. The simulations use a 19-state grid-supporting instances determine the device model providing a flat VSM inverter with average pulsewidth modulation dynam- interface to the complex object. This design enables the ics. The control block diagram of the inverter is shown in Fig- interoperability of components within a generic device ure 4. The example code is available in the SIIP Examples definition. As a result, it is possible to implement custom repository (https://github.com/NREL-SIIP/SIIPExamples.jl) component models and interface them with other exist- and in PSID’s documentation. ing models using minimal effort. Figure 7 depicts the evolution of the generator’s voltage Figure 6 presents the dependencies between PSID magnitude at bus 2 after a circuit trip connecting the invert- and the DifferentialEquations.jl libraries. The archi- er and the infinite bus at t = 1 s. PSID enables the explora- tecture of PSID is such that the power system models tion of several assumptions in the study of the dynamics of are all self-contained and return the model func- the system. tion evaluations. The Jacobian is calculated through a xxIn the “Static lines” network model, the relationship common interface with ForwardDiff.jl, enabling the between the voltage and current phasors is algebraic 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 PowerSystems.jl required routines when developing dynamic modeling Data Structures libraries, such as the following. xxThe robust, systemwide initialization of the model: Find- PowerSimulationsDynamics.jl ing valid initial conditions is notoriously tricky in Models and Methods x large-scale nonlinear dynamic models. PSID uses rou- f (x ) tines based on the dynamic model structure to pro- vide reliable initial points. xxThe addition of perturbation through callbacks: Classical- DifferentialEquations.jl Common Interface ly, the study of perturbations in dynamic systems requires a series of steps to obtain valid system condi- f (x ), J (x ) tions postperturbation. PSID implements perturbation through callbacks, allowing the solver’s algorithm to Differential Equations perform the reinitialization in a compatible fashion. Solver xxSmall-signal analysis: Performing small-signal analysis requires providing the Jacobian matrix or estimating through numerical methods. PSID uses ForwardDiff.jl ForwardDiff.jl to calculate the exact Jacobians of the models and Small-Signal Analysis enables small-signal analysis at no additional devel- opment cost. PSID exploits the Julia programming language and its eco- Figure 6. The architecture of PSID is such that the power system models are all self-contained and return the model’s function evalua- system to facilitate the computational exploration of tions. The Jacobian is calculated through DifferentialEquations.jl’s power systems with converter-interfaced generation. common interface, enabling the use of any solver available in Julia.

IEEE Electrification Magazine / JUNE 2021 79 via the admittance matrix. In the PSID implements Thus, PSID can run an RMS simula- “Dynamic lines” network model, tion, using a fourth- or sixth-order the relationship is via differential perturbation through model with “Static lines,” or an EMT equations, commonly known as simulation using the eighth-order dynamic phasors, which allow callbacks, allowing model with “Dynamic lines.” It is also for the capture of electromag- the solver’s possible to combine the sixth-order netic dynamics. model (typically used in RMS) with a xxA fourth-order model is a simpli- algorithm to perform “Dynamic lines” model and study fied one with only transient elec- such hybrid behavior, as depicted in tromotive forces (emfs). The the reinitialization Figure 7. As mentioned previously, this sixth-order model, commonly in a compatible flexibility is one of the core features known as the GENROU model provided in PSID. (round rotor generator), considers fashion. A model with more detail, such as both the transient and subtran- the eighth-order model case, has sig- sient emfs, but the stator fluxes nificantly faster dynamics, as shown dynamics are approximated via in Figure 7. The additional modeling algebraic representations. Finally, the eighth-order detail comes with an extra computational cost. Solving model, known as the Marconato model, considers both this EMT model requires a time step of no larger than the transient and subtransient electromagnetic fields, 500 μs. The other example RMS simulations require a time with dynamic stator flux representation through dif- step of only 20 ms. In addition, we analyze the response of ferential equations. the inverter under the four models presented. Figure 8 depicts the time series of the virtu- al speed under the same perturba- |V | Fourth-Order Gen: Static Lines tion. As observed, no significant |V | Sixth-Order Gen: Static Lines differences can be observed in this |V | Sixth-Order Gen: Dynamic Lines inverter state for the cases studied. |V | Eighth-Order Gen: Dynamic Lines This limited example showcases the challenges of making EMT sim- 1.0175 ulations a requirement of power systems in the presence of power 1.015 electronics converters. This simple case demonstrates 1.0125 how different model assumptions may change the simulation results. 1.01 Figure 7 indicates that additional details from the EMT model furnish

Voltage Magnitude (p.u.) 1.0075 an understanding comparable to that which is provided by simpler or 0.975 1 1.025 1.05 1.075 1.1 hybrid models. Although this is not a general result, it highlights the 1.0175 possible trade offs between the result details and model complexity. 1.015 Example Case B: A 14-Bus System 1.0125 An additional objective of PSID is to facilitate the development of study cases for low-inertia systems, similar 1.01 to traditional RMS benchmark sys- tems. Example case B shows the Voltage Magnitude (p.u.) 1.0075 well-known IEEE 14-bus system with five generators. All of the results pre- 01020 30 40 sented here are also available to the Time (s) reader as Jupyter Notebooks in the SIIP Examples repository. 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 Using PSID, we model each gen- certain cases, the additional dynamics can induce instabilities not observed in simpler models. erator with a sixth-order machine

80 IEEE Electrification Magazine / JUNE 2021 model: GENROU. Additionally, we use an IEEE AC1A auto- After the system’s components are defined, all the matic voltage regulator (AVR) system and a gas steam tur- devices are automatically initialized based on the power bine model turbine governor in the slack bus. The ability to flow results. If a feasible point exists, then the system is quickly switch devices and models is another core feature of appropriately initialized and can be used for simulation. PSID. In this example, we conduct two simulations: one with Using AD, PSID provides small-signal information for synchronous machines only and a second case in which we the operating point, such as eigenvalues, damping of replace the generator located at bus 6 for an aggregated each mode, and participation factors. In this example model of a VSM grid-supporting inverter with 19 states, the simulation, we use an admittance matrix formulation same model used in example case A. This example allows for the network model representation. us to explore the effects of substituting synchronous Figure 9 presents a comparison of the eigenvalues (at machines with converter-interfaced generation. 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- 1.004 tion factors. This comparison is crucial for determining, in each simulation, the fastest dynamics that could be 1.003 approximated via an algebraic representation. 1.002 As shown in Figure 9, the electromagnetic dynamics of the RLC filter in the inverter are the fastest dynam- 1.001 ics, and for this operating point could reasonably be neglected in our study case because they are, effective- tual Speed (p.u.) 1

Vir ly, on different time scales. 0.999 Similarly, the low-pass filter model used to measure the bus voltage of the excitation systems could also be 01 2 3 ignored and considered an ideal measurement. However, Time (s) based on this analysis, the inverter eigenvalue associated with the virtual speed and the PLL dynamics are suffi- vsm Fourth-Order Case: Static Lines ciently close to the AVR exciter time scale and should be vsm Sixth-Order Case: Static Lines vsm Sixth-Order Case: Dynamic Lines considered in a time-domain simulation. These results vsm Eighth-Order Case: Dynamic Lines highlight the complexity of defining modeling strategies to study converter and system dynamics interactions. We perform a time-domain simulation to explore the Figure 8. The virtual speed ~vsm using different machine and net- behavior of the system under a perturbation. Figure 10 work models for example case A. Continuing from the results in Fig- ure 7, the machine’s and lines’ modeling assumptions do not affect depicts the rotor speed of the generator and the virtual the evolution of inverter’s virtual speed. speed of the inverter after an ideal trip of the line

10 AVR-Voltage Virtual- –2,500 RLC Filter Measurement Speed Eigenvalues: AVR States and Eigenvalues Eigenvalue 5 –5,000 Eigenvalues Inverter Voltage Controller

0 0 lm ( ) lm ( )

–2,500 PLL Eigenvalues –5 Eigenvalues: Generator Damping Flux Linkages States –5,000 and Inverter Current Controller –10 –2,600 –2,000 –1,400 –800 –200 –60 –50 –40 –30 –20 –10 0 Re ( ) Re ( ) (a) (b)

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

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 Electrification Magazine / JUNE 2021 81 1.0005 1.0005

1.0002 1.0002

0.9999 0.9999 Generator-3-1: Generator-3-1: Speed (p.u.) 0.9996 Generator-8-1: Speed (p.u.) 0.9996 Generator-8-1: Generator-1-1: Generator-1-1: Generator-2-1: Generator-2-1: 0.9993 0.9993 Generator-6-1: Inverter-6-1:

0 1 2345 0123 45 Time (s) Time (s) (a) (b)

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.

connecting buses 2 and 4. As expected, the dynamics showcase the need to rethink the approaches when devel- observed in the inverter are faster, but the system manag- oping models for power systems’ dynamic analysis. es to converge to a new stable operating point. This simplified generator substitution demonstrates that For Further Reading exchanging generators for converters can significantly J. D. Lara, J. T. Lee, D. S. Callaway, and B.-M. Hodge, “Computation- impact the dynamic mode interactions. It also shows that al experiment design for operations model simulation,” Electr. Power Syst. Res., vol. 189, p. 106,680, Dec. 2020. doi: 10.1016/ there are opportunities available to simplify modeling j.epsr.2020.106680. details to speed up simulations. However, these simplifica- F. Milano, F. Dörfler, G. Hug, D. J. Hill, and G. Verbicˇ, “Founda- tions may require sophisticated approaches to choose tions and challenges of low-inertia systems,” in Proc. 2018 Power model complexity correctly. 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- Conclusion inertia systems,” IEEE Trans. Power Syst., p. 1, Feb. 2021. The increasing penetration of converter-interfaced gener- N. Hatziargyriou et al., “Task force on stability definitions ation will undoubtedly lead to new challenges and oppor- and characterization of dynamic behavior in systems with tunities in computational power system studies. In this high penetration of power electronic interfaced technologies,” article, we reviewed the main computational challenges of IEEE Power & Energy Society, Tech. Rep. PES-TR77, Apr. 2020. J. Bezanson, A. Edelman, S. Karpinski, and V. B. Shah, “Julia: low-inertia systems, such as modeling complexity, the A fresh approach to numerical computing,” SIAM Rev., vol. 59, interaction between synchronous machine controllers no. 1, pp. 65–98, 2017. doi: 10.1137/141000671. and inverter controllers, and numerical time-step integra- C. Rackauckas and Q. Nie, “DifferentialEquations.jl: A per- tion requirements. This article highlighted the importance formant and feature-rich ecosystem for solving differential of scientific computing principles to tackle these issues by equations in Julia,” J. Open Res. Softw., vol. 5, no. 1, pp. 1–10, 2017. doi: 10.5334/jors.151. enabling the reproducibility and validity of such simula- J. D. Lara, C. Barrows, D. Thom, D. Krishnamurthy, and D. S. tion experiments. Callaway, “PowerSystems.jl: A power system data management We discussed how the Julia programming language package for large scale modeling,” SoftwareX, to be published. is designed to make high-performance computing more accessible and provides reproducibility and scal- Biographies ability tools. In particular, we presented PowerSystems. Rodrigo Henriquez-Auba ([email protected]) is jl and PSID, two Julia packages that tackle new chal- with the University of California, Berkeley, Berkeley, Cali- lenges in dynamic modeling while retaining the flex- fornia, 94720, USA. ibility to facilitate the implementation of scientific Jose Daniel Lara ([email protected]) is with the Uni- computing principles. versity of California, Berkeley, Berkeley, California, 94720, USA. Finally, we presented two simulation cases that Duncan S. Callaway ([email protected]) is with the focused on the use of these packages to investigate differ- University of California, Berkeley, Berkeley, California, ent models and their responses in various settings. We 94720, USA. used time-domain simulations and small-signal analysis Clayton Barrows ([email protected]) is with to study the assumptions in modeling and their con- the National Renewable Energy Laboratory, Golden, Colora- verter-system interactions. The two simplified examples do, 80401, USA.

82 IEEE Electrification Magazine / JUNE 2021