2
$\begingroup$

I have a linear State Space model and was trying to tell if it was completely controllable. When I get the matrix with ControllabilityMatrix and then calculate the rank I get an incorrect matrix rank that indicates that the system is not completely controllable, but when I run the command with ControllableModelQ it returns True. Why is there discrepancies with the two?

A1 = {{0, 0, 0, Cos[\[Theta]], -Sin[\[Theta]], 0}, {0, 0, 0, 
    Sin[\[Theta]], Cos[\[Theta]], 0}, {0, 0, 0, 0, 0, 1}, {0, 
    0, -9.81*Cos[\[Theta]], -50/10, 0, 0}, {0, 0, 9.81*Sin[\[Theta]], 
    0, -5, 0}, {0, 0, 0, 0, 0, -100/0.1}} /. {\[Theta] -> Pi/2}

B = {{0, 0}, {0, 0}, {0, 0}, {1/10, 0}, {0, 0}, {0, 1/0.1}}

ssm = StateSpaceModel[{A1, B}, SamplingPeriod -> None, 
  SystemsModelLabels -> None]

MatrixRank[ControllabilityMatrix[ssm]]

ControllableModelQ[ssm]
$\endgroup$
2
  • 1
    $\begingroup$ I don't know what controllable means but try MatrixRank[ControllabilityMatrix[ssm], Tolerance -> 0]. $\endgroup$
    – Michael E2
    Dec 1, 2022 at 3:03
  • $\begingroup$ Alternatively, if you use exact numbers throughout (i.e. replace -100/0.1 by -1000, replace 9.81 by 981/100, ...) then ControllabilityMatrix[ssm] has exact entries and MatrixRank returns $6$. $\endgroup$
    – user293787
    Dec 1, 2022 at 16:22

1 Answer 1

1
$\begingroup$

ControllableModelQ can check this 3 different ways. If any one of them is True, it returns True.

AnyTrue[{"Matrix", "Gramian", "PBH"}, 
 Quiet@ControllableModelQ[ssm, Method -> #] &]
(* True *) 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.