equality-constraint-LQR-compare icon indicating copy to clipboard operation
equality-constraint-LQR-compare copied to clipboard

Fix/laine eq13

Open gchenfc opened this issue 4 years ago • 3 comments

Fixes a mistake in Laine equation 13. Equation 15 gets updated, which changes eq 17&18. See email (below)

Also, added a QP-based solver from matlab's quadprog to serve as a ground-truth.


I think I found a minor error in Laine’s paper.

They say the problem in (11) is the same as the problem in (13), but I don’t think it is exactly the same. I’ve screen-shotted the equations for reference: image image

Basically, they are claiming that image

Or rewritten in a way that’s easier to read: image

Of course this is not true. Therefore I propose that equation 15 should instead read: image

I believe the reason this hasn’t been noticed yet is because in the case where Muut is a multiple of an orthogonal matrix (simple case, consider Muut=identity), then Pyt will cancel with Zwt because the range space and null space are orthogonal. However, if Muut is not orthogonal, then they will not cancel and this term becomes relevant. In Shuo’s experiments, he used u is only 1 dimensional so Muut is a scalar and ZwcPy will cancel. But I did some tests on my own with Muut is different and indeed it gives the incorrect result as compared to Matlab’s quadprog. I added the extra term into Shuo’s code and now it matches with quadprog. I will take a little bit of time to clean up the code before sharing.

This error is not that big of a deal, but I noticed it when I was reimplementing Laine’s paper again and at first I thought I must be missing something, but after many many hours of debugging I discovered actually I think it is a mistake in the paper. Hope you guys agree.

gchenfc avatar Oct 07 '20 20:10 gchenfc

Hello Gerry, @gchenfc ,

I wonder should equation (15) be +MuutPytyt instead of -MuutPytyt?

image

Because if we substitue the control ut by the decomposition, we get

image

Then, we can collect the terms related to w_t

image

Then setting the derivates to zero:

image

Taking the inversion, we finally get the expression for equation (15), but looks like it should be a plus MuutPytyt instead of a minus MuutPytyt? Am I missing something? Thanks so much for your time!

zhonghai1995 avatar Oct 18 '22 07:10 zhonghai1995

@zhonghai1995 Yes I think you're right. Sorry for the late reply, btw.

I think I made a typo in the latex because, in the code, I assigned pystarK as $\textcolor{red}{-}P_y y_t^*$ (notice the minus sign), so then I needed another minus sign in Muut*pystarK and overlooked this when I was typing the latex in this description.

https://github.com/ShuoYangRobotics/equality-constraint-LQR-compare/blob/bce9d81db17894613543c895bcd2591bed0f61d6/ecLQR_laine.m#L107-L111

So, in summary, I think your comment is correct and the code is correct, but I typed my latex wrong since I got confused by my code.

gchenfc avatar Jan 09 '23 20:01 gchenfc

@gchenfc Thanks again!

zhonghai1995 avatar Jan 11 '23 11:01 zhonghai1995