Can I create a LQG controller of two appended state space models?

49 Views Asked by At

I have a question? If I have two state space models, sys1 and sys2. Then I append these two models into one model, sys.

Can I then create a LQG, LQR + Kalmanfilter, for sys? I have used Matavecontrol from GitHub to create two state space models and then merge them into one larger state space model.

For example:

sys = append(sys1, sys2)
sys =

A =

   0   1   0   0
  -2  -3   0   0
   0   0   0   1
   0   0  -3  -6

B =

   0   0
   1   0
   0   0
   0   2

C =

   1   0   0   0
   0   1   0   0
   0   0   1   0

D =

   0   0
   0   0
   0   0

delay = 0
type = SS
sampleTime = 0

>> step(sys)
Time assumed to be 10 seconds

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

Here is the answer:

It can be done by creating a LQR gain matrix and a kalman filter for sys.The rank is $n = 4$.

>> sys1 = ss(0, [0 1; -2 -3], [0; 1], [1 0; 0 1])
ans = D matrix assumed to be a zero 2x1 matrix
sys1 =

  scalar structure containing the fields:

A =

   0   1
  -2  -3

B =

   0
   1

C =

   1   0
   0   1

D =

   0
   0

delay = 0
type = SS
sampleTime = 0

>> sys2 = ss(0, [0 1; -3 -6], [0; 2], [1 0])
ans = D matrix assumed to be a zero 1x1 matrix
sys2 =

  scalar structure containing the fields:

A =

   0   1
  -3  -6

B =

   0
   2

C =

   1   0

D = 0
delay = 0
type = SS
sampleTime = 0

>> sys = append(sys1, sys2)
sys =

  scalar structure containing the fields:

A =

   0   1   0   0
  -2  -3   0   0
   0   0   0   1
   0   0  -3  -6

B =

   0   0
   1   0
   0   0
   0   2

C =

   1   0   0   0
   0   1   0   0
   0   0   1   0

D =

   0   0
   0   0
   0   0

delay = 0
type = SS
sampleTime = 0

>> ctrb(sys)
ans =

 0     0     1     0    -3     0     7     0
 1     0    -3     0     7     0   -15     0
 0     0     0     2     0   -12     0    66
 0     2     0   -12     0    66     0  -360

>> rank(ctrb(sys))
ans =  4
>> rank(obsv(sys))
ans =  4
>>