Summary
Suggested Change
In class PowerElectronicsModel when assembling the system and evaluating residual vectors and Jacobian matrices use separate loops to add contributions from components and connection nodes (buses).
Definitions
- Components are objects that:
- own and evaluate their internal equations
- contribute to the coupling equations
- may own their internal but not coupling variables
- Coupling nodes (buses) are objects that:
- own coupling equations and coupling variables
- may contribute to coupling equations
Current State
- Internal and external variables are updated from the system solver class using
distribute Vectors method called by the system model.
- Components have coupling variables tagged with values in
extern_indices_, which is a std::set. It would give us more flexibility if components own arrays with mapping indices for internal and external (coupling) variables instead.
- There are no mapping vectors for component residual values.
Rationale
- Internal component equations can be updated by embarrassingly parallel computations. Separating components from buses helps expose this parallelism.
- Coupling variables are owned by coupling nodes (buses). Exposing these, provides better access to the variables that need to be communicated.
- Separating component's residual and Jacobian into internal part and contributions to the coupling (external) part will likely simplify implementation of co-simulation and multimethod integration methods.
- Mapping indices to variable and residual vectors, as well as Jacobians should be set in allocate function. That way we can preconfigure sparsity of the Jacobian to have favorable pattern for matrix factorization.
- Components owning mapping indices will allow us to remove local data copies in components and let components operate on system vectors and Jacobian.
Description
- Consider making function
distributeVectors an internal method to component classes (and select better descriptive name for it). Upon allocation, each component should have a mapping vector with indices to the variable locations in global variable vector. Probably a good idea to have method updateVariables that would be called inside component's evaluateResidual and evaluateJacobian methods.
- Consider implementing separate methods to update internal component variables and coupling variables.
- Create separate component methods to update internal equations residuals and to add contributions to the coupling equations. Have each component own a mapping vector to the global residual vector.
- Change class name
PowerElectronicsModel --> SystemModelPowerElectronics.
Additional information
Also, see #339.
CC @nkoukpaizan @PhilipFackler
Summary
Suggested Change
In class
PowerElectronicsModelwhen assembling the system and evaluating residual vectors and Jacobian matrices use separate loops to add contributions from components and connection nodes (buses).Definitions
Current State
distribute Vectorsmethod called by the system model.extern_indices_, which is astd::set. It would give us more flexibility if components own arrays with mapping indices for internal and external (coupling) variables instead.Rationale
Description
distributeVectorsan internal method to component classes (and select better descriptive name for it). Upon allocation, each component should have a mapping vector with indices to the variable locations in global variable vector. Probably a good idea to have methodupdateVariablesthat would be called inside component'sevaluateResidualandevaluateJacobianmethods.PowerElectronicsModel-->SystemModelPowerElectronics.Additional information
Also, see #339.
CC @nkoukpaizan @PhilipFackler