> 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/ehs/3.7/model-in-schematic-editor/design-the-ehs-circuit/use-variables-and-expressions-in-parameters.md).

# Use Variables & Expressions in Parameters

Most numerical scalar parameters in the Schematic Editor support variables and expressions. This capability simplifies model development and maintenance by allowing common values to be defined once and reused throughout the circuit model.

Because the Schematic Editor does not provide its own workspace for variable definitions, variable resolution depends on the simulation environment used.

## RT-LAB

When using RT-LAB, variable resolution relies on the MATLAB base workspace.

Variables can be defined manually in the MATLAB workspace or loaded automatically through an initialization script before opening or loading the circuit. Once defined, the variables become available to the Schematic Editor.

Any valid MATLAB expression can be used in a parameter, provided that the expression evaluates to a scalar double value.

## HYPERSIM

When using HYPERSIM, variable resolution relies on HYPERSIM's expression evaluation mechanism.

Variables are defined by adding **Constant, integer** or **Constant, float** blocks to the model and assigning them the desired names and values. These blocks do not need to be connected to any other component.

Any valid HYPERSIM expression can be used in a parameter, provided that the expression evaluates to a scalar double value.

When referencing a HYPERSIM constant from the Schematic Editor, use the name of the constant block followed by:

* `.K` for **Constant, integer** blocks
* `.A` for **Constant, float** blocks


---

# 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/ehs/3.7/model-in-schematic-editor/design-the-ehs-circuit/use-variables-and-expressions-in-parameters.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.
