> 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-simulink/model-and-simulation/add-and-configure-a-circuit-model-to-the-system-definition.md).

# Add and Configure a Circuit Model to the System Definition

## Overview <a href="#overview" id="overview"></a>

In the **System Explorer** window configuration tree, expand the **Power Electronics Add-On** custom device and select a **Circuit section** to display this page to add an electrical model to the VeriStand System Definition. When the VeriStand project is deployed, the circuit model is simulated on the FPGA through the **eHS Solver**.

## Add a Circuit Model

Click the **Circuit Model File Path** file browser button and navigate to the circuit model file you want to use. Wait for the parsing process to complete. (This may take several seconds).

Notice that the **Sources**, **Switches**, and **Measurements** sections have now been updated with the blocks defined in the circuit.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FpS0YQ1Yz3nlzptRUA4ri%2Fimage.png?alt=media&amp;token=725f13a0-4407-4ba8-ba60-3b86bb7997b5" alt="" width="563"><figcaption></figcaption></figure>

## Parameters

### Model

<table><thead><tr><th width="229.8221435546875">Parameter / Button</th><th>Description</th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>Specifies the name of the circuit model.</td></tr><tr><td><strong>Description</strong></td><td>Specifies a description for the circuit model.</td></tr><tr><td><strong>Circuit Model File Path</strong></td><td>Specifies the path to the circuit model file on disk. When a file path is added or modified, the model file is parsed and VeriStand channels are created corresponding to the <strong>Source</strong>, <strong>Switch</strong>, and <strong>Measurement</strong> components defined in the circuit model. Component configuration settings are set to their default states.</td></tr><tr><td><strong>Reload</strong></td><td>Parses the currently specified circuit model and updates the VeriStand channels. Components whose names have not changed retain their previously configured settings, while new or modified components are reset to the default state. Components that are no longer part of the model are removed.</td></tr><tr><td><strong>Clear</strong></td><td>Removes the currently loaded circuit model. When a circuit model is cleared, the corresponding <strong>Source</strong>, <strong>Switch</strong>, and <strong>Measurement</strong> sections are deleted from the Configuration Tree and all related mapping configuration settings are removed.</td></tr><tr><td><strong>Applied Timestep (s)</strong></td><td>Specifies the execution timestep of the circuit model. The configured value must be between the Minimum Timestep (s) and the Maximum Timestep (s).</td></tr><tr><td><strong>Optimize Solver Timesteps</strong></td><td>Optimizes the execution timestep of the circuit model for best performance when the circuit model is coupled to machine solvers. By default, this checkbox is enabled.<br>When Optimize Solver Timesteps is enabled, the Power Electronics Addon will calculate the optimal timestep for the circuit model in relation to other solvers in the VeriStand project, such as <strong>Machines</strong>. The Applied Timestep (s) control will be disabled for editing in this case.<br>In most cases, it is recommended to enable this feature as it ensures that the circuit model and machine solvers are properly synchronized to each other for optimal simulation results.</td></tr><tr><td><strong>Form Factor</strong></td><td>Displays the <strong>Form Factor</strong> of the eHS Solver that will be used to simulate the circuit model. The form factor is dependent on the selected <a href="https://www.opal-rt.com/docs/pe-add-on-simulink/hardware-configurations-reference/default-hardware-configurations.md"><strong>Hardware Configuration</strong></a>.</td></tr><tr><td><strong>Circuit Model File Warning</strong></td><td>If the file at Circuit Model File Path has been modified on disk since the circuit model was last loaded, the following warning message is displayed: <em>Circuit model file has been modified on disk.</em> Click Reload to ensure that the currently loaded model is up to date with the version on disk. Reloading the model clears the warning message.</td></tr></tbody></table>

### Scenario Configuration

{% hint style="info" %}
The components in this subsection are disabled until a circuit model has been loaded. Microsoft Excel is required to use the **Scenarios** feature.
{% endhint %}

<table><thead><tr><th width="229.99993896484375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Scenarios File Path</strong></td><td>Specifies the path to the Scenarios file on disk.</td></tr><tr><td><strong>New</strong></td><td>Creates a new Scenario template file with the name and path specified in Scenarios File Path. The specified file must have the extension <em>.xls.</em></td></tr><tr><td><strong>Use Scenarios?</strong></td><td>Enables the Scenarios feature in eHS. When enabled, the <strong>Scenario ID</strong> channel is added to the Configuration Tree.</td></tr></tbody></table>

### Model Information

<table><thead><tr><th width="229.11114501953125">Parameter / Button</th><th>Description</th></tr></thead><tbody><tr><td><strong>Minimum Timestep (s)</strong></td><td>Displays the smallest timestep at which the eHS Solver can simulate the circuit model. eHS will run the simulation at this timestep by default, unless a larger timestep is specified in the <strong>Timestep (s)</strong> field.</td></tr><tr><td><strong>Maximum Timestep (s)</strong></td><td>Displays the largest timestep at which the eHS Solver can simulate the circuit model.</td></tr><tr><td><strong>Number of Scenarios Used</strong></td><td>Displays the number of Scenarios defined in the currently loaded Scenarios file.</td></tr><tr><td><strong>Maximum Number of Scenarios</strong></td><td>Displays the maximum number of scenarios that can be configured in the Scenarios file.</td></tr><tr><td><strong>Refresh</strong></td><td>Reanalyzes the circuit model file to refresh the information displayed under <strong>Model Information</strong>.</td></tr></tbody></table>

## eHS Circuit Loading Behavior

Mapping and configurations settings applied to the **Source**, **Switch**, **Waveform**, and **IO** pages are preserved by saving the System Definition file. In certain cases, such as when loading a new circuit model file, these parameters may be reset to their default values.

{% hint style="info" %}
The following actions cause the **Source**[ ](https://opal-rt.atlassian.net/wiki/spaces/PNIVS/pages/140773615)and **Switch**[ ](https://opal-rt.atlassian.net/wiki/spaces/PNIVS/pages/140184302)configuration settings to be reset to their default state:

* Renaming the circuit model file on disk and loading the file.
* Moving the circuit model file on disk and loading it from the new path.
  {% endhint %}

In the following situations, all existing mappings and configuration settings are preserved (**Sources**, **Switches**, **Waveforms**, **Analog Outputs**, and **Digital Outputs**):

* The circuit model file is unchanged and reloaded, either by browsing to the same **Circuit Model File Path**, or by clicking the **Reload** button.
* **Sources**, **Switches**, or **Measurements** are added or removed, then the circuit model file is reloaded. Note that **Source** and **Switch** component mappings are only preserved for components whose names have not changed.
* Changes are made to the passive elements, then the circuit model file is reloaded.


---

# 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-simulink/model-and-simulation/add-and-configure-a-circuit-model-to-the-system-definition.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.
