-
Notifications
You must be signed in to change notification settings - Fork 44
Sparse matrix solver: Trigger pivot perturbation based on each possibly ill-conditioned one #1125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
Converting back to draft as the validation cases created in #1118 are still unresolved if I force in the perturbation... Several things happen:
To summarize, this PR still has value, as it improves how we do perturbation (more fine grained and the whole matrix norm is now taken into account without generating fake observability), but it doesn't resolve (at least yet) the edge cases we are running into. I don't have a concrete proposal on how to go forward, so thoughts are welcome, but I will try some experimentation with how we determine the max pivot (maybe calculating it from the original matrix makes more sense, but it still doesn't seem satisfactory) and comment back here if I find any relevant results. |
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
Edit: This doesn't work for ill-conditioned cases generated by the opposite compared to the ones in the validation tests, i.e. for cases in which the source short circuit voltage is extremely high (very large |
Signed-off-by: Santiago Figueroa Manrique <[email protected]>
The final idea from this exploration is applied in 5d379a9. In short, the threshold to raise
The condition number Considering we are interested in the LU decomposition of the matrix, we can re-write the above as as as that is the element that affects the norm the most, we can approximate the condition number by and for the matrix to not be ill-conditioned, it needs to satisfy which translates into the introduced relative threshold check This works with the norm of the original matrix two ways. The condition number is defined over the original matrix, as this is the original problem we are trying to solve, and we homogenize the perturbation threshold with this one. This also takes care of both extreme ill-conditioned cases, when
With the introduction of the above, the introduced ill condition validation cases pass, while the old ones do as well. Note 1: This still makes use of the (not so strong) "topological" check of possibly ill conditioned pivots during the observability check, as the full norm of the matrix (including its diagonal) is to be used. This shouldn't be problem once meshed observability is introduced, as it can be made into a standalone routine. Note 2: I will cleanup the PR only after input is received, as this is very much experimental from my side. |
@figueroa1395 if you use relative threshold to raise |
@TonyXiang8787 The norm is only calculated with In short, no. Power flow calculations should not be affected. Note: I just manually checked, and the power flow validation cases never trigger it. |
|
|
This PR aims to improve the pivot perturbation scheme currently used, based on a finer grained criteria.
Before, we would judge if the whole matrix was ill-conditioned (prior to performing the LU decomposition), whereas with this PR we aim to judge the ill-condition on a per pivot basis. Furthermore, because of this we had to use the off diagonal infinite norm of the matrix to judge the pivot's size in order to avoid introducing fake observability, but now, we would be able to use the full infinite norm without having that issue.
In addition, with this PR we aim to resolve the edge cases reported in #1118 (to be solved only once the full observability check is in place, see #1085), as well as make pivot perturbation more robust for radial grids. The scheme used is described in more detail in #1118 (comment).