(beginner) optimize seems to return a wrong result if I specify the objective. #1251
Replies: 1 comment 2 replies
-
Update: after double checking the bode plot actually the second result goes closer to the gain that i expected, but it still remains that there is a negative primal residual and the fact that the two results are different. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @johanlofberg sorry to bother you,
I'm 3 or 4 hours into learning to use Yalmip, I am trying to write a code that calculates L2 gain of a simple example system, just like you showed in the "beginner mistakes" article on the yalmip website (and therefore I feel shit for having to come here).
If I write the problem like so, which means that I don't specify the objective function, it seems to find the right value of the gain.
while if with the same exact problem I specify that i want to minimize t:
diagnostics = optimize(F, t)
the solver returns 0 as if the problem was solved, but the value of the gain is actually wrong, and running the command check(F) I get a negative residual on the LMI:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| ID| Constraint| Primal residual| Dual residual|
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| #1| Matrix inequality| 49.5051| 7.4211e-09|
| #2| Matrix inequality| -2.4496e-10| 9.4479e-11|
| #3| Elementwise inequality| 2500.25| 9.4087e-11|
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thanks for the help!
Beta Was this translation helpful? Give feedback.
All reactions