Template Class Pmu

Inheritance Relationships

Base Type

Class Documentation

template<typename scalar_type, typename index_type>
class Pmu : public GridKit::EMT::Component<scalar_type, index_type>

Phasor measurement unit on a three-phase bus.

Public Functions

explicit Pmu(const ModelDataT &data)

Construct a phasor measurement unit.

Layout: internal variables vms, p and q, inputs v and i of size 3, and outputs vrms, theta and omega. Submodel pll reads the same voltage, and input pll reads its angle and integrator state.

PllT &submodel(SubmodelsT symbol)

Submodel symbol.

virtual Model::ConfigurationChecks verify() const override

A unit has no parameter of its own to check.

Returns:

No failed check.

virtual int setAbsoluteTolerance(RealT rel_tol) override

Set the tolerances from the base voltage of the measured bus and the system power base.

theta and omega take the tolerances that Pll sets for its own.

Parameters:

rel_tol – [in] Relative tolerance of the integrator.

Returns:

0.

Pre:

The system has bound this model and set the tolerance of its bus.

virtual int tagDifferentiable() override

Fill the tag() vector with proper indicators.

Note

For some models, this may be a no-op, and the vector returned by tag() will still be empty.

Pre:

allocate() must have been called.

virtual int evaluateResidual() override

Add the residual of a linear model to the system residual.

The residual of a linear model is its constant partials dF/dy and dF/dy’ applied to the values and the derivatives, so no kernel is evaluated. A model with any other term forwards evaluateResidual to its kernels.

Returns:

0.

Pre:

tagDifferentiable has stored the partials.

virtual int evaluateOutputs() override

Evaluate every output at the current values, whether or not it is connected.

virtual int evaluateJacobian() override

Set the Jacobian entries to dF/dy + alpha dF/dy’.

Returns:

0.

Pre:

tagDifferentiable has stored the partials of the entries.

template<typename T>
void internalResidual(const T *y, const T *yp, const T *w, const T *wp, T *f) const

Write the residuals of the mean-square voltage and of the powers.

Each follows its instantaneous value over half a cycle of the system frequency base. The mean over the phases is removed, so on a balanced bus vms is the square of the line-to-line RMS voltage.

template<typename T>
void output(OutputsT output, const T *y, const T *yp, const T *w, const T *wp, T *f) const

Write output output.

vrms is the square root of vms. theta is the angle of submodel pll, and omega its frequency, which Pll writes from its own variables and the measured voltage.