Template Class DistributedGenerator

Inheritance Relationships

Base Type

Class Documentation

template<class ScalarT, typename IdxT>
class DistributedGenerator : public GridKit::CircuitComponent<ScalarT, IdxT>

Declaration of a DistributedGenerator class.

Public Functions

DistributedGenerator(IdxT id, DistributedGeneratorParameters<RealT, IdxT> parm, bool reference_frame, NodeT *node_ref, NodeT *node_bus)

Constructor for a Distributed Generator.

Todo:

Maybe have parameters be templated in. Variables cannot be changed and are unlikely to. Allows for compile time optimizations

Calls default ModelEvaluatorImpl constructor.

virtual int initialize()

Initialization of the grid model

virtual int allocate() final

Allocates all of the internal buffers for the component. If a components needs a more specialized allocation (such as by having additional internal buffers), it should override this function and then call it in the body to ensure it stays up-to-date with new implementations.

Pre:

nnz_ and size_ must be set. Typically these are set by the child object in its constructor.

Returns:

An error code, or 0 if success

virtual int evaluateInternalResidual() final

Contributes to the resisdual of the Distributed Generator.

virtual int evaluateExternalResidual() final

Evaluate all of the residuals of external variables of the component, modifying f_.

Returns:

An error code, or 0 if successful.

virtual int evaluateJacobian()

Compute the jacobian of the DistributedGenerator for iteration. dF/dy - \alpha dF/dy’.

The matrix dF/dy should be

[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] [-1, 0, 0, 0, -mp, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] [ 0, 0, 0, 0, -wc, 0, 0, 0, 0, 0, 0, 0, wc*x15, wc*x16, wc*x13, wc*x14] [ 0, 0, 0, 0, 0, -wc, 0, 0, 0, 0, 0, 0, -wc*x16, wc*x15, wc*x14, -wc*x13] [ 0, 0, 0, 0, 0, -nq, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0] [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0] [ 0, 0, 0, 0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