-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: develop
Are you sure you want to change the base?
Conversation
…:Variable in BranchTests.
c6bfc25
to
9a46d05
Compare
1de6f41
to
8265e7a
Compare
3531a77
to
16cad59
Compare
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]>
|
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.
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
.