Skip to content

Frequency Estimation Blocks

Blocks that expose the frequency RAMSES estimates at the bus a device is connected to. Which block to use depends on the model type.


Computes ff, an estimate of the frequency (in per unit) at a given bus, from the evolution of the rectangular components vxv_x and vyv_y of the bus voltage. A measurement time constant TT is involved. Can be used in the model of an injector only.

Syntax

& f_inj
f
{T}

f is the name of the estimated frequency variable; T is the measurement time constant (data name, parameter name, or math expression). The voltage components vxv_x and vyv_y are automatically inherited and must not be declared.

Internal states: vxmv_{xm} and vymv_{ym} (measured/filtered voltage components)

Discrete variables: none

Equations

v˙xm=vxvxmTv˙ym=vyvymT0=ωref,pu+(vyvym)vxm(vxvxm)vym2πfNT(vxm2+vym2)f\begin{aligned} \dot{v}_{xm} &= \frac{v_x - v_{xm}}{T} \\[6pt] \dot{v}_{ym} &= \frac{v_y - v_{ym}}{T} \\[6pt] 0 &= \omega_{ref,pu} + \frac{(v_y - v_{ym})\,v_{xm} - (v_x - v_{xm})\,v_{ym}}{2\pi f_N T \left(v_{xm}^2 + v_{ym}^2\right)} - f \end{aligned}

Initialization

vxm=vxvym=vyv_{xm} = v_x \qquad v_{ym} = v_y

Explanation

Bus voltage phasor projected onto reference axes

The voltage components vxv_x and vyv_y are the projections of the bus voltage phasor onto the reference axes rotating at angular speed ωref\omega_{ref} (rad/s). The instantaneous angular frequency is:

ω=ωref+dϕdt,ϕ=arctanvyvx\omega = \omega_{ref} + \frac{d\phi}{dt}, \qquad \phi = \arctan\frac{v_y}{v_x}

The per-unit frequency is therefore:

f=ω2πfN=ωref,pu+12πfNddt ⁣(arctanvyvx)=ωref,pu+12πfNv˙yvxv˙xvyvx2+vy2f = \frac{\omega}{2\pi f_N} = \omega_{ref,pu} + \frac{1}{2\pi f_N}\frac{d}{dt}\!\left(\arctan\frac{v_y}{v_x}\right) = \omega_{ref,pu} + \frac{1}{2\pi f_N}\frac{\dot{v}_y v_x - \dot{v}_x v_y}{v_x^2 + v_y^2}

where fNf_N is the nominal frequency (known from the system data). To filter transients, vxv_x and vyv_y are passed through first-order filters with time constant TT, yielding the measured values vxmv_{xm} and vymv_{ym}. Substituting the filter derivatives into the frequency expression yields the third equation above.

Notes

  • A recommended value for TT is in the range 0.050.050.100.10 s.
  • T=0T = 0 is not allowed. If TT is too small, the solver may encounter a singularity and the simulation may fail.

Similar to f_inj. Computes ff, an estimate of the frequency (in per unit) at the first bus of a given two-port. Can be used in the model of a two-port only.

Syntax

& f_twop_bus1
f
{T}

f is the name of the estimated frequency variable; T is the measurement time constant (data name, parameter name, or math expression).

Internal states: vxmv_{xm} and vymv_{ym} (filtered voltage components at bus 1)

Discrete variables: none

Equations, initialization, and notes: identical to f_inj, refer to that block for the full mathematical description. The only difference is that this block uses the voltage at the first bus of a two-port rather than an injector bus.


Similar to f_inj. Computes ff, an estimate of the frequency (in per unit) at the second bus of a given two-port. Can be used in the model of a two-port only.

Syntax

& f_twop_bus2
f
{T}

f is the name of the estimated frequency variable; T is the measurement time constant (data name, parameter name, or math expression).

Internal states: vxmv_{xm} and vymv_{ym} (filtered voltage components at bus 2)

Discrete variables: none

Equations, initialization, and notes: identical to f_inj, refer to that block for the full mathematical description. The only difference is that this block uses the voltage at the second bus of a two-port rather than an injector bus.