• #### Mapping positive definite matrix through a similarity transformation

From Southern.Cross@21:1/5 to All on Thu May 25 15:17:23 2017
Hello all,

This is my first post on the group. I'm hoping that the group can help me better understand something.

I'm designing a feedback controller with LQR in Matlab. My LTI model (A,B,C,D) is very stiff and the LQR numerics struggle with it (complaining about an ill-conditioned system). So, I chose to balance the system using Matlab's BALREAL. This resolved the
numerical challenge (atleast LQR stopped complaining).

BALREAL returns the similarity transformation matrices to convert between the original state vector 'x' and the newly balanced state vector 'x_b'. That relation is,

x_b = T*x, and
x = Ti*x_b

LQR produces an optimal state-feedback gain matrix that minimizes,

J = Integral {x'*Q*x + u'*R*u + 2*x'*N*u} dt

or, if used with the new system it would be,

J = Integral {x_b'*Q_b*x_b + u'*R*u + 2*x_b'*N*u} dt

(NOTE: I'm not specifying an N matrix...)

where 'u' are the inputs into the system.

Now to my question. The state-space for the original LTI system has physical meaning, where the state-space for the newly balanced system does not. When designing my controllers with LQR I know how to construct my Q & R matrices because of the physical
meaning in the state vector 'x'. However, I lose that intuition when trying to apply LQR to the new balanced system. Meaning, what is the relationship between Q_b and Q?

If we subsitute the definition of 'x_b' into the cost function for the original system we get,

J = Integral {x_b'*Ti'*Q*Ti*x_b + u'*R*u + 2*x'*N*u} dt

To me this means that,

Q_b = Ti'*Q*Ti

Now for the problem... let's assume that I have a fully actuated 2 degree-of-freedom mass-spring-damper with a state vector of,

x = [z1; z2; zdot1; zdot2]

where z1 and z2 are the positions of the masses and zdot1 and zdot2 are their respective rates.

My experience with an LQR based controller design process has been that if I want to control z1 more than z2 and I don't really care about zdot1 and zdot 2 then a good set of Q & R matrices would be,

Q = [a 0 0 0
0 b 0 0
0 0 0 0
0 0 0 0]
R = [1 0
0 1]

chosing the ratio between 'a' and 'b' in defining 'Q' determines how well z1 performs relative to z2. Meaning, if I make 'a' a lot bigger than 'b' then the feedback control law from LQR will allocate more control authority to z1 and assuming the
dynamices between the two DOFs are similar then then response time of z1 will be superior to z2. Correct?

I can construct my Q matrix this way because of the physical intuition of the state-space. I know what states the diagonal elements of Q correspond to and I can penalize them accordingly...

However, I have no intuition to the balanced state-space. I assumed that by using,

Q_b = Ti'*Q*Ti

I would define Q as before leveraging the physical intuition and then transform the penalty matrix appropriately to the balanced state-space and that the resulting performance would have a similar affect... Unfortunately, it didn't seem to behave that
way...

Meaning, for our 2DOF example, if my original output relationship was,

[y1; y2] = [1 0 0 0; 0 1 0 0] * [z1; z2; zdot1; zdot2]

and the corresponding balanced output,

[y1; y2] = [1 0 0 0; 0 1 0 0] * Ti * [z1_b; z2_b; zdot1_b; zdot2_b]

then by I assumed that by using the relationship,

Q_b = Ti'*Q*Ti

that I would be able to control the performance of the y1 output relative to y2 through the newly balanced LTI system when computing the feedback law with LQR. However, the resulting performance did not seem to map to the original state-space as I am
trying to do.

I hope this question makes sense. If is does... is my assumption/expectation wrong? Or, is the Q_b relation not appropriate to use for some reason?

I'm all ears. Thanks.

--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)
• From Tim Wescott@21:1/5 to Southern.Cross on Thu May 25 23:43:49 2017
On Thu, 25 May 2017 15:17:23 -0700, Southern.Cross wrote:

Hello all,

This is my first post on the group. I'm hoping that the group can help
me better understand something.

Unfortunately, I think that this group has petered down to spammers,
lurkers, and me. But I'll do what I can -- there's much more activity on https://www.reddit.com/r/controltheory.

I'm designing a feedback controller with LQR in Matlab.

... and, unfortunately, I'm not an expert in that design method (and I'm
rather cynical about Matlab, but that's me). So, reddit, unless some
lurker speaks up with something useful.

I _know_ that at least one of the guys that hangs out on the subreddit I mentioned can answer your question. I don't know if they'd want to
address one so long, but you can always try.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)
• From Mark@21:1/5 to All on Fri May 26 15:22:53 2017
if you can map from one Q to the other Q_b then I don't see an issue.
Q should be full rank though so your example should have at least a small weighting for the other states (a and b >> c and d).
Q = [a 0 0 0
0 b 0 0
0 0 c 0
0 0 0 d]
R = [1 0
0 1]

--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)