SimPowerSystems/Extra Library/Discrete Measurements/Discrete Active & Reactive Power: This discrete block measures the active power P and reactive power Q, ,at fundamental frequency of a periodic set of voltage and current which may contain harmonics. P and Q are calculated by evaluating the fundamental values of the input voltage and current with a running window over one cycle of the fundamental frequency.
input 1: Instantaneous voltage (V)
input 2: Instantaneous current (A)
Output 1: Vector of the fundamental values (Magnitude) of the voltage & current
Output 2: PQ measurement vector [P(W) Q (var)] evaluated at the fundamental frequency.
Sign convention: Current flowing into an RL circuit will
produce positive active and reactive powers.
For the first cycle of simulation, the outputs are held constant using the values specified by the parameters "Initial input".