Power Systems Simulation with Simscape Electrical

Technical FAQs for power systems engineers

As technology advances, power grids are becoming increasingly software-defined and are being dominated by inverter-based resources (IBRs) and large inverter-based loads (IBLs). This shift has increased interest in using software algorithms to help form, stabilize, and secure the grid. Power systems engineers can use simulations to:

  • Analyze electromagnetic transients (EMT)
  • Evaluate grid integration
  • Assess grid-code compliance
  • Develop grid-forming and grid-following converter controls
  • Prepare models for real-time testing

This FAQ provides guidance on simulation approaches, model fidelity, scalability, and real-time deployment using Simscape Electrical™.

Common Applications

What are the most important application areas for developing and operating software-defined power grids?

Important application areas include:

Getting Started with Power Systems Simulation

How do I get started with power systems simulation?

For engineering teams designing and validating software-defined power grids, Simscape Electrical provides a practical path to connect control algorithms, power electronics, and network dynamics in a single simulation environment. MathWorks® offers many self-paced, interactive onramps to get started with Simscape Electrical. These onramps are good starting points:

  • Simscape Onramp: This is a free, self-paced, 1-hour online course. You will learn the fundamentals of Simscape™ and how to model dynamic systems across multiple physical domains.
  • Power Systems Simulation Onramp: This is a free, self-paced, 1.5-hour online course that covers the essentials of power system simulation. You will learn how to model a simple microgrid and evaluate key control algorithms for renewable energy systems.

Which power system simulation workflows are supported by MATLAB and Simulink?

MATLAB®, Simulink®, Simscape, and Simscape Electrical are required for power system simulation workflows. Depending on the scope of your application, additional products might fit your workflow. For example, Simulink Control Design™ provides control design and parameter optimization workflows, while Simscape Battery™ provides workflows for battery management system development.

Modeling Considerations

What solver should I use for EMT simulation?

For EMT simulation, you can use a fixed-step solver such as Backward Euler or Trapezoidal. The time step depends on the application, but 50 microseconds is a common setting for 50 Hz and 60 Hz systems

How do I choose the right model fidelity?

Model fidelity refers to the level of detail that is included in a particular simulation. For example, when modeling power converters for EMT simulation, power system studies use three foundational fidelity levels.

Engineering Objective Typical Starting Fidelity
Fast system studies Average-value
Fast switching analysis Average-switch
Detailed switching analysis, including faults Switched-linear

The three levels are average-value, average-switch, and switched-linear:

  • The lowest fidelity is average-value. The power converter directly emulates the modulation waves and device switching is not modeled. This is the fastest simulation option and is suitable for studies that do not need harmonic information.
  • The next fidelity level is average-switch. You can average pulse-width modulation (PWM) over a larger time step than the PWM generator time step. This approach enables simulation of the physical system at larger time steps while accurately capturing lower harmonic levels. This technique is also known as subcycle averaging.
  • Switched-linear fidelity directly simulates the on-off switching of power electronic devices. At this level of fidelity, you must choose a time step that accurately captures the PWM switching pattern in the physical system response.

How do I build and scale large power system models?

Engineers typically describe large power systems in text-based file formats and analyze them using power flow tools, such as MATPOWER, before building EMT models. In this case, you can create a MATLAB script that reads the network data. The scripts use the Simulink API to programmatically build the base power system model from the power flow descriptions. The larger the power system, the more computationally expensive it becomes. The recommended approach is to segment the model into smaller sub-networks. These sub-networks are then connected through model architectures such as model-reference or subsystem-reference.

Another class of large systems includes large power converter topologies, such as modular multilevel converters, which contain many repeated components. You can also use the Simulink API to generate these architectures.

Can I model transmission and distribution systems?

Yes, you can model both balanced and unbalanced systems. You can also model multi-phase systems where appropriate.

Can I simulate long-duration studies such as 8760-hour analyses?

Yes, you can configure a Simscape Electrical model to simulate in phasor mode. In this mode, the simulation can use any time step, including support for 8760 simulations that advance at one-hour time steps over a standard year. This type of simulation is commonly called a quasi-static simulation.

Real-Time Simulation

How do I make a large power system model compatible with real-time simulation?

There is no single answer as some models are too large to simulate in real time. However, consider these guidelines when building and testing your model:

  • Incrementally build the power system model and perform an initial assessment of simulation performance on the desktop. Use the lowest model fidelity to achieve your engineering objective and use a fixed-cost solver setting.
  • If you encounter overruns when testing a model in a real-time environment, consider segmenting the model into smaller subsystems and using more cores during real-time simulation.

Are there techniques that improve power converter simulation performance in real-time?

Subcycle averaging is a common method for improving real-time simulation performance. The method provides an opportunity to increase the simulation step time of the physical model, while accurately capturing lower order switching harmonics. Subcycle averaging requires a trade-off between step time and the harmonic range of interest.

Alternatively, you can implement power converter models in HDL code and deploy them to FPGAs when the full harmonic range is required.

How can I assess grid-code compliance using simulation?

To assess grid-code compliance with a simulation model, create test harnesses that exercise the simulation model under conditions such as low-voltage disturbances, frequency disturbances, or both. Record test outcomes and automatically generate reports to support overall compliance assessment.

When to Engage with MathWorks and Additional Resources

Engage with your MathWorks support team, account team, or consulting representative early in your use of the software. A focused discussion can help you identify a starting point, avoid common implementation mistakes, understand product capabilities and limitations, and apply relevant best practices for your specific application.