-
Notifications
You must be signed in to change notification settings - Fork 7
Verify Branch and Load Jacobians computed with Sparse::Variable #89
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
Conversation
…:Variable in BranchTests.
c6bfc25 to
9a46d05
Compare
1de6f41 to
8265e7a
Compare
3531a77 to
16cad59
Compare
alexander-novo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm misunderstanding, but wasn't the point of Sparse::Variable that we wouldn't have to write these analyticalJacobian functions manually, and would be able to call e.g. LoadTests<Sparse::Variable>::residual() to compute the same thing?
This is exactly what is being done here. See for example, load.evaluateResidual(). The point of the analytical Jacobian is to verify the answer we are getting. For a unit test, we need a reference. |
Co-authored-by: Alexander Novotny <[email protected]>
|
shakedregev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot build this code. Details above.
pelesh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests pass with Clang and GCC builds. Code clean and well commented.
--------- Co-authored-by: Alexander Novotny <[email protected]>
Description
This adds tests for Branch and Load Jacobians.
Proposed changes
Added a Jacobian test for BranchTest and LoadTest. Using Gridkit::Sparse::Variable, we track model residual dependencies and compute the values of the Jacobian. The result is compared to the analytical Jacobian in std::map format. The Jacobians are constant matrices in these cases.
Checklist
-Wall -Wpedantic -Wconversion -Wextra.