Template Class SystemSteadyStateModel

Inheritance Relationships

Base Type

Class Documentation

template<class ScalarT, typename IdxT>
class SystemSteadyStateModel : public GridKit::ModelEvaluatorImpl<ScalarT, IdxT>

Prototype for a system model class.

This class maps component data to system data and implements ModelEvaluator for the system model. This is still work in progress and code is not optimized.

Todo:

Address thread safety for the system model methods.

Todo:

Tolerance management needs to be reconsidered.

Public Functions

inline SystemSteadyStateModel()

Constructor for the system model.

inline SystemSteadyStateModel(GridKit::PowerFlowData::SystemModelData<ScalarT, IdxT> mp)

Construct a new System Steady State Model object. Allows for simple allocation.

Parameters:

mp – model data

inline virtual ~SystemSteadyStateModel()

Destructor for the system model.

inline virtual int allocate()

Allocate buses, components, and system objects.

This method first allocates bus objects, then component objects, and computes system size (number of unknowns). Once the size is computed, system global objects are allocated.

Post:

size_quad_ == 0 or 1

Post:

size_ >= 1

Post:

size_opt_ >= 0

inline virtual int initialize()

Initialize buses first, then all the other components.

Buses must be initialized before other components, because other components may write to buses during the initialization.

Also, generators may write to control devices (e.g. governors, exciters, etc.) during the initialization.

Todo:

Implement writting to system vectors in a thread-safe way.

Pre:

All buses and components must be allocated at this point.

Pre:

Bus variables are written before component variables in the system variable vector.

inline virtual int tagDifferentiable()

Todo:

Tagging differential variables

Identify what variables in the system of differential-algebraic equations are differential variables, i.e. their derivatives appear in the equations.

inline virtual int evaluateResidual()

Compute system residual vector.

First, update bus and component variables from the system solution vector. Next, evaluate residuals in buses and components, and then copy values to the global residual vector.

Todo:

Here, components write to local values, which are then copied to global system vectors. Make components write to the system vectors directly.

Warning

Residuals must be computed for buses, before component residuals are computed. Buses own residuals for active and power P and Q, but the contributions to these residuals come from components. Buses assign their residual values, while components add to those values by in-place adition. This is why bus residuals need to be computed first.

inline virtual int evaluateJacobian()

Evaluate system Jacobian.

Todo:

Need to implement Jacobian. For now, using finite difference approximation provided by IDA. This works for dense Jacobian matrix only.

inline virtual int evaluateIntegrand()

Evaluate integrands for the system quadratures.

inline virtual int initializeAdjoint()

Initialize system adjoint.

Updates variables and optimization parameters, then initializes adjoints locally and copies them to the system adjoint vector.

inline virtual int evaluateAdjointResidual()

Compute adjoint residual for the system model.

Warning

Components write to bus residuals. Do not copy bus residuals to system vectors before components computed their residuals.

inline virtual int evaluateAdjointIntegrand()

Evaluate adjoint integrand for the system model.

Pre:

Assumes there are no integrands in bus models.

Pre:

Assumes integrand is implemented in only one component.