Template Class BusInfinite

Inheritance Relationships

Base Type

Class Documentation

template<typename scalar_type, typename index_type>
class BusInfinite : public GridKit::PhasorDynamics::BusBase<scalar_type, index_type>

Implementation of an “infinite” bus.

Public Functions

BusInfinite()

Constructor for an infinite (slack) bus.

The model is using current balance in Cartesian coordinates.

Arguments to be passed to BusBase:

  • Number of equations = 0 (size_)

  • Number of variables = 0 (size_)

BusInfinite(ScalarT Vr, ScalarT Vi)

BusInfinite constructor.

This constructor sets initial values for active and reactive voltage.

Arguments to be passed to BusBase:

  • Number of equations = 0 (size_)

  • Number of variables = 0 (size_)

BusInfinite(const ModelDataT &data)

Construct a new BusInfinite.

Arguments to be set in BusBase:

  • Number of equations = 0 (size_)

  • Number of variables = 0 (size_)

Parameters:

data[in] - structure with bus data

virtual int setBusID(IdxT) final override

Set the bus ID.

virtual int allocate() final override

allocate method resizes local solution and residual vectors.

virtual int tagDifferentiable() final override

Tag differentiable variables.

virtual int initialize() final override

initialize method sets bus variables to stored initial values.

virtual int evaluateResidual() final override

Reset slack currents to zero.

Infinite bus does not compute residuals, so here we just reset current values to zero. Components connected to the infinite bus will add their currents to Ir_ and Ii_. The resultant will be slack current that the infinite bus has to pick up.

Warning

This implementation assumes bus residuals are always evaluated before component model residuals.

virtual int evaluateJacobian() final override

There is no Jacobian for slack variables.

Returns:

int - error code

inline virtual BusTypeT BusType() const final override

Pure virtual function, returns bus type (DEFAULT or SLACK).