> 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_init.md).

# power\_init

## Description

The **power\_init function** sets initial state values of model built with SPS Software

Power\_init deals with two types of state variables: the Simulink<sup>®</sup> State variables and the Electrical State variables. The Simulink States consist of the entire set of state variables of a model (including the Electrical states) seen by Simulink software. The Electrical States are the particular Simulink states that define the capacitor initial voltages and inductor initial currents of the SPS Software blocks of your model.

## Syntax

{% code lineNumbers="true" %}

```matlab
[x0,states] = power_init(sys)
power_init(sys,'states')
power_init(sys,'ForceToZero')
power_init(sys,'ResetToDefault')
power_init(sys,'x0')
power_init(sys,'look')
power_init(sys,'reset')
power_init(sys,'steady')
```

{% endcode %}

**\[x0,states]** = power\_init(sys) returns the initial states values and state names of your model.

**power\_init(sys,'states')** displays in a two-column format the initial state values and names of your model.

**power\_init(sys,'ForceToZero')** sets to zero the initial states your model. It uses the **Data import/export initial state** option from the **Simulation > Model Configuration Parameters** menu in the **Simulink Editor** to specify the initial state values. Use the ResetToDefault option of power\_init to reset the Simulink configuration parameters to its previous settings.

**power\_init(sys,'ResetToDefault')** resets the initial state of Simulink configuration parameters to the settings prior to the use of the ForceToZero option of power\_init. This option has no effect on system if the ForceToZero option is not used before.

**power\_init(sys,'x0')** sets the initial state values equal to the vector specified by x0. The ordering of the states variables is given by the state option of power\_init. This option uses the **Data import/export initial state** option from the **Simulation > Model Configuration Parameters** menu in the **Simulink Editor** to specify the initial state values.

**power\_init(sys,'look')** displays in a two-column format the electrical initial states names and values of your model.

**power\_init(sys,'reset')** resets the electrical initial states of sys to zero.

**power\_init(sys,'steady')** sets the electrical initial states of sys to simulate the electrical circuit in the steady state.


---

# 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_init.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.
