> 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/simulation-and-analysis/choose-an-integration-method.md).

# Choose an Integration Method

## Introduction

Three solution methods are available through the powergui block. These are:

* continuous solution method using Simulink® variable-step solvers,
* discretization for solution at fixed time steps,
* phasor solution method using Simulink variable-step solvers.

## Continuous versus discrete solution

One important feature of SPS Software is its ability to simulate electrical systems either with continuous variable-step integration algorithms or with a fixed-step using a discretized system.

For small systems, **the continuous method** is usually more accurate. Variable-step algorithms are often faster because they take fewer steps than a fixed-step method for comparable accuracy.

When using line-commutated power electronics, variable-step, event-sensitive algorithms detect zero crossings of currents in diodes and thyristors with high accuracy, avoiding current chopping.

For large systems (many states or nonlinear blocks), the extreme accuracy of continuous methods can slow down simulation. In such cases, **discretizing the system** is advantageous.

{% hint style="info" %}
**Guideline**: consider a system "small" if it contains fewer than 50 electrical states and fewer than 25 electronic switches. Circuit breakers generally do not affect speed much because they operate only a few times during a test.
{% endhint %}

## Phasor solution method

If you are interested only in changes in magnitude and phase of voltages and currents when switches are operated, you do not need to solve the full differential equations (state-space model) arising from R, L, C interactions. Instead, you can solve a much simpler set of algebraic equations relating voltage and current phasors.

* The phasor solution method computes voltages and currents as phasors and is particularly useful for studying transient stability of networks with large generators and motors.
* Electromechanical oscillations of interest typically modulate magnitude and phase at low frequencies (about 0.02 Hz to 2 Hz), requiring long simulation times (tens of seconds). Continuous or discrete solution methods are not appropriate for such problems.
* The method ignores fast modes by replacing network differential equations with algebraic equations. The state-space model is replaced by a complex matrix evaluated at the fundamental frequency, relating machine-injected currents (inputs) to terminal voltages (outputs).
* Because the phasor approach uses a reduced state-space model (slow states of machines, turbines, regulators), it dramatically reduces required simulation time.

{% hint style="info" %}
Continuous variable-step solvers are efficient for phasor problems. Recommended solver: ode23tb with a maximum time step of one cycle of the fundamental frequency (1/60 s or 1/50 s). This technique provides solution primarily near the fundamental frequency.
{% endhint %}


---

# 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/simulation-and-analysis/choose-an-integration-method.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.
