JuliaControl / JuliaControl/ControlSystems.jl

Problem with singular Q matrix in discrete-time Riccati equations

Open
#297 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
582
Forks
92
Avg merge
1h 12m
Merged PRs (30d)
2

Description

Something like the following has to be solved for discrete-time LQR problems with a penalty on the output signal.

A = randn(2,2)
B = randn(2)
C = [-100 1]
Q = C'*C
dare(A, B, Q, 1)

However this code throws the error Q must be positive semi-definite.

The problem is that Q has a negative eigenvalue that is on the order of -eps(). I believe that this condition is too restrictive and a meaningful solution is found by both MatLab and MatrixEquations.jl for most A and B.

The numerics of RIccati equations might be a bit too much to get into, but this could be another reason to consider using MatrixEquations.jl (note that its ared function use the opposite order of the Q and R arguments).

A quick fix would be to just use something like Q = C'*C + eps()*I

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the discrete-time LQR example with A, B, C, Q, and dare shown in the issue, then inspect how dare validates Q. Compare the behavior with MATLAB and MatrixEquations.jl, accounting for the different argument order noted in the issue. Done means valid semidefinite Q inputs affected only by roundoff are accepted without the suggested eps()*I workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.