Repository navigation
Support keyword arguments in kalman and lqr with dual numbers - #1106
Conversation
The methods of kalman and lqr for dual-number covariance matrices in the ImplicitDifferentiation extension now accept the keyword arguments `extra` and, for kalman, `direct`. Previously, any keyword argument caused dispatch to the generic method, which does not support dual numbers. The discrete-time kalman method for dual numbers returned the transpose of the Kalman gain; it now returns a matrix of size (nx, ny). Fixes #1105 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
This is an automated message.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1106 +/- ##
==========================================
+ Coverage 92.29% 92.32% +0.02%
==========================================
Files 42 42
Lines 6177 6173 -4
==========================================
- Hits 5701 5699 -2
+ Misses 476 474 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The forward functions of the implicit functions now call arec/ared and return the closed-loop eigenvalues as the non-differentiated byproduct, instead of computing eigvals of the primal closed-loop matrix afterwards. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
This is an automated message.
|
- Remove the dual-number kalman methods. The generic kalman calls the dual-number lqr method, which handles direct, extra and the continuous-time error without duplicated code. - Pass the keyword arguments of are and lqr to arec/ared as a constant argument of the implicit function; previously, keywords such as as = true were ignored. - Return all additional outputs of the Riccati solver with extra = Val(true), so that the number of outputs equals that of the generic methods. - Correct the kalman docstring: with direct = true, p are the eigenvalues of A-AKC. - Compare full Jacobians of K and X with finite differences in the tests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
This is an automated message.
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks @baggepinnen 🙌 |























































Fixes #1105
The methods of
kalmanandlqrspecialized on dual-number covariance matrices in the ImplicitDifferentiation extension accepted no keyword arguments. Any keyword argument (direct,extra) therefore caused dispatch to the generic method, which does not support dual numbers. In addition, the discrete-timekalmanmethod for dual numbers returned the transpose of the gain.Changes:
kalmanmethods are removed. The generickalmancallslqr(...; extra = Val(true)), which dispatches to the dual-numberlqrmethod, sodirect,extraand the continuous-time error fordirect = trueare handled by the generic code, and the gain has size(nx, ny).lqrandaremethods pass their keyword arguments toarec/aredas a constant argument of the implicit function. Previously, keywords such asas = truewere ignored.extra = Val(true), the dual-numberlqrreturns the same outputs as the generic method, including the additional outputs of the Riccati solver. The closed-loop eigenvalues and the additional outputs are the non-differentiated byproduct of the forward Riccati solve;KandXare differentiable.kalmandocstring is corrected: withdirect = true,pare the eigenvalues ofA-AKC, notA-KC.KandXwith finite differences, for continuous and discrete time,direct = false/true,extra = Val(false)/Val(true), andare(...; as = true), including the example from the issue.Positional arguments of the generic methods (the cross term
S) remain unsupported for dual numbers.Host: demeter2, session 5a6c4396-72cd-4580-a020-cb80f89c3346, working directory
~/.julia/dev/ControlSystems🤖 Generated with Claude Code