> 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/measurement/active-and-reactive-power.md).

# Active & Reactive Power

## Description

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

The **Active & Reactive Power** block, located in the **OPAL-RT SPS Software/Sensors and Measurements** library, measures the active power P and reactive power Q associated with a periodic voltage-current pair that can contain harmonics.

P and Q are calculated by averaging the V I product with a running average window over one cycle of the fundamental frequency, so that the powers are evaluated at fundamental frequency.

{% hint style="info" %}
The Measurements section of the Control and Measurements library contains the [**Power block**](https://www.opal-rt.com/docs/smart-power-simulation-software-sps/blocks-functions-tools/control-and-measurements/analysis/power.md). This is an improved version of the Active & Reactive Power block.

The new block features a mechanism that eliminates duplicate continuous and discrete versions of the same block by basing the block configuration on the simulation mode. If your legacy models contain the Active & Reactive Power block, they continue to work. However, **for best performance, use the Power block in your new models.**
{% endhint %}

$$
P = \frac{1}{T} \int\_{t-T}^{t} V(\omega t), I(\omega t), dt \\\[8pt]

Q = \frac{1}{T} \int\_{t-T}^{t} V(\omega t), I(\omega t - \pi/2), dt \\\[8pt]
$$

where *T* = 1/(fundamental frequency).

A current flowing into an RL branch, for example, produces positive active and reactive powers.

As this block uses a running window, one cycle of simulation has to be completed before the output gives the correct active and reactive powers.

For the first cycle of simulation, the outputs are held constant using the values specified by the initial input parameters.

## Parameters

<table data-header-hidden><thead><tr><th width="249.9110107421875"></th><th></th></tr></thead><tbody><tr><td><strong>Fundamental frequency (Hz)</strong></td><td>The fundamental frequency, in hertz, of the instantaneous voltage and current.</td></tr></tbody></table>

## Inputs and Outputs

<table data-header-hidden><thead><tr><th width="249.6444091796875"></th><th></th></tr></thead><tbody><tr><td><strong>V</strong></td><td>The first input is the instantaneous voltage, in volts.</td></tr><tr><td><strong>I</strong></td><td>The second input is the instantaneous current, in amperes.</td></tr><tr><td><strong>PQ</strong></td><td>The output is a vector [P Q] of the active and reactive powers, in watts and vars, respectively.</td></tr></tbody></table>

## Examples

The [Three-Winding Distribution Transformer](https://www.opal-rt.com/docs/smart-power-simulation-software-sps/example-models/get-started-with-sps/three-winding-distribution-transformer.md) (power\_transfo) example simulates a three-winding distribution transformer rated at 75 kVA:14400/120/120 V.


---

# 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/measurement/active-and-reactive-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.
