Skip to content
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

Compute the susceptance matrix in higher precision #863

Closed
wants to merge 10 commits into from

Conversation

odow
Copy link
Collaborator

@odow odow commented Jun 1, 2023

Closes #862

@codecov
Copy link

codecov bot commented Jun 1, 2023

Codecov Report

Merging #863 (174194a) into master (d417de6) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #863   +/-   ##
=======================================
  Coverage   93.79%   93.79%           
=======================================
  Files          43       43           
  Lines        9893     9893           
=======================================
  Hits         9279     9279           
  Misses        614      614           
Impacted Files Coverage Δ
src/core/admittance_matrix.jl 88.23% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d417de6...174194a. Read the comment docs.

@odow
Copy link
Collaborator Author

odow commented Jun 1, 2023

@ccoffrin so it looks like PowerModels is veeeeery sensitive to inv(::ComplexF64). Computing them in BigFloat and then rounding back to Float64 seemed to fix the iteration limit problem on Windows.

@odow
Copy link
Collaborator Author

odow commented Jun 1, 2023

I spoke too soon. Previous commit passed though...

@ccoffrin
Copy link
Member

ccoffrin commented Jun 2, 2023

Thanks a bunch for digging into this. Now that I understand the root cause, I am inclined to relax the test requirements rather than update these operations to big complex operations. When it comes to power systems, performance is the highest priority, so I think the default operations should use whatever Julia type will be most efficient, which I presume is the hardware-native Complex Float type.

If you have any insights into what Julia functions provide the best abstractions for processing Complex numbers (e.g, inv(x) vs 1/x), I happy to consider those changes, if they have the potential for better performance or numerical stability.

@odow
Copy link
Collaborator Author

odow commented Jun 4, 2023

1 / x didn't fix it, which I guess isn't surprising. Should the susceptance matrix always have a det of 0?

It seems problematic if an imprecision of eps in the input data can have a large impact on the output. Maybe there's a check other than the determinant that is more useful?

@ccoffrin
Copy link
Member

ccoffrin commented Jun 4, 2023

You are right, using det as the measure was possibly not the best choice. I was looking for a single value that would be a reasonable signature for the data in the matrix. I am open to suggestion for other measures that would be more robust to numerical issues.

@odow
Copy link
Collaborator Author

odow commented Jun 4, 2023

What about just checking the smallest absolute eigen value?

@odow
Copy link
Collaborator Author

odow commented Jun 5, 2023

Closing in favor of #865

@odow odow closed this Jun 5, 2023
@odow odow deleted the od/numerics branch June 5, 2023 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unravelling the mystery of #861
2 participants