> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/hypersim/model-and-simulation/optimize-the-model/select-the-right-switch-model.md).

# Select the Right Switch Model

## Overview

HYPERSIM supports different approaches for modeling power electronic switches in electromagnetic transient (EMT) studies. Each approach provides a different balance between model fidelity, computational requirements, simulation time step, and real-time performance.

This page describes the main switch modeling approaches and provides guidelines for selecting the appropriate model based on the phenomena to be represented and the objectives of the study.

## Types of Switch Models for EMT Studies <a href="#types-of-switch-models-for-emt-studies" id="types-of-switch-models-for-emt-studies"></a>

There are several switch-modeling approaches available for representing the **power electronic (PE)** interfaces of **distributed energy resources (DERs)** connected to the power grid. Each approach offers specific advantages and limitations. Selecting the most appropriate model therefore depends on the study objectives, test conditions, and required level of detail. In practice, a balance must often be struck between simulation speed, model fidelity, and the achievable time-domain resolution. The figure below illustrates the main categories of switch models commonly used for DER integration studies.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-de43d3e678a7b916c10c7e2e4aef7c293b90b2e9%2Fswitch-model-EMT.png?alt=media" alt=""><figcaption></figcaption></figure>

## **Balancing simulation speed, resolution, and accuracy**.

The tradeoff between **model resolution** (accuracy and level of detail) and **real-time performance** (throughput and the ability to execute without missed time steps) is a key consideration when selecting a simulation approach. The most suitable model depends on the objectives of the study and the simulation constraints. In general, higher-fidelity models provide greater accuracy but require more computational resources, while simpler models offer faster execution at the expense of detail. The figure below illustrates how the available switch models are positioned along the spectrum of **model accuracy versus computational effort**.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-87d04fef8e1158ae48c389ef0bc57156cfe0712a%2Fswitch-models-EMT.png?alt=media" alt=""><figcaption></figcaption></figure>

### Detailed semiconductor <a href="#detailed-semiconductor" id="detailed-semiconductor"></a>

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-8e0ecd3e9769def93964d566fe69bcfaf130596d%2Fswitch-semiconductors.png?alt=media" alt=""><figcaption><p><em>1. https://ecee.colorado.edu/~bart/book/book/chapter7/ch7_5.htm#fig7_5_1</em><br><em>2. A. Sokolov, “Variable-Speed Power Switch Gate Driver for Switching Loss Reduction in Automotive Inverters.”</em></p></figcaption></figure>

#### **Modeled Features**

* Instantaneous turn on/off time representation
* Conduction and switching losses (Requires good tuning of parameters)
* Thermal model simulation with high accuracy
* Ripple representation with high accuracy
* Device transient characteristics (e.g. MOSFET, IGBT, etc.) can be modeled.

{% columns %}
{% column %}
**Pros**

* Highest accuracy in the representation of the power electronic converters
  {% endcolumn %}

{% column %}
**Cons**

* Computationally intensive, since the switches are modeled with their details
* Requires a very low timestep (\~10s of ns) for accurate solution of the discretized non-linear switch models
* Not suitable for real-time simulations or Hardware-in-the-Loop testing
  {% endcolumn %}
  {% endcolumns %}

### Ideal switch <a href="#ideal-switch" id="ideal-switch"></a>

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-2b8a7a6a16635cb11319ed26731b3162333f7a16%2Fideal-switch.png?alt=media" alt="" width="410"><figcaption></figcaption></figure>

#### **Modeled Features**

* Instantaneous turn on/off time representation
* Conduction and switching losses (Requires tuning of parameters)
* Ripple representation with high accuracy

{% columns %}
{% column %}
**Pros**

* The classic EMT-type software model
* A straightforward model which does not require handling particular cases
* Good accuracy for most power electronics CHIL tests with small enough time-step
* A 10 times smaller timestep than the switching time period T\_(s\_max )=1/(10×f\_sw ) to get a 10% resolution accuracy on the PWM (may result in numerical oscillations)
  {% endcolumn %}

{% column %}
**Cons**

* Computationally intensive and requires matrix pre-calculation or system decoupling for real-time simulation or larger systems
* Requires larger memory if pre-calculation of matrices is used
* Requires tuning snubbers with respect to time-step and surrounding model eigenvalues
  {% endcolumn %}
  {% endcolumns %}

### Constant conductance <a href="#constant-conductance" id="constant-conductance"></a>

Also known as **Pejovic Method | Associate Discrete Circuit**.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-b69295daa2f93f64374e2c1b1bc4803f2b4b3227%2Fconstant-switch-model.png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Modeled Features**

* Instantaneous turn on/off time representation
* Ripple representation with higher accuracy

{% columns %}
{% column %}
**Pros**

* Good accuracy and allows fast simulation for CHIL testing of faster power electronics controls
* Low computational burden allowing very low time-steps when implemented on FPGA
  {% endcolumn %}

{% column %}
**Cons**

* Creates virtual power loss (compensated for in the eFPGASIM implementation for standard converter topologies)
* Requires tuning of the Gs parameters (eFPGASIM provides a Gs calculation tool to help tune the Gs parameter)
  {% endcolumn %}
  {% endcolumns %}

### Switching Functions <a href="#switching-functions" id="switching-functions"></a>

Also known as **Time Stamped Bridge (TSB) | Virtual FPGA Switching.**

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-b7b794327099bdd439ddb7f44f2b92903ecb0d04%2Fswitching-functions.png?alt=media" alt="" width="389"><figcaption></figcaption></figure>

#### **Modeled Features**

* Suitable for voltage-source converters modeling
* Compensates for the adverse effects of pulsing from controllers (CHIL) occurring in between discrete-time steps
* Accurately represents the voltage harmonic spectrum near the fundamental frequency of operation
* Allows effective modeling of switch dead-times

{% columns %}
{% column %}
**Pros**

* Good accuracy for system-level and converter level studies
* Fast execution time
* Requires T\_(s\_max )=1/(\~4×f\_sw ) for an accuracy of \~2% on the duty cycle
* Allows study of converters in larger systems without requiring as much decoupling as an ideal switch to achieve real-time execution
* With computation technology (ex. FPGA) which is very fast, but not enough to simulate very fast power electronics (ex. fsw=100 kHz), the switching function remain a very good solution for real-time simulation
  {% endcolumn %}

{% column %}
**Cons**

* Certain particular cases may not be possible to simulate (ex. internal faults)
  {% endcolumn %}
  {% endcolumns %}

### Average models <a href="#average-models" id="average-models"></a>

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-6f7acbbb05b38e729f320e0abb4c0f6777a7f799%2Fswitch-average-models.png?alt=media" alt="" width="467"><figcaption></figcaption></figure>

#### **Modeled Features**

* Models the average signal produced by the converters
* Models the near fundamental dynamics of the system
* Effects of switching are neglected

{% columns %}
{% column %}
**Pros**

* Very fast execution
* Good for large system studies and controller interactions
  {% endcolumn %}

{% column %}
**Cons**

* Switching frequency and its related phenomena are neglected
* Does not include low-frequency phenomenon due to switching such as non-linearity due to dead-time
  {% endcolumn %}
  {% endcolumns %}

#### Types of average models <a href="#types-of-average-models" id="types-of-average-models"></a>

{% columns %}
{% column %}
**Voltage Source**

* Implemented with the output filter
* Can include DC side dynamics
* Models the filter related dynamics of the system

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-b7ad3a7153f64522233cf16d4fc5ff1a7524dc90%2Faverage-switch-voltage-source.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}
**Current Source**

* Usually does not include DC side dynamics
* Filter dynamics are also neglected
* System-level control dynamics can be modeled

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-52de5f3690701132ec531ce012805db9703f0696%2Faverage-switch-current-source.png?alt=media" alt="" width="128"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

## Model suitability for microgrid/DER studies <a href="#model-suitability-for-microgrid-der-studies" id="model-suitability-for-microgrid-der-studies"></a>

This graphic illustrates two related continua along the horizontal axis:

* **Computational effort**: Represents the processing power and bandwidth required by the simulation, ranging from **high computational requirements on the left** to **low computational requirements on the right**.
* **Model accuracy**: Represents the level of detail and fidelity provided by the model, ranging from **high accuracy on the left** to **low accuracy on the right**.

The graphic also highlights the distinction between **offline** and **real-time** simulation:

* **Real-time simulation**, shown on the right, imposes strict performance requirements, including deterministic execution, high simulation throughput, and the ability to complete calculations without missing time steps.
* **Offline simulation** is not constrained by real-time execution. It may run faster or slower than real time, allowing greater flexibility to prioritize model fidelity and accuracy over computational performance.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-87d04fef8e1158ae48c389ef0bc57156cfe0712a%2Fswitch-models-EMT.png?alt=media" alt=""><figcaption></figcaption></figure>

This graphic illustrates the **frequency ranges of interest** typically encountered in power system studies, from high-frequency switching harmonics to lower-frequency controller and system interactions.

It also shows the corresponding **simulation time-step ranges** that may be required to accurately capture these phenomena, spanning from **nanoseconds to several seconds**. This relationship helps users select an appropriate model and time step based on the frequency content and level of detail required for their study.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-14dacd6909a1a7305b9b16e31a2bc889f952f96e%2Ffrequency-studies-microgrid-DER.png?alt=media" alt=""><figcaption></figcaption></figure>

<details>

<summary><strong>Example Available in HYPERSIM: 2 MW Connected PV Array</strong></summary>

The following example is available for exploration and further understanding in HYPERSIM. Using the information outlined above, make changes and see how this affects the accuracy/bandwidth of your simulation.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-07324077fc0885f4efbc0eef497e2e1453c473a3%2Fmicrogrid-DER-studies-examples.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-d6be68bdaf80179104a51e2b1ae3b785e15bab27%2Fmicrogrid-DER-example-results.png?alt=media" alt=""><figcaption></figcaption></figure>

</details>

## References <a href="#references" id="references"></a>

S. Rosado, R. Burgos, S. Ahmed, F. Wang, and D. Boroyevich, “Modeling of Power Electronics for Simulation-Based Analysis of Power Systems,” p. 8, 2007.

D. Maksimovic, A. M. Stankovic, V. J. Thottuvelil, and G. C. Verghese, “Modeling and simulation of power electronic converters,” *Proc. IEEE*, vol. 89, no. 6, pp. 898–912, Jun. 2001, doi: [10.1109/5.931486](https://doi.org/10.1109/5.931486).

C. Dufour, “ArtEvents, a simplified and reliable event-based block set for Simulink,” p. 7.

G. De Carne *et al.*, “Which Deepness Class Is Suited for Modeling Power Electronics?: A Guide for Choosing the Right Model for Grid-Integration Studies,” *EEE Ind. Electron. Mag.*, vol. 13, no. 2, pp. 41–55, Jun. 2019, doi: [10.1109/MIE.2019.2909799](https://doi.org/10.1109/MIE.2019.2909799).

A. M. . A. Amin, M. I. El-Korfolly, and S. A. Mohammed, “Exploring aliasing distortion effects on regularly-sampled PWM signals,” in *2008 3rd IEEE Conference on Industrial Electronics and Applications*, Singapore, Jun. 2008, pp. 2036–2041, doi: [10.1109/ICIEA.2008.4582878](https://doi.org/10.1109/ICIEA.2008.4582878).

F. Gao, “Real-Time Simulation Methods of Power Electronic Systems”, IEEE Power Electronics Society and Transportation Electrification Committee joint webinar, 2020. \[Online].


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/hypersim/model-and-simulation/optimize-the-model/select-the-right-switch-model.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
