> 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/rt-lab/model-and-simulation/power-systems-with-artemis/model-optimization/decouple-model-topology-with-ssn-interface-block.md).

# Decouple Model Topology with SSN Interface Block

ARTEMiS provides **SSN Nodal Interface Blocks (NIBs)** to decouple electrical systems in models **without transmission lines**. Unlike ARTEMiS DPL, SSN NIBs separate the model into **state-space groups**, with the interface between groups solved using a **nodal method**. This decoupling method does **not require or introduce any delay**, making it suitable for models lacking long transmission lines.

As electrical system models grow, the size of the **State-Space (SS) matrices** increases. While every element contributes, **switching elements have a disproportionately large impact**. Each switch can exist in two states (ON/OFF), so the total number of switch combinations grows as 2<sup>**n**</sup>, where **n** is the number of switches. SS matrices must account for all possible topologies, which can quickly lead to very large matrices.

{% hint style="danger" %}
Your simulator license must include the **ARTEMIS\_SSN** feature. To verify, [check that ARTEMIS\_SSN is listed and enabled in your license](https://www.opal-rt.com/docs/rt-lab/licensing-reference/simulator-license.md).
{% endhint %}

## Use SSN NIBs to decouple electrical systems

{% stepper %}
{% step %}

### Run the model in Simulink

When a model containing the **ARTEMIS Guide** block is run, information about the **electrical system**, including the state-space matrices, number of states, inputs, outputs, and switches, is calculated and displayed in the Simulink **Diagnostics Viewer**.

To access this information, click **View diagnostics** at the bottom of the Simulink model window, either during or after execution.

* If the model contains **15 switches or more**, decoupling is **mandatory**.
* For smaller models, decoupling is optional but can **improve simulation performance**.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-04c03ce2c7bae8b56a28de894f20a765990eb376%2Frun-model-simulink.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Plan the decoupling

SSN NIBs can be added almost anywhere in the model. Since **switching elements have the greatest impact** on SS matrices size, focus on distributing them evenly across decoupled groups. Ideally, each group should contain **similar numbers of switches** and **no more than 15 switching elements per group**.
{% endstep %}

{% step %}

### Add SSN NIBs

Open the Simulink **Library Browser**, navigate to **Artemis > SSN > Nodal Interface Blocks**, and insert an **SSN Interface Block** at a node to separate the model into **state-space groups**. A single NIB can connect several groups by increasing its **Number of Ports** parameter.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-5f5bb0ff65229d828d51e25fc00b4b7ff07cf5a6%2Fadd-artemis-ssn.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Configure NIB ports for proper causality

Set the **Port type** according to the characteristics of the connected group:

* **V-type**: for inductive groups (emulates a voltage source)
* **I-type**: for capacitive groups (emulates a current source)
* **X-type**: reserved for specific scenarios, which will be explained in the relevant sections when those scenarios are discussed

{% hint style="info" %}
If a port type is set incorrectly, an error message will indicate the misconfigured port, helping you fix causality mismatches quickly.
{% endhint %}
{% endstep %}

{% step %}

### Tag SSN groups (optional)

In large models, it may not always be clear which subcircuit corresponds to a given SSN group. To clearly identify groups, navigate to **Artemis > SSN** and connect **SSN group tag** blocks to any wire within each group. Name each tag appropriately so that the tag names appear in the **Diagnostics Viewer**, making it easy to identify and manage the groups.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-641ea1807f71bdc25194aeb15721884071ff0e7d%2Fadd-tag-ssn-group-artemis.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Optimize SSN groups

After adding and configuring NIBs, run the model in Simulink and open the **Diagnostics Viewer**. Keep SSN groups balanced, with roughly 6–9 switches each, and avoid creating too many groups, since each additional group increases nodal nodes and computation time.
{% endstep %}
{% endstepper %}

{% hint style="danger" %}
Current **measurement** blocks connected to NIBs **may require inversion**. If an error occurs:

1. Select the **measurement** block, hold **SHIFT**, and move it. This disconnects the block from the connected signal lines while leaving the lines in place.
2. Flip the block (use **CTRL + I**).
3. Multiply the current measurement outputs by **-1** using a gain block.

<img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-d9f2f6f3aad1f372160df915de8571c4c2183e4b%2Fartemis-current-measurement.png?alt=media" alt="" data-size="original">
{% endhint %}


---

# 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/rt-lab/model-and-simulation/power-systems-with-artemis/model-optimization/decouple-model-topology-with-ssn-interface-block.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.
