> 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/set-artemis-simulation-flags.md).

# Set ARTEMiS Simulation Flags

This page describes optional flags that can be added to MATLAB/Simulink or RT-LAB to adjust ARTEMiS behavior, improve numerical stability, or optimize real-time performance.

## MATLAB / Simulink Flags

These flags are added as variables in the **MATLAB workspace**. To automatically set flags when a specific model opens or runs, you can use the **Model Initialization** block from **Artemis** > **Tools > Misc** and include the desired flags.

<table><thead><tr><th width="354.90911865234375">Flag</th><th>Description &#x26; Usage</th></tr></thead><tbody><tr><td><strong>op_ssn_allow_simultaneous_iterations=1</strong></td><td>Enables the legacy iSWITCH iteration method (used before ARTEMiS 7.0.6). In that mode, multiple switches can change conduction state during a single iteration loop, improving speed but potentially reducing stability. The default (new) method allows only one switch change per iteration for improved robustness.</td></tr><tr><td><strong>USE_MFILE_SSN_SFUNCTION=1</strong></td><td>Forces SSN to use the internal m-coded S-function instead of the compiled one. Also displays a <em>balancing factor</em> for each group’s admittance matrix — normally 0, but higher values may indicate problematic SSN grouping, NIB type selection, or limit parameters.</td></tr><tr><td><strong>op_ssn_online_quad_precision_inversion=1</strong></td><td>Uses quadruple-precision arithmetic for matrix inversions during real-time execution <strong>on Linux targets only</strong>. Windows and Microsoft Visual Studio do not support quadruple precision.</td></tr><tr><td><strong>op_ssn_print_iteration_info</strong></td><td>Prints detailed SSN iteration information to the MATLAB console during simulation.</td></tr><tr><td><strong>ARTEMIS_USE_STATE_SPACE_SFUN=1</strong></td><td>Forces ARTEMiS to use the legacy state-space S-function instead of the SSN S-function for non-SSN parts of the model. The legacy version can be slightly faster in very small models. Since ARTEMiS 7.3, all submodels by default use the SSN S-function.</td></tr></tbody></table>


---

# 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/set-artemis-simulation-flags.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.
