-
Notifications
You must be signed in to change notification settings - Fork 68
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
Refinement update #379
Refinement update #379
Conversation
…anscription refinement works now
self.declare_partials(of='x0_dot', wrt='x4', rows=r, cols=c, val=0.0) | ||
self.declare_partials(of='x0_dot', wrt='x5', rows=r, cols=c, val=0.0) | ||
self.declare_partials(of='x0_dot', wrt='u0', rows=r, cols=c, val=0.0) | ||
self.declare_partials(of='x0_dot', wrt='u1', rows=r, cols=c, val=0.0) |
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.
For derivatives that are 0.0, it is more efficient to just not declare them at all.
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.
Fixed that but why is that the case? Is it a coloring issue?
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.
When you define it, it creates an entry in the jacobian dictionary that is an r x c arrary of zeros, and it performs a matrix vector product when derivatives are computed because it sees 0,0 as just another number that needs to be multiplied. If you don't declare it, then no entry is even created for it, so it does nothing for that input/output pair.
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.
Makes sense. Thanks!
…functions to write error and refinement. Also made hp-method default refinement scheme
Summary
Added hp refinement based on "Adaptive mesh refinement method for optimal control using non-smoothness detection and mesh size reduction" by Liu, Hager, and Rao as new refinement scheme.
New scheme allows for detection of where the problem is non-smooth and splits segments rather than simply raise order.
This algorithm is also more efficient in that it also eliminates unnecessary segments and reduces segment order in each iteration so re-solving the problem is less expensive.
Related Issues
Status
Backwards incompatibilities
None
New Dependencies
None