# Active & Reactive Power

Measure active and reactive powers of voltage-current pair

## Library

powerlib_extras/Measurements

A discrete version of this block is available in the powerlib_extras/Discrete Measurements library.

A phasor version of this block is available in the powerlib_extras/Phasor Library.

**Note**

The Measurements section of the Control and Measurements library contains the Power block. 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.

## Description

The Active & Reactive Power block 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.

$$\begin{array}{c}P=\frac{1}{T}{\displaystyle \underset{t-T}{\overset{t}{\int}}V(\omega t)\cdot I(\omega t)\text{\hspace{0.17em}}dt}\\ Q=\frac{1}{T}{\displaystyle \underset{t-T}{\overset{t}{\int}}V(\omega t)\cdot I(\omega t-\pi /2)\text{\hspace{0.17em}}dt},\end{array}$$

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.

The discrete version of this block, available in the powerlib_extras/Discrete Measurements library, allows you to specify the initial input voltage and current (magnitude and phase). For the first cycle of simulation, the outputs are held constant using the values specified by the initial input parameters.

## Parameters

**Fundamental frequency (Hz)**The fundamental frequency, in hertz, of the instantaneous voltage and current.

## Inputs and Outputs

`V`

The first input is the instantaneous voltage, in volts.

`I`

The second input is the instantaneous current, in amperes.

`PQ`

The output is a vector [P Q] of the active and reactive powers, in watts and vars, respectively.

## Examples

The `power_transfo`

example simulates a three-winding distribution transformer rated at 75 kVA:14400/120/120 V.

## Version History

**Introduced before R2006a**