Following the answers provided in a previous Post https://ask.sagemath.org/question/70614/trigonometric-system-of-quadratic-equations/, I tried to apply the proposed methods to a similar trigonometric system of quadratic equations.
$$
\begin{align}
8 r^2 &=((1+\sqrt(3))\cos(\alpha) r+2\cos(\beta)r-\frac{1}{2})^2
+((1+\sqrt(3))\sin(\alpha)r+2 \sin(\beta) r-\frac{1}{2})^2\\
4 r^2 &= (2(1+\sqrt(3))\cos(\alpha)r+2\cos(\beta)r-1)^2+(2(1+\sqrt(3))\sin(\alpha)r+2\sin(\beta)r)^2\\
4 r^2 &= (((1+\sqrt(3))\cos(\alpha)r+2\cos(\beta)r+(1+\sqrt(3))\sin(\alpha)r+2\sin(\beta)r)\frac{1}{2}-\frac{1}{2})^2\\
&+((1-(1+\sqrt(3))\cos(\alpha)r-2\cos(\beta)r
+(1+\sqrt(3))\sin(\alpha)r+2 \sin(\beta)r)\frac{1}{2}-\frac{1}{2})^2
\end{align}
$$
I am interested in finding the minimal polynomial of the root $r$ between 0 and 1 for which a numerical appriximation is $r \approx 0.1225582838364$.
Below is my (unsuccessfull) attempt to use the variety() function to solve this problem
reset()
from time import time as stime
RR.<x, y, r, s0, c0, s1, c1>=AA[]
Sys2 = [ # a
-8*r^2+((1+2*AA(cos(pi/6)))*c0*r+2*c1*r-1/2-x)^2+((1+2*AA(cos(pi/6)))*s0*r+2*s1*r-1/2-y)^2,
# b
-4*r^2+(2*(1+2*AA(cos(pi/6)))*c0*r+2*c1*r-1-x)^2+(2*(1+2*AA(cos(pi/6)))*s0*r+2*s1*r-y)^2,
# eq3
-4*r^2+(((1+2*AA(cos(pi/6)))*c0*r+2*c1*r+(1+2*AA(cos(pi/6)))*s0*r+2*s1*r)/2-1/2)^2+((1-(1+2*AA(cos(pi/6)))*c0*r-
2*c1*r+(1+2*AA(cos(pi/6)))*s0*r+2*s1*r)/2-1/2)^2,
# eq4
-8*r^2+((1+2*AA(cos(pi/6)))*c0*r+2*c1*r-1/2)^2+((1+2*AA(cos(pi/6)))*s0*r+2*s1*r-1/2)^2,
# eq5
-4*r^2+(2*(1+2*AA(cos(pi/6)))*c0*r+2*c1*r-1)^2+(2*(1+2*AA(cos(pi/6)))*s0*r+2*s1*r)^2,
# eq6
-4*r^2 +(-1/2*(1 + 2*AA(cos(pi/6)) * r * (c0 - s0) + r * s1 + r * c1)^2 +(1/2*(r*(-(1+2*AA(cos(pi/6)))) * (s0 + c0) + 2 * s1 -
2 * c1) + 1))^2,
# Basic
s0^2 + c0^2 - 1,
s1^2 + c1^2 - 1]
J1 = RR.ideal(Sys2)
print("Solution dimension = ", J1.dimension())
t0 = stime()
Sols = J1.variety()
t1 = stime()
print("Number of solutions = ", len(Sols), ", found in %f6.3 seconds."%(t1-t0))
Errs = [abs(s[r]-0.1225582838364) for s in Sols]
Sol = Sols[Errs.index(min(Errs))]
t2 = stime()
P = Sol[r].minpoly()
t3 = stime()
print("Minimal polynomial (found in %f6.3 seconds) :"%(t3-t2))
print(P)
Unfortunately there seems to be a crash in the Variety() call and no result is returned. It this because this particular system is more complex than in the different post (one more variable)?
In advance, thanks for your help.
kr,