> 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/power.md).

# Power

## Description

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

The **Power** block, located in the **OPAL-RT SPS Software/Sensors and Measurements** library, computes the active power (P), in watts, and the reactive power (Q), in vars, of a voltage-current pair at fundamental frequency. To perform this computation, the block first determines the fundamental values (magnitude and phase) of the two input signals V & I. The following P and Q are then calculated:

$$
P = \frac{|V|}{\sqrt{2}} \times \frac{|I|}{\sqrt{2}} \times \cos(\phi) \\\[8pt]

Q = \frac{|V|}{\sqrt{2}} \times \frac{|I|}{\sqrt{2}} \times \sin(\phi) \\\[8pt]

\phi = \angle V - \angle I \\\[8pt]
$$

As this block uses a running average window, one cycle of simulation must complete before the outputs give the correct value. For the first cycle of simulation, the outputs are held constant using the values specified by the **Voltage initial input** and **Current initial input** parameters.

#### Characteristics

<table data-header-hidden><thead><tr><th width="249.73333740234375"></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>Yes, of the parameters</td></tr><tr><td>Dimensionalized</td><td>Yes</td></tr></tbody></table>

## Ports

### Input

<table data-header-hidden><thead><tr><th width="250.22210693359375"></th><th></th></tr></thead><tbody><tr><td><strong>V</strong> — Voltage signal<br>Scalar</td><td>The voltage signal.</td></tr><tr><td><strong>I</strong> — Current signal<br>Scalar</td><td>The current signal.</td></tr></tbody></table>

### Output

<table data-header-hidden><thead><tr><th width="249.82220458984375"></th><th></th></tr></thead><tbody><tr><td><strong>P</strong> — Active power<br>Scalar</td><td>The active power of voltage-current pair signal, in watts.</td></tr><tr><td><strong>Q</strong> — Reactive power<br>Scalar</td><td>The reactive power of voltage-current pair signal, in vars.</td></tr></tbody></table>

## Parameters

<table data-header-hidden><thead><tr><th width="250.4444580078125"></th><th></th></tr></thead><tbody><tr><td><strong>Fundamental frequency (Hz)</strong> — Input signal fundamental frequency<br>60 (default) | positive scalar</td><td>Specify the fundamental frequency, in hertz, of the input signals.</td></tr><tr><td><strong>Voltage initial input [ Mag, Phase (degrees) ]</strong> — Initial voltage magnitude and phase<br>[1, 0] (default) | two-element vector</td><td>Specify the voltage initial magnitude and phase to set a constant output for the first cycle of simulation.</td></tr><tr><td><strong>Current initial input [ Mag, Phase (degrees) ]</strong> — Initial current magnitude and phase<br>[1, 0] (default) | two-element vector</td><td>Specify the current initial magnitude and phase to set a constant output for the first cycle of simulation.</td></tr><tr><td><strong>Sample time</strong> — Block sample time<br>0 (default) | nonnegative scalar</td><td>Specify the sample time of the block, in seconds. Set to 0 to implement a continuous block.</td></tr></tbody></table>

## Examples

The power\_Power model shows the accuracy of the Power block in evaluating the active and reactive powers of a voltage-current set.

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/power.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.
