> 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/control-and-measurements/analysis/sequence-analyzer.md).

# Sequence Analyzer

## Description

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-01c7651bf11b5cc7d8892764ef63dc20bf6ed09a%2Fsequence_analyser_block.png?alt=media" alt=""><figcaption></figcaption></figure>

The **Sequence Analyzer** block, located in the **OPAL-RT SPS Software/Sensors and Measurements** library, outputs the magnitude and phase of the positive-, negative-, and zero-sequence components of a set of three balanced or unbalanced signals. Index 1 denotes the positive sequence, index 2 denotes the negative sequence, and index 0 denotes the zero sequence. The signals can optionally contain harmonics. The three sequence components of a three-phase signal (voltages V<sub>1</sub> V<sub>2</sub> V<sub>0</sub> or currents I<sub>1</sub> I<sub>2</sub> I<sub>0</sub>) are computed as follows:

$$
V\_{1}
======

\frac{1}{3}
\left(
V\_{a}
\+
a \cdot V\_{b}
\+
a^{2} \cdot V\_{c}
\right)
\\\[8pt]

# V\_{2}

\frac{1}{3}
\left(
V\_{a}
\+
a^{2} \cdot V\_{b}
\+
a \cdot V\_{c}
\right)
\\\[8pt]

# V\_{0}

\frac{1}{3}
\left(
V\_{a}
\+
V\_{b}
\+
V\_{c}
\right)
\\\[8pt]

V\_{a},, V\_{b},, V\_{c} : \text{three voltage phasors at the specified frequency}
\\\[8pt]

a = e^{j 2\pi/3} = 1\angle 120^\circ\ \text{complex operator}
\\\[8pt]
$$

A Fourier analysis over a sliding window of one cycle of the specified frequency is first applied to the three input signals. It evaluates the phasor values Va, Vb, and Vc at the specified fundamental or harmonic frequency. Then the transformation is applied to obtain the positive sequence, negative sequence, and zero sequence.

As the block uses a running average window to perform the Fourier analysis, one cycle of simulation must complete before the outputs give the correct magnitude and angle. For example, the block response to a step change of V1 is a one-cycle ramp. For the first cycle of simulation, the output is held constant using the values specified by the initial input parameters.

## Characteristics

<table data-header-hidden><thead><tr><th width="250.22216796875"></th><th></th></tr></thead><tbody><tr><td>Sample Time</td><td>Specified in the <strong>Sample Time</strong> parameter Continuous if <strong>Sample Time</strong> = 0</td></tr><tr><td>Scalar Expansion</td><td>No</td></tr><tr><td>Dimensionalized</td><td>No</td></tr></tbody></table>

## Ports

### Input

<table data-header-hidden><thead><tr><th width="250.33331298828125"></th><th></th></tr></thead><tbody><tr><td><strong>abc</strong> — Three-phase current signal<br>Vector</td><td>Three-phase current signal. Index 1 denotes the positive sequence, index 2 denotes the negative sequence, and index 0 denotes the zero sequence.</td></tr></tbody></table>

### Output

<table data-header-hidden><thead><tr><th width="249.5555419921875"></th><th></th></tr></thead><tbody><tr><td><strong>|u|</strong> — Magnitude<br>Scalar</td><td>Outputs the magnitude (peak value) of the specified sequence component(s), in the same units as the abc input signal.</td></tr><tr><td><strong>∠u</strong> — Phase<br>Scalar</td><td>Outputs the phase, in degrees, of the specified components.</td></tr></tbody></table>

## Parameters

<table data-header-hidden><thead><tr><th width="249.77764892578125"></th><th></th></tr></thead><tbody><tr><td><strong>Fundamental frequency (Hz)</strong> — Fundamental frequency of input signal<br>60 (default) | scalar</td><td>Specify the fundamental frequency, in hertz, of the three-phase input signal.</td></tr><tr><td><strong>Harmonic n (1=fundamental)</strong> — Harmonic component to evaluate sequences<br>1 (default) | scalar</td><td>Specify the harmonic component to evaluate the sequences. Set to 1 to compute the sequences at the fundamental frequency or to the number corresponding to the desired harmonic.</td></tr><tr><td><strong>Sequence</strong> — Specify sequence component<br>Positive Negative Zero (default) | Positive | Negative | Zero</td><td>Specify the sequence component the block outputs. Select Positive Negative Zero to calculate all the sequences.</td></tr><tr><td><strong>Initial input [ Mag, Phase (degrees) ]</strong> — Initial magnitude and phase of input signal<br>[1, 0] (default) | vector</td><td>Specify the initial magnitude and phase, in degrees, of the positive-sequence component of the input signal.</td></tr><tr><td><strong>Sample time</strong> — Block sample time<br>0 (default) | positive scalar</td><td>Specify the sample time of the block, in seconds</td></tr></tbody></table>

## Examples

The power\_SequenceAnalyzer model shows the use of the Sequence Analyzer block to compute the three sequence components of a three-phase sinusoidal voltage.

The model sample time is parameterized by the Ts variable set to a default value of 50e-6 s. Set Ts to 0 in the command window to simulate the model in continuous mode.


---

# 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/control-and-measurements/analysis/sequence-analyzer.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.
