Global state views in PhasorDynamics SystemModel #411
Conversation
3869aac to
fd8fbcf
Compare
pelesh
left a comment
There was a problem hiding this comment.
Blocking this PR until Jacobian implementation in PhasorDynamics is refactored to eliminate deprecated Matrix_COO object.
fd8fbcf to
fe9514c
Compare
fe9514c to
10a9254
Compare
|
@lukelowry, please take a look at vector class in Re::Solve. This is something we need to add to the |
|
@pelesh Are you suggesting |
PhilipFackler
left a comment
There was a problem hiding this comment.
I think this is great as-is. Replacing this Vector class with the Re::Solve version in a later PR would be pretty straightforward.
Description
This PR updates PhasorDynamics so buses and components use their slices of the
SystemModelstate vectors directly. This removes the local state copy path and keeps component accessors consistent with the integrator-updated system state.Partially addresses #96. Related to #145.
Proposed changes
StateVectorsupport soGridElementcan own standalone state or aliasSystemModelstate.SystemModelallocation to bind each bus/component to global state and verify element sizes remain fixed.yData()accessor for live state pointers.Performance was measured with
application/PhasorDynamics/PDSimusing the app-reportedComplete intime. Each row reports the median of 3 trials after rebuildingPDSimon the corresponding branch.develop(s)Checklist
-Wall -Wpedantic -Wconversion -Wextra.Further comments
This work was motivated by the addition of IEEEST stabilizers: adding 333 stabilizers to the Texas case dramatically reduced performance, and this change removes avoidable state-copy overhead in PhasorDynamics system evaluation.
This is not intended to be the final state-vector API design. The cleaner long-term solution would be to update
Evaluatorso state and residual accessors expose non-owning vector views instead of requiring ownedstd::vectorstorage, e.g.This PR keeps the change local to PhasorDynamics while removing the current copy path.