-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
implement lqr design in c++ #1180
Comments
I found some good references on various algorithms for solving ricatti equations. http://www.engr.iupui.edu/~skoskie/ECE684/Riccati_algorithms.pdf I got a prototype of the matrix sign function method working in matlab on Friday. The LQR cost-to-go computed matches matlab's LQR function. If you think it would be worth the cycles to push this to C++ to give us some baseline LQR functionality outside of MATLAB, you can assign this to me. |
State-of-the-art implementations of ARE solvers use a Schur decomposition method. This is what MATLAB is using (SciPy, Octave, and LAPACK also it). The Schur method has superior numerical stability compared to other approaches such as the Matrix Sign function method. I've looked into what it would take to implement a Schur-based ARE solver using Eigen in c++ and here's what I've found: Eigen includes a Schur factorization but in order for it to be usable for solving the LQR ARE, the eigenvalues of the quasi-triangular Schur matrix need to be sorted such that all of the eigenvalues of the stable subspace appear in the upper left block. MATLAB provides a function Research on the subject of reordering the eigenvalues of the Schur matrix is available( http://web.cs.ucdavis.edu/~bai/publications/baidemmel93.pdf ). The dominant approach is to solve a Sylvester equation for each pair of eigenvalues that need to be swapped during the sort and then use a chain of concatenated Givens rotations to yield the modified orthogonal matrix of the Schur decomposition. Eigen has Givens rotations ( http://eigen.tuxfamily.org/dox/classEigen_1_1JacobiRotation.html ) but doesn't appear to have a Sylvester solver yet. It looks like they had it on their radar at one point but the effort may have been abandoned. ( http://eigen.tuxfamily.org/bz/show_bug.cgi?id=840 ) |
Work around an undefined-behavior sanitizer runtime failure in PETSc, "applying zero offset to null pointer", by adjusting the logic for the case when no bytes are allocated. Reported as https://gitlab.com/petsc/petsc/-/issues/1180.
Looks like there is some good code available for solving the ARE. a quick search turned up
http://slicot.org/objects/software/shared/libindex.html#S
and for large sparse problems:
http://www.netlib.org/lyapack/README
there may be more. if people have known solutions they would recommend, I'd love to hear them.
The text was updated successfully, but these errors were encountered: