> 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/pe-add-on-opal-rt/model-in-schematic-editor/optimize-the-ehs-circuit/optimize-the-time-step-with-decoupling.md).

# Optimize the Time Step with Decoupling

## Overview

Decoupling is a powerful **Gen 5** optimization technique that can significantly reduce the achievable time step of large circuits.

The principle is to divide a large circuit into smaller subcircuits that are solved independently and exchange only a limited number of coupling variables. Because smaller circuits generally require fewer computations, decoupling can significantly reduce execution time and improve the achievable time step.

However, decoupling introduces a delay of **one eHS time step** between the subcircuits. Poorly chosen decoupling locations can therefore reduce simulation accuracy or negatively affect stability.

The best results are obtained when decoupling is introduced only where necessary and at locations that are naturally tolerant to the one-time-step delay introduced between subcircuits.

| Advantages                                                                                                                                                                             | Drawbacks                                                                                                                                                                                |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <ul><li>Reduces the minimum achievable time step</li><li>Improves performance of large circuits</li><li>Enables simulation of larger systems at higher switching frequencies</li></ul> | <ul><li>Introduces a one-time-step delay between subcircuits</li><li>May reduce accuracy if applied at inappropriate locations</li><li>May reduce stability in some topologies</li></ul> |

## Requirements

Using decoupling blocks requires a simulator license that includes the **EHS\_HIGH\_PERFORMANCE\_TOKEN** feature with a sufficient number of tokens.

Decoupling is generally beneficial when:

* The circuit is large
* Suitable decoupling locations are available
* The achieved time step is too large for the application
* Additional performance is required

As a rule of thumb, consider decoupling when the achieved time step exceeds approximately **5% of the PWM period**.

## Decoupling procedure

{% stepper %}
{% step %}

### Choose a good decoupling location

The best decoupling locations are places where introducing a one-time-step delay has minimal impact on the overall system dynamics:

* **DC bus capacitors** are often the best decoupling points. The capacitor voltage usually evolves slowly compared to switching events, making the delay introduced by decoupling largely negligible.
* **AC filters** and **line reactors**: Three-phase AC inductors used for harmonic filtering can also provide effective decoupling points in three-phase AC systems. In this case, the inductor currents are used as coupling variables between the subcircuits. This approach is generally less effective than decoupling at the DC bus, but it can still provide meaningful time-step improvements when suitable DC bus decoupling points are not available.
  {% endstep %}

{% step %}

### Add decoupling blocks

Once a suitable decoupling location has been identified, replace the corresponding block with an eHS decoupling block from the [Decoupling library](https://www.opal-rt.com/docs/pe-add-on-opal-rt/model-in-schematic-editor/library-blocks-reference/decoupling-blocks.md).

* Use **inductive decoupling** blocks to replace existing series inductors.
* Use **capacitive decoupling** blocks to replace existing shunt capacitors.

Multi-phase blocks behave equivalently to multiple single-phase blocks while providing a cleaner schematic representation.
{% endstep %}
{% endstepper %}

## Example: decoupling a DC bus

A common optimization consists of separating the AC and DC portions of a power converter.

In the **Aero Microgrid** example shown below, the goal is to separate the **DC** and **AC** portions of the circuit. This is achieved by replacing the capacitors located at the output of the rectifiers with capacitive decoupling blocks.

After introducing the decoupling blocks, the DC and AC sections are solved as separate subcircuits. Rebuilding the model reduces the minimum achievable time step in **High Performance** mode from **1755 ns** to **1305 ns**, representing an improvement of approximately **25%**.

Despite the circuit partitioning, simulation results remain essentially unchanged. This example demonstrates that carefully chosen decoupling locations can significantly improve the achievable time step while preserving simulation accuracy.

## Known limitations

### Decoupling blocks introduce parasitic components

Unlike standard inductors and capacitors, decoupling blocks are numerical elements used to exchange information between independently solved subcircuits.

To implement this coupling, eHS internally introduces equivalent parasitic elements:

* **Inductive decoupling blocks** introduce parasitic capacitances
* **Capacitive decoupling blocks** introduce parasitic inductances

The parasitic values are:

$$
\begin{aligned}
C\_{\mathrm{parasitic}} &= \frac{T\_{\mathrm{eHS}}^{2}}{2L\_{\mathrm{decoupling}}} \\
\\
L\_{\mathrm{parasitic}} &= \frac{T\_{\mathrm{eHS}}^{2}}{2C\_{\mathrm{decoupling}}}
\end{aligned}
$$

where T<sub>eHS</sub> is the FPGA eHS simulation time step.

In most applications, these parasitic elements have little impact on the simulation results. However, in certain topologies they may become significant and should therefore be considered when selecting decoupling locations.

### Avoid capacitive decoupling in high-impedance circuits

Capacitive decoupling blocks are intended to replace capacitors located in relatively low-impedance portions of the circuit.

When a large impedance (typically greater than **1 kΩ**) is connected across a capacitive decoupling block, the parasitic inductance introduced by the decoupling method becomes dominant, leading to:

* Reduced accuracy
* Excessive signal amplitudes
* Numerical instability

As a result, capacitive decoupling blocks should generally not be inserted in high-impedance sections of the circuit.

### Connect all terminals of multi-phase decoupling blocks

Leaving terminals unconnected on a multi-phase decoupling block may produce unstable results, even when the equivalent capacitor or inductor network would appear valid.


---

# 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/pe-add-on-opal-rt/model-in-schematic-editor/optimize-the-ehs-circuit/optimize-the-time-step-with-decoupling.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.
