Summary
Based on issues #142 and #143 consider adding following method to the GridKit::PhasorDynamics::SystemModel class:
int updateComponentVariables(index_type component_id);
The method would prompt component (or subsystem) component_id to copy variable values from the system solution vector to component member variables. These are denoted as $y^r$ in #143.
Similarly, method
int updateBusVariables(index_type bus_id);
would prompt bus bus_id to update its own variables from the system solution vector. These variables are (should have been) denoted as $w^b$ in #143.
CC @Steven-Roberts @reid-g
Rationale
Multimethod numerical schemes may need to update only a subset of system variables, so there need to be methods that allow for that.
Description
In current GridKit implementation, the proposed function would look like this:
template<class scalar_type, class index_type>
int SystemSolver<scalar_type, index_type>::updateComponentVariables(index_type component_id)
{
for (IdxT j = 0; j < component->size(); ++j)
{
component->y()[j] = y_[varOffset[component_id] + j];
component->yp()[j] = yp_[varOffset[component_id] + j];
}
return 0;
}
Additional information
Eventually, with tighter integration with numerical integrator, these methods may become obsolete. Component internal variables could be simply references to the elements of system variables vector. In that case, the numerical integrator would write solution to the appropriate elements in the system solution vector and each component would have the up-to-date variables.
Summary
Based on issues #142 and #143 consider adding following method to the
GridKit::PhasorDynamics::SystemModelclass:The method would prompt component (or subsystem)$y^r$ in #143.
component_idto copy variable values from the system solution vector to component member variables. These are denoted asSimilarly, method
would prompt bus$w^b$ in #143.
bus_idto update its own variables from the system solution vector. These variables are (should have been) denoted asCC @Steven-Roberts @reid-g
Rationale
Multimethod numerical schemes may need to update only a subset of system variables, so there need to be methods that allow for that.
Description
In current GridKit implementation, the proposed function would look like this:
Additional information
Eventually, with tighter integration with numerical integrator, these methods may become obsolete. Component internal variables could be simply references to the elements of system variables vector. In that case, the numerical integrator would write solution to the appropriate elements in the system solution vector and each component would have the up-to-date variables.