Template Class Pmu
Defined in File Pmu.hpp
Inheritance Relationships
Base Type
public GridKit::EMT::Component< scalar_type, index_type >(Template Class Component)
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,pandq, inputsvandiof size 3, and outputsvrms,thetaandomega. Submodelpllreads the same voltage, and inputpllreads 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.
thetaandomegatake the tolerances thatPllsets 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
evaluateResidualto its kernels.- Returns:
0.
- Pre:
tagDifferentiablehas 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:
tagDifferentiablehas 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
vmsis the square of the line-to-line RMS voltage.
-
explicit Pmu(const ModelDataT &data)