> 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/smart-power-simulation-software-sps/blocks-functions-tools/simulation-and-analysis/power_initstates.md).

# power\_initstates

## Description

The **power\_initstates function** returns the initial values of the electrical state variables (inductor currents and capacitor voltages) of a model, and modifies the initial electrical states to start the simulation from any initial conditions. It returns a structure with these fields:

## Syntax

{% code lineNumbers="true" %}

```matlab
sps = power_initstates('sys')
```

{% endcode %}

## Output Arguments

<table data-header-hidden><thead><tr><th width="249.6666259765625"></th><th></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Description</strong></td></tr><tr><td>circuit</td><td>The name of the model</td></tr><tr><td>States</td><td>The names of the electrical state variables</td></tr><tr><td>x0</td><td>The current initial states vector used for the simulation of the model</td></tr><tr><td>x0_steady</td><td>The computed initial states that ensure a steady-state simulation</td></tr><tr><td>x0_blocks</td><td>The default initial states values defined in blocks</td></tr><tr><td>DependentStates</td><td>The names of the dependent states, if any</td></tr><tr><td>x0DependentStates</td><td>Initial state values of dependent states</td></tr><tr><td>UseInitialStatesFrom</td><td><p>The initial state for the simulation, expressed as a character vector (‘block’, ‘steady’, ‘zero’).</p><p>If set to 'block', the default initial states are used. If set to 'steady', the computed initial states that ensure a steady-state simulation are used.</p><p>If set to 'zero', the initial states are forced to 0.</p></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/smart-power-simulation-software-sps/blocks-functions-tools/simulation-and-analysis/power_initstates.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.
