> 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/hypersim/library-blocks-reference/control-miscellaneous/state-variable-system.md).

# State Variable System

## Description

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-4e256fb73fc7fce89fcad6c58b91f76cb8ece62a%2Fimage%20(941).png?alt=media" alt="" width="185"><figcaption></figcaption></figure>

The **State-space** block, located in the **Control Miscellaneous** library, implements the linear state-space equations

<p align="center">x’ = Ax + Bu</p>

<p align="center">Y = Cx + Du</p>

Matrix dimensions must match:

* A is number of states × number of states;
* B is number of states × number of inputs;
* C is number of outputs × number of states;
* D is number of outputs × number of inputs.

The number of states, inputs, and outputs must be greater than 0.

## Mask parameters

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-6a91ca7b51ac55df483372414594bb07ad366f84%2Fimage%20(942).png?alt=media" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="201.20001220703125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Number of inputs</strong></td><td>Maximum value 10, inputs are automatically created or deleted following the value</td></tr><tr><td><strong>Number of outputs</strong></td><td>Maximum value 10, outputs are automatically created or deleted following the value</td></tr><tr><td><strong>Number of states</strong></td><td>Maximum value 10, are automatically created or deleted following the value</td></tr><tr><td><strong>A, B,C and D</strong></td><td>Matrix of size depending on Number of inputs, outputs and states.</td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="200.4000244140625">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>u1, u2, ..</strong></td><td>Input signals depending on the parameter Number of inputs</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="199.5999755859375">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>y1, y2,..</strong></td><td>Output signals depending on the parameter Number of outputs</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/hypersim/library-blocks-reference/control-miscellaneous/state-variable-system.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.
