GPU Acceleration Options for Large-Scale Simscape Microgrid Simulation

17 visualizaciones (últimos 30 días)
Liyang
Liyang el 14 de En. de 2026 a las 21:02
Comentada: Liyang hace alrededor de 20 horas
Hi MATLAB/Simulink Support Team,
I’m reaching out to ask about the feasibility of using GPUs to accelerate large-scale microgrid simulations in MATLAB/Simulink. We are evaluating approaches for system-level simulation primarily using the Simscape library. One concern is that simulation speed may become prohibitively slow as the number of components and modeled devices increases.
Hardware-in-the-loop (HIL) is one possible path, but our use case is less about interfacing with a real-world controller and more about running many emulated controllers and components efficiently.
Could you please advise on the following?
  1. Is GPU acceleration feasible for this type of Simscape-based microgrid simulation (e.g., via parallel computing or other workflows)?
  2. What level of speedup is realistic in practice? For example, with a high-end GPU, is an order-of-magnitude (~10×) improvement over a single-CPU run achievable, or is that unlikely for this workload?
  3. Are there well-established recommended solutions or reference workflows for GPU acceleration in this context?
  4. Beyond GPU acceleration, are there other recommended approaches to achieve reasonable runtimes for large-scale microgrid simulation?
Thank you very much for your guidance and suggestions.

Respuesta aceptada

Umar
Umar hace alrededor de 15 horas
Editada: Umar hace alrededor de 15 horas

Hi @Liyang,

I've looked into your questions thoroughly and want to give you a complete picture of what's possible after doing extensive research. Unfortunately, GPU acceleration isn't feasible for Simscape-based simulations because GPU support in Simulink only works with MATLAB Function blocks through GPU Coder, not with the physical modeling blocks in Simscape that solve the differential-algebraic equations for your power system components. The Simscape solvers use specialized algorithms that don't map well to GPU architectures, and MathWorks documentation explicitly states that Parallel Computing Toolbox isn't designed to speed up a single Simulink simulation.

Regarding your question about achieving 10x speedup, this level of performance gain isn't realistic for single simulation runs using desktop tools with Simscape models. The speedup examples you might have seen showing 40x or more improvements are for completely different workloads like signal processing or image analysis that involve parallel data operations, not the sequential solving of coupled physical network equations. What you can realistically expect with available optimization methods are more modest improvements: Accelerator mode typically provides 1.4-4x speedup, Rapid Accelerator mode can give 2-5x speedup but requires model recompilation, and parallel simulation using parsim for running multiple scenarios simultaneously might give you 2-4x speedup across your parameter sweeps. If you can use phasor mode simulation instead of full electromagnetic transient analysis for steady-state portions of your study, you could see 10-100xspeedup for those specific analyses, though this won't help with detailed transient simulations. For established workflows, MathWorks maintains a FastElectricalSimulations repository on GitHub ( https://github.com/simscape/FastElectricalSimulations ) that documents best practices specifically for power systems and includes strategies like solver optimization, using averaged converter models instead of detailed switching models, model partitioning to separate subsystems with different time scales, and applying local versus global solvers appropriately. You'll also find guidance in the Simscape Electrical documentation on speeding up your simulation ( https://www.mathworks.com/help/sps/ug/speeding-up-your-simulation.html ) and using the Fast Restart feature.

Beyond these desktop optimizations, there are several other approaches worth considering for your large-scale microgrid work. You can reduce model fidelity by using averaged models for power converters rather than detailed switching models, which significantly reduces computation while maintaining good accuracy for many analyses. Model partitioning allows you to separate independent subsystems and apply different solvers with appropriate time steps to each. For parameter studies or Monte Carlo simulations, MATLAB Parallel Server can distribute work across a cluster, though this helps with running multiple scenarios rather than speeding up a single large simulation.

I know you mentioned that hardware-in-the-loop is less aligned with your use case since you're not interfacing with real-world controllers, but I'd encourage you to reconsider this technology because modern HIL systems are actually extremely well-suited for exactly what you're describing: running many emulated controllers and components efficiently. OPAL-RT's eMEGASIM and ARTEMiS platforms use CPU and FPGA co-processing to simulate networks with tens of thousands of nodes in real-time, achieving sub-microsecond time steps for power electronics that desktop systems simply cannot match. Similarly, dSPACE SCALEXIO systems with their FPGA-based power electronics simulation package can handle switching frequencies up to 100 kHz and integrate directly with Simscape models. These platforms provide true parallel execution through FPGA technology where desktop GPUs fundamentally cannot, because FPGAs can execute the specialized solver algorithms required for physical network simulation in a way that's naturally parallel at the hardware level. The real-time constraint actually forces computational efficiency in a good way, and these systems are specifically designed for the exact problem you're solving: large-scale power system simulation with numerous distributed controllers and components. Companies like Typhoon HIL and Speedgoat also offer solutions in this space with varying capabilities and price points.

If you want to pursue desktop optimization further before considering HIL systems, I'd recommend starting with the FastElectricalSimulations examples, experimenting with phasor simulation where applicable in your workflow, reducing model fidelity for non-critical subsystems, and using parsim if you're running parameter sweeps or scenario analyses. There's also a Simscape to HDL workflow that can convert power electronics models to FPGA-compatible representations for extreme performance, though this requires significant restructuring of your models. The bottom line is that while GPU acceleration would be ideal and intuitive to pursue, it's not supported for the type of physical modeling you're doing, and the path to major performance improvements for large-scale microgrid simulation really does lead toward FPGA-based platforms rather than GPU-based ones.

I hope this clarifies the landscape for you.

  2 comentarios
Walter Roberson
Walter Roberson hace alrededor de 8 horas
parallel simulation using parsim for running multiple scenarios simultaneously might give you 2-4x speedup across your parameter sweeps
parsim() is useful for running many different simulations simultaneously, each one with a different initial parameter. Because each parsim worker runs in a different worker, you can have as many of them as you have available parallel workers (which is typically the same as the number of physical "performance" cores if you have performance cores, or the number of physical cores if you do not have efficiency cores.) Simulink does do some linear algebra that works faster if multiple physical cores are available to the worker, but the amount of linear algebra at one time tends to be relatively limited.
In short, if you are doing a parameter sweep, then parsim would be expected to do better than 2-4x speedup.
Liyang
Liyang hace 23 minutos
Thank very much for your suggestions! They are very useful to extend our research. I will explore the parsim that is new for me. We do have OPAL-RT but we should further evaluate the microgrid scale it can support for all emulated controllers.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Model Preparation en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by