Skip to content

Fix matrix Jacobians and SciPy optimizer behavior - #101

Open
mendax0110 wants to merge 3 commits into
nasa:mainfrom
mendax0110:main
Open

mendax0110 wants to merge 3 commits into
nasa:mainfrom
mendax0110:main

Conversation

@mendax0110

Copy link
Copy Markdown

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.

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

No deployments
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.

1 participant