Fix matrix Jacobians and SciPy optimizer behavior - #101
Open
mendax0110 wants to merge 3 commits into
Open
mendax0110 wants to merge 3 commits into
mendax0110 wants to merge 3 commits into
Conversation
Enable matrix Jacobians and sampled LQR coverage. Correct fixed-time event sensitivities and make SciPy CG reject unsupported bounds and constraints. Signed-off-by: mendax0110 <adrian.goessl@outlook.com>
Signed-off-by: mendax0110 <adrian.goessl@outlook.com>
Signed-off-by: mendax0110 <adrian.goessl@outlook.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the matrix Jacobian ordering in the CasADi backend, corrects fixed-time event sensitivities and makes SciPy CG fail clearly when asked to handle unsupported bounds or constraints. It also updates the bounded time-switch example to use SLSQP.
Changes
Matrix Jacobians:
Support Jacobians with matrix-valued inputs in the CasADi backend. Reorded derivative columns to match Condor’s matrix-input representation (the previously skipped matrix-Jacobian test is now enabled)
Fixed-time event sensitivities:
Include the event function’s time derivative in the event-time sensitivity denominator. This then corrects sensitivities for explicitly timed events while preserving the existing state-triggered event behavior.
SciPy optimizer handling:
Stop passing bounds to SciPy when all variables are unbounded. Raises a clear error if CG is selected for a problem with variable bounds or constraints.
Examples and coverage:
Change the bounded time-switch example to use SLSQP. Added sampled-LQR coverage that optimizes the gain and checks it against the discrete algebraic Riccati solution.
Implementation ifc:
Aligns the SciPy construct method signature with the base class and clarify how exact_hessian is handled.