Closed IzicTemi closed 2 years ago
The following codes fix your error:
@polyvar x[1:15]
f = x[14] + x[15]
g_1 = 2.0*x[2]^2*x[13] + 2*x[1]*x[2]*x[9] + x[4]*x[9]*x[14]^2 - 4*x[1]*x[4]^2*x[6]*x[9] - 4*x[2]*x[4]^2*x[9]*x[10] + x[4]*x[5]*x[9]*x[14]^2 + 2*x[4]^2*x[6]*x[9]*x[14] - 4*x[1]*x[4]^2*x[5]*x[9]^2 + 2*x[4]^2*x[5]*x[9]^2*x[14] - 2*x[1]*x[3]*x[7]*x[9] - 2*x[2]*x[3]*x[7]*x[13] - 2*x[2]*x[4]*x[6]*x[13] - 2*x[2]*x[4]*x[9]*x[10] - 2*x[1]*x[4]*x[9]*x[14] - 2*x[2]*x[4]*x[9]*x[14] - 4*x[1]*x[4]^2*x[5]^2*x[9]^2 + 2*x[4]^2*x[5]^2*x[9]^2*x[14] + 4*x[1]*x[3]*x[4]*x[7]*x[9] + 4*x[2]*x[3]*x[4]*x[9]*x[11] - 2*x[1]*x[4]*x[5]*x[9]*x[14] + 2*x[3]*x[4]*x[6]*x[7]*x[13] + 2*x[3]*x[4]*x[7]*x[9]*x[10] - 2*x[2]*x[4]*x[5]*x[9]*x[14] - 2*x[3]*x[4]*x[9]*x[11]*x[14] - 4*x[3]*x[4]^2*x[5]^2*x[9]^2*x[11] - 4*x[1]*x[4]^2*x[5]*x[6]*x[9] - 4*x[2]*x[4]^2*x[5]*x[9]*x[10] - 4*x[2]*x[4]^2*x[5]*x[9]*x[13] - 4*x[3]*x[4]^2*x[6]*x[9]*x[11] + 4*x[3]*x[4]^2*x[7]*x[9]*x[10] + 2*x[4]^2*x[5]*x[6]*x[9]*x[14] - 4*x[3]*x[4]^2*x[5]*x[9]^2*x[11] - 4*x[2]*x[4]^2*x[5]^2*x[9]*x[13] + 4*x[3]*x[4]^2*x[5]^2*x[7]*x[9]*x[13] + 4*x[1]*x[3]*x[4]*x[5]*x[7]*x[9] + 4*x[2]*x[3]*x[4]*x[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- x[4]*x[10])^2 + 2*x[4]*x[9]*(x[3]*x[7] - x[4]*x[6]) + 2*x[4]*x[13]*(x[3]*x[11] - x[4]*x[10])
pop = [f, g_1, g_2, g_3, g_4, g_5, g_6, g_7, g_8, g_9, g_10, g_11, g_12, g_13, g_14, g_15, g_16]
d = 6
opt,sol,data = cs_tssos_first(pop, x, d, numeq=7, TS="MD")
Note that I have removed some redundant constraints from the POP. Also, the relaxation order d is set to the minimal value 6 (half of the degree).
I had to to make a few formatting changes, but it works. Thank you very much. Could you please highlight what exactly was wrong so as to avoid it in the future?
Computing Groebner basis needs polynomials with float coefficients. So I just replace 2 with 2.0 for the leading coefficient of g_1.
Here's the code I ran
And here's the error I got: