> 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/get-started-with-artemis.md).

# Get Started with ARTEMiS

{% stepper %}
{% step %}

### Open a Simulink SPS model

Start MATLAB and open a Simulink model that uses SPS blocks.
{% endstep %}

{% step %}

### Add the ARTEMiS Guide block

Open the Simulink **Library Browser**, navigate to **Artemis > ARTEMIS**, and drag the **ARTEMIS Guide** block into the top level of your model. This block manages the real-time execution of the SPS model and provides options for advanced solver configurations.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-c3a077ccdba0f4a2b08502baab50a8300ef1e471%2Fadd-artemis-guide-block.png?alt=media" alt="" width="502"><figcaption></figcaption></figure>

{% hint style="info" %}
The **ARTEMIS Guide** block takes precedence over the **powergui** block. As a result, the power system is simulated using the options defined in the  **ARTEMIS Guide** block.
{% endhint %}
{% endstep %}

{% step %}

### Set the ARTEMIS Guide block sample time

By default, the sample time is defined as **Ts** within the **ARTEMIS Guide** block. You could set a fixed numeric value, but if you do, it must be used consistently throughout the model. A better approach is to reuse the **Ts** variable and define it in a central location. For example, you can use the **Model Initialization** block from **Artemis** > **Tools > Misc** to define **Ts** and other variables as needed.

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

{% step %}

### Set the powergui block simulation type and sample time

The **powergui** block’s **simulation type** must be set to **Discrete**, and its **sample time** should match the **ARTEMIS Guide** block, ideally using the **Ts** variable.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-9ce81f6f9010845e93bc1015c1a450cab49c28d4%2Fset-powergui-simulation-type.png?alt=media" alt="" width="385"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Set the model sample time

Set the model’s sample time to match the **ARTEMIS Guide** block, ideally using the **Ts** variable. This ensures consistency across the model and proper real-time execution.
{% endstep %}

{% step %}

### Run the model

The model can be run in Simulink or in real-time, but the primary benefits of ARTEMiS are realized in real-time simulations. Since ARTEMiS precomputes and discretizes all state-space matrices for every switch topology **before** execution, computation overshoots that commonly cause overruns in real-time simulations are greatly reduced.
{% endstep %}
{% endstepper %}


---

# 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/get-started-with-artemis.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.
