Separate adding components from adding buses in PowerElectronics system assembly.
Open
@alexander-novo is already working on this.
Since Mar 31, 2026.
enhancement
- Dominant language
- C++
- Stars
- 27
- Forks
- 11
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 23
Description
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 Vectorsmethod called by the system model. - Components have coupling variables tagged with values in
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. - 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
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. - 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.