oxfordcontrol / SOSTOOLS

A free MATLAB toolbox for formulating and solving sums of squares (SOS) optimization programs
51 stars 14 forks source link

findbound gives wrong output #8

Closed mathewsboban242 closed 2 years ago

mathewsboban242 commented 2 years ago

Please see this question I posted on MathSE: https://math.stackexchange.com/questions/4435039/sostools-in-matlab-findbound-gives-wrong-output

djagt commented 2 years ago

Hey Mathews,

Thank you for your message. I noticed someone already offered a solution to your problem, increasing the allowed degree. Indeed, establishing an appropriate degree is often a process of trial and error, as I believe the theory on this matter is somewhat limited. If you are convinced your problem is feasible but are not getting any results, the specified degree is probably too small. You can keep increasing the degree until you are satisfied with the outcome. However, the computational complexity increases with the degree as well, so it also comes down to how much computation time/effort you are willing to spend.

I noticed there are still a few issues with the pvar implementation of the findbound function. We're trying to move away from the syms implementation, as the pvar/dpvar implementation is faster, so I will fix these issues and post an updated version soon.

Let me know if you have any other questions, or encounter any issues!

Declan

djagt commented 2 years ago

Just so you know, the findbound function has been updated to fix the issue with the pvar implementation. You should be able to solve the problem using pvar now as well, calling e.g.

clear; pvar a12 a13 C; eq_expr = -1 -54*a12^2 - 81*a12^4 - 54*a13^2 - 486*a12^2*a13^2 - 81*a13^4 + C*(1 + 6*a12^2 + a12^4 + 6*a13^2 + 6*a12^2*a13^2 + a13^4); deg = 8; solver_opt.solver = 'mosek'; [sol_C, vars, xopt] = findbound(C,[],eq_expr,deg,solver_opt);

or

[sol_C, vars, xopt] = findbound(C,0,eq_expr,deg,solver_opt);

if you prefer.

Let me if know if there are any (other) issues!

Declan