# Trigonometric System of Quadratic Equations

Given the system of equations below with variables x, y, beta and r, my goal is to eliminate x, y and beta in order to have a polynomial equation which admits r as one of its roots.

$$4r^2 = \left(\cos(\beta)+2\cos\left(-\frac{7\pi}{12}\right)\right)^2 r^2+\left(\frac{1}{2}+\left(\sin(\beta)+2\sin\left(\frac{-7\pi}{12}\right)\right)r\right)^2$$

$$4r^2 = \left(\frac{1}{2}-2\cos\left(\frac{-7\pi}{12}\right)r-x\right)^2+\left(-2\sin\left(\frac{-7\pi}{12}\right)r-y\right)^2$$

$$4r^2 = \left(\frac{1}{2}-\cos(\beta)r-2\cos\left(\frac{5\pi}{12}\right)r-x\right)^2+\left(\frac{1}{2}-\sin(\beta)r-2\sin\left(\frac{5\pi}{12}\right)r-y\right)^2$$

$$16r^2 = \left(x+1/2-2\cos\left(\frac{\pi}{12}\right)r\right)^2+\left(y-2\sin\left(\frac{\pi}{12}\right)r\right)^2$$

I tried to successively use solve in sage:

var('beta, r, x, y')
a = (x+1/2-cos(pi/12)*2*r)^2+(y-sin(pi/12)*2*r)^2-(1/2-cos(pi/12)*r*2-x)^2-(-sin(pi/12)*r*2-y)^2-12*r^2
a = a.full_simplify()
show(a)
b = (1/2-cos(pi/12)*r*2-x)^2+(-sin(pi/12)*r*2-y)^2-((1/2-cos(beta)*r-2*cos(5*pi/12)*r-x)^2+(1/2-sin(beta)*r-
2*sin(5*pi/12)*r-y)^2)
b = b.full_simplify()
show(b)
eq1 = a==0
eq2 = b==0
sol=solve([eq1, eq2], x, y)
show(sol)
eq3 = (1/2-cos(pi/12)*r*2-sol[0][0].rhs())^2+(-sin(pi/12)*r*2-sol[0][1].rhs())^2-4*r^2==0
eq4 = ((cos(beta)+2*cos(-7*pi/12))*r)^2+(1/2+(sin(beta)+2*sin(-7*pi/12))*r)^2-4*r^2==0
show(eq3)
show(eq4)
sol=solve([eq4], r)
show(sol[0].rhs().full_simplify())
f(beta) = sol[0].rhs()
show(f(-0.42806907644466885).n())
eq5 = sol[0]
show(eq5)
sol=solve([eq4], cos(beta))
show(sol)
f(beta, r) = sol[1].rhs()
show(f(-0.42806907644466885, 0.11605914696138518).n())
eq6 = sol[1]
show(eq6)
sol = solve([eq3, eq6], r)
show(sol)


Sadly however I am left with two equations in r and beta. I cannot seem to find a way to perform the final step of eliminating beta. I suppose this is due to the fact that beta appears as an argument of trigonometric functions.

$$4 r^{2} = \frac{1}{16} {\left(2 r {\left(\sqrt{6} + \sqrt{2}\right)} - \frac{4 {\left(\sqrt{6} {\left(2 \sqrt{2} \cos\left(\beta\right) - 1\right)} + 13 \, \sqrt{2} - 8 \cos\left(\beta\right) + 8 \sin\left(\beta\right)\right)} r^{3} - 4 {\left(\sqrt{6} {\left(\sqrt{2} - \cos\left(\beta\right) - \sin\left(\beta\right)\right)} + \sqrt{2} {\left(\cos\left(\beta\right) + \sin\left(\beta\right)\right)} + 2\right)} r^{2} - r {\left(\sqrt{6} - \sqrt{2}\right)}}{2 {\left(\sqrt{6} {\left(2 \sqrt{2} - \cos\left(\beta\right) + \sin\left(\beta\right)\right)} + \sqrt{2} {\left(\cos\left(\beta\right) + \sin\left(\beta\right)\right)}\right)} r^{2} - r {\left(\sqrt{6} + 3 \sqrt{2} + 2 \, \sin\left(\beta\right)\right)} + 1} - 2\right)}^{2} + \frac{1}{16} {\left(2 r {\left(\sqrt{6} - \sqrt{2}\right)} - \frac{4 {\left(\sqrt{6} {\left(2 \, \sqrt{2} \sin\left(\beta\right) + 1\right)} + 13 \sqrt{2} - 8 \cos\left(\beta\right) + 8 \sin\left(\beta\right)\right)} r^{3} - 4 {\left(2 \sqrt{6} {\left(\cos\left(\beta\right) + \sin\left(\beta\right)\right)} + 2 \sqrt{2} \sin\left(\beta\right) + 3\right)} r^{2} + r {\left(3 \sqrt{6} - \sqrt{2} + 4 \cos\left(\beta\right) + 4 \, \sin\left(\beta\right)\right)} - 1}{2 {\left(\sqrt{6} {\left(2 \sqrt{2} - \cos\left(\beta\right) + \sin\left(\beta\right)\right)} + \sqrt{2} {\left(\cos\left(\beta\right) + \sin\left(\beta\right)\right)}\right)} r^{2} - r {\left(\sqrt{6} + 3 \, \sqrt{2} + 2 \sin\left(\beta\right)\right)} + 1}\right)}^{2}$$ $$r = -\frac{\sqrt{6} + \sqrt{2} - \sqrt{4 \, {\left(\sqrt{6} - \sqrt{2}\right)} \cos\left(\beta\right) - 4 \, \cos\left(\beta\right)^{2} + 2 \, \sqrt{6} \sqrt{2} + 8} - 2 \, \sin\left(\beta\right)}{4 \, {\left({\left(\sqrt{6} - \sqrt{2}\right)} \cos\left(\beta\right) - \cos\left(\beta\right)^{2} + {\left(\sqrt{6} + \sqrt{2}\right)} \sin\left(\beta\right) - \sin\left(\beta\right)^{2}\right)}}$$

I know the approximate numerical solutions are as follows:

x= 0.17943518672220243 y= 0.15109739303031233 beta= -0.42806907644466885 r= 0.11605914696138518

Any idea how to perform the last step, eliminate the variable beta and obtain a minimum polynomial for r?

edit retag close merge delete

Sort by » oldest newest most voted

Here is a different approach, not necessarily optimal but working:

R.<c1, c2, x, y, cos_beta, sin_beta, r> = PolynomialRing(QQ, order='lex')
C1 = cos(pi/12)
C2 = sin(pi/12)
a = (x+1/2-c1*2*r)^2+(y-c2*2*r)^2-(1/2-c1*r*2-x)^2-(-c2*r*2-y)^2-12*r^2
b = (1/2-c1*r*2-x)^2+(-c2*r*2-y)^2-((1/2-cos_beta*r-2*c2*r-x)^2+(1/2-sin_beta*r-2*c1*r-y)^2)
eq1 = a
eq2 = b
eq3 = (1/2-c1*r*2-x)^2+(-c2*r*2-y)^2-4*r^2
eq4 = ((cos_beta+2*-c2)*r)^2+(1/2+(sin_beta+2*-c1)*r)^2-4*r^2
I = R.ideal(eq1, eq2, eq3, eq4, AA(C1).minpoly()(c1), AA(C2).minpoly()(c2), c1^2 + c2^2 - 1, cos_beta^2 + sin_beta^2 - 1)
f_r = I.groebner_basis()[-1].polynomial(r).change_ring(QQ)


It takes some time to run, but in the end we get:

sage: f_r
r^128 - 48766335875856860/766928779123441*r^126 + 79954995549940293938521705645943567/75287008287714784234536407101568*r^124 - 290725032542122005235760772146876579/37643504143857392117268203550784*r^122 + 1196801299027237075935922001243116569299/38546948243309969528082640436002816*r^120 - 755345391601097085106494072200093736535/9636737060827492382020660109000704*r^118 + 664650284248022749468085712501512379890199/4934009375143676099594577975808360448*r^116 - 51453904419963463327264076564505766083983/308375585946479756224661123488022528*r^114 + 392449107043381637540867119192730057199334609/2526212800073562162992423923613880549376*r^112 - 8854566905395615087865086150442453503655825/78944150002298817593513247612933767168*r^110 + 1297907107225784073932361531250222238508377999/20209702400588497303939391388911044395008*r^108 - 37389679701021766661981098030295328240086451/1263106400036781081496211961806940274688*r^106 + 7160639601057108487250953116501681890039986187/646710476818831913726060524445153420640256*r^104 - 272113580977059871396062502484608423051469323/80838809602353989215757565555644177580032*r^102 + 2141942496850791409555495018202107306896174251/2586841907275327654904242097780613682561024*r^100 - 105723952638397808110678978888956475227008699/646710476818831913726060524445153420640256*r^98 + 72377713552578633949516733537808957089923635/2806065797722389320574093123016258909896704*r^96 - 3117826412948927187975386657363311437307945/940669784463755510874269853738404975476736*r^94 + 249504789874974919020829835599292856265787497/662231528262483879655485977031837102735622144*r^92 - 14595106525351343268813393368034523125925771/331115764131241939827742988515918551367811072*r^90 + 237117551596221040234306347005185544161064599/42382817808798968297951102530037574575079817216*r^88 - 899189887919052364055030945611144381020441/1324463056524967759310971954063674205471244288*r^86 + 24369515763542167728060690096064971434797407/339062542470391746383608820240300596600638537728*r^84 - 148199655615198397383748141315466232031843/21191408904399484148975551265018787287539908608*r^82 + 7652688975139735750236438777670244164486883/10850001359052535884275482247689619091220433207296*r^80 - 425905476997177962180948719167091344309/5746822753735453328535742715937298247468449792*r^78 + 318506791726417004994131086677025970289011/43400005436210143537101928990758476364881732829184*r^76 - 202469491499262572296214974611685973055/305633841100071433359872739371538565949871357952*r^74 + 80801412962943192234259873735828702968015/1388800173958724593187261727704271243676215450533888*r^72 - 1834887946967812671456566424988592123701/347200043489681148296815431926067810919053862633472*r^70 + 1334124551686783920122554687943917798809/2777600347917449186374523455408542487352430901067776*r^68 - 228040360430600710382124273274532610361/5555200695834898372749046910817084974704861802135552*r^66 + 1166624981825446576805183622919095923467/355532844533433495855939002292293438381111155336675328*r^64 - 22831338781422876020809555792869109115/88883211133358373963984750573073359595277788834168832*r^62 + 14512294705124964454176264072630612929/711065689066866991711878004584586876762222310673350656*r^60 - 2300609295850357076190282070794619407/1422131378133733983423756009169173753524444621346701312*r^58 + 11185368809050490354831907764079482535/91016408200558974939120384586827120225564455766188883968*r^56 - 200000792452492922675133326533497179/22754102050139743734780096146706780056391113941547220992*r^54 + 436555149314550239845030933945582713/728131265604471799512963076694616961804515646129511071744*r^52 - 14577659161552172538770624665036241/364065632802235899756481538347308480902257823064755535872*r^50 + 123777516295727263609227218034372451/46600400998686195168829636908455485555489001352288708591616*r^48 - 91653545501615900802587531325949/529550011348706763282154964868812335857829560821462597632*r^46 + 4018603281151353429931432873716639/372803207989489561350637095267643884443912010818309668732928*r^44 - 58237964340792255656045141933291/93200801997372390337659273816910971110978002704577417183232*r^42 + 395243543827607798808971899457511/11929702655663665963220387048564604302205184346185909399453696*r^40 - 593709629024402611272347908561/372803207989489561350637095267643884443912010818309668732928*r^38 + 3300166469411423921954266169469/47718810622654663852881548194258417208820737384743637597814784*r^36 - 64677586072966225413780125253/23859405311327331926440774097129208604410368692371818798907392*r^34 + 292881210473776331166875862081/3054003879849898486584419084432538701364527192623592806260146176*r^32 - 1168903015630081425296590043/381750484981237310823052385554067337670565899077949100782518272*r^30 + 1077226175750298788236369903/12216015519399593946337676337730154805458108770494371225040584704*r^28 - 6986385339477675211096277/3054003879849898486584419084432538701364527192623592806260146176*r^26 + 41703452418003996795480027/781824993241574012565611285614729907549318961311639758402597421056*r^24 - 108916621385451362896269/97728124155196751570701410701841238443664870163954969800324677632*r^22 + 129985147829525945030631/6254599945932592100524890284917839260394551690493118067220779368448*r^20 - 538159027852673546799/1563649986483148025131222571229459815098637922623279516805194842112*r^18 + 1006775360906867598417/200147198269842947216796489117370856332625654095779778151064939790336*r^16 - 1609927101579435109/25018399783730368402099561139671357041578206761972472268883117473792*r^14 + 285191187842448205/400294396539685894433592978234741712665251308191559556302129879580672*r^12 - 672301198878707/100073599134921473608398244558685428166312827047889889075532469895168*r^10 + 168698027730099/3202355172317487155468743825877933701322010465532476450417039036645376*r^8 - 132417102775/400294396539685894433592978234741712665251308191559556302129879580672*r^6 + 9993638125/6404710344634974310937487651755867402644020931064952900834078073290752*r^4 - 3921875/800588793079371788867185956469483425330502616383119112604259759161344*r^2 + 390625/51237682757079794487499901214046939221152167448519623206672624586326016


Factored:

sage: f_r.factor()
(r^32 - 13093/242*r^30 + 1918905151/3748096*r^28 - 5904092977/7496192*r^26 + 169815443665/959512576*r^24 - 12225373025/959512576*r^22 - 9336381/1919025152*r^20 + 152904847/7676100608*r^18 + 490815603/122817609728*r^16 - 4036823/5582618624*r^14 + 53313617/982540877824*r^12 - 4016713/1965081755648*r^10 + 270819/5716601470976*r^8 - 56451/62882616180736*r^6 + 3083/251530464722944*r^4 - 27/251530464722944*r^2 + 1/1006121858891776) * (r^32 - 33398/5041*r^30 + 5876439811/406586896*r^28 - 663235993/50823362*r^26 + 39334511659/6505390336*r^24 - 4714907137/3252695168*r^22 + 10731590793/104086245376*r^20 + 52193423/6505390336*r^18 + 22158771/13010780672*r^16 - 28083503/208172490752*r^14 - 34690087/26646078816256*r^12 - 2801773/13323039408128*r^10 + 25065867/426337261060096*r^8 - 91551/26646078816256*r^6 + 621971/6821396176961536*r^4 - 3975/3410698088480768*r^2 + 625/109142338831384576) * (r^32 - 13915/6962*r^30 + 4470491743/3102044416*r^28 - 2723146007/6204088832*r^26 + 38782249345/794123370496*r^24 - 1124280515/794123370496*r^22 + 153531079/1588246740992*r^20 - 142586385/6352986963968*r^18 + 247829459/101647791423488*r^16 - 1198335/6352986963968*r^14 + 9320217/813182331387904*r^12 - 853845/1626364662775808*r^10 + 952913/52043669208825856*r^8 - 26757/52043669208825856*r^6 + 2427/208174676835303424*r^4 - 37/208174676835303424*r^2 + 1/832698707341213696) * (r^32 - 310358/361201*r^30 + 865864865371/2087458598416*r^28 - 37393576973/260932324802*r^26 + 971479915699/33399337574656*r^24 - 50555503273/16699668787328*r^22 + 64193415569/534389401194496*r^20 + 7503021/8349834393664*r^18 + 258279745/534389401194496*r^16 - 140857965/1068778802388992*r^14 + 1691819649/136803686705790976*r^12 - 46435605/68401843352895488*r^10 + 57457715/2188858987292655616*r^8 - 105501/136803686705790976*r^6 + 566859/35021743796682489856*r^4 - 3575/17510871898341244928*r^2 + 625/560347900746919837696)


Approximate root:

sage: f_r(0.11605914696138518)
2.701438222952822e-81


Identifying the exact root and its minimal polynomial:

sage: exact_root = next(r for r in f_r.roots(AA, multiplicities=False) if abs(r-0.11605914696138518) < 10e-16)
sage: exact_root.minpoly()
x^32 - 33398/5041*x^30 + 5876439811/406586896*x^28 - 663235993/50823362*x^26 + 39334511659/6505390336*x^24 - 4714907137/3252695168*x^22 + 10731590793/104086245376*x^20 + 52193423/6505390336*x^18 + 22158771/13010780672*x^16 - 28083503/208172490752*x^14 - 34690087/26646078816256*x^12 - 2801773/13323039408128*x^10 + 25065867/426337261060096*x^8 - 91551/26646078816256*x^6 + 621971/6821396176961536*x^4 - 3975/3410698088480768*x^2 + 625/109142338831384576

more

1

Amazing... Thank you so much!!!

( 2023-07-22 12:39:40 +0200 )edit

Thanks for answering this post last time. I now have a similar post at this link https://ask.sagemath.org/question/726..., since with I am still not able to reproduce your results with another slightly more complex system of equations. If by any chance you had some idea I d be very greatful. Tx in advance

( 2023-08-17 15:15:50 +0200 )edit

Hi Ricardo, Truly sorry to solicit your attention again. I once again have a similar question but this time I believe much harder. Would you mind having a look at it? https://ask.sagemath.org/question/741... That would be awesome.

Cheers,

c.

( 2023-11-06 16:46:02 +0200 )edit

I don't see how you derive a, b, eq3 and eq4 from your original equations which are, as far as I can tell :

begin{align} 4r^2 &= \left(\cos(beta)+2\cos\left(-\frac{7\pi}{12}\right)\right)^2 r^2+\left(\frac{1}{2}+\left(\sin(beta)+2\sin\left(\frac{-7\pi}{12}\right)\right)r\right)^2\\ 4r^2 &= \left(\frac{1}{2}-2\cos\left(\frac{-7\pi}{12}\right)r-x\right)^2+\left(-2\sin\left(\frac{-7\pi}{12}\right)r-y\right)^2\\ 4r^2 &= \left(\frac{1}{2}-\cos(beta)r-2\cos\left(\frac{5\pi}{12}\right)r-x\right)^2+\left(\frac{1}{2}-\sin(beta)r-2\sin\left(\frac{5\pi}{12}\right)r-y\right)^2\\ 16 r^2 &= \left(x+1/2-2\cos\left(\frac{\pi}{12}\right)r\right)^2+\left(y-2\sin\left(\frac{\pi}{12}\right)r\right)^2 \end{align}

EDIT : The LaTeX code above appears correctly in the site's editor, but do not appear correctly when the answer is validated. Sorry...

Translating (by hand) these ORIGINAL equations from LaTeX to Sage gives :

sage: x, y, r, beta = var("x, y, r, beta")
sage: Sys0 = [4*r^2 == (cos(beta)+2*cos(-7*pi/12))^2*r^2+(1/2+(sin(beta)+2*sin(-7*pi/12))*r)^2,
....:         4*r^2 == (1/2-2*cos(-7*pi/12)*r-x)^2+(-2*sin(-7*pi/12)*r-y)^2,
....:         4*r^2 == (1/2-cos(beta)*r-2*cos(5*pi/12)*r-x)^2+(1/2-sin(beta)*r-2*sin(5*pi/12)*r-y)^2,
....:         16*r^2 == (x+1/2-2*cos(pi/12)*r)^2+(y-2*sin(pi/12)*r)^2]; Sys0
[4*r^2 == 1/4*r^2*(sqrt(6) - sqrt(2) - 2*cos(beta))^2 + 1/4*(r*(sqrt(6) + sqrt(2) - 2*sin(beta)) - 1)^2,
4*r^2 == 1/4*(r*(sqrt(6) + sqrt(2)) - 2*y)^2 + 1/4*(r*(sqrt(6) - sqrt(2)) - 2*x + 1)^2,
4*r^2 == 1/4*(r*(sqrt(6) + sqrt(2)) + 2*r*sin(beta) + 2*y - 1)^2 + 1/4*(r*(sqrt(6) - sqrt(2)) + 2*r*cos(beta) + 2*x - 1)^2,
16*r^2 == 1/4*(r*(sqrt(6) + sqrt(2)) - 2*x - 1)^2 + 1/4*(r*(sqrt(6) - sqrt(2)) - 2*y)^2]


I can't be clever about this system, so I'll straightforwardly translate it (explcitly) as a polynomial system, adding $\sin^2{beta} + \cos^2{beta} =1$ as a fifth equation. I suppose that you are interested in real solutions :

sage: RR.<px, py, pr, ps, pc>=AA[]
sage: Sys1 = [RR((u.lhs()-u.rhs()).subs({x:px, y:py, r:pr, sin(beta):ps, cos(beta):pc})) for u in Sys0] + [ps^2+pc^2-1] ; Sys1
[-pr^2*ps^2 - pr^2*pc^2 + 3.863703305156273?*pr^2*ps + 1.035276180410083?*pr^2*pc - pr*ps + 1.931851652578137?*pr - 1/4,
-px^2 - py^2 + 1.035276180410083?*px*pr + 3.863703305156273?*py*pr + px - 0.5176380902050415?*pr - 1/4,
-pr^2*ps^2 - pr^2*pc^2 - 2*py*pr*ps - 3.863703305156273?*pr^2*ps - 2*px*pr*pc - 1.035276180410083?*pr^2*pc - px^2 - py^2 - 1.035276180410083?*px*pr - 3.863703305156273?*py*pr + pr*ps + pr*pc + px + py + 2.449489742783178?*pr - 1/2,
-px^2 - py^2 + 3.863703305156273?*px*pr + 1.035276180410083?*py*pr + 12.00000000000000?*pr^2 - px + 1.931851652578137?*pr - 1/4,
ps^2 + pc^2 - 1]


Getting solutions is straightforward

sage: %time J1 = RR.ideal(Sys1)
CPU times: user 275 µs, sys: 32 µs, total: 307 µs
Wall time: 311 µs
sage: %time J1.dimension()
CPU times: user 171 ms, sys: 3.8 ms, total: 175 ms
Wall time: 175 ms
0


There is a finite number of discrete solutions, hence we can get explicit solutions directly :

sage: %time Sols=J1.variety()
CPU times: user 35.4 s, sys: 32.7 ms, total: 35.5 s
Wall time: 35.5 s


This explicit computation needs time, indeed...

sage: len(Sols)
2
sage: Sols
[{pc: -0.9795113217939650?, ps: -0.2013891021814229?, pr: 0.1445361712302778?, py: 0.3410301564303419?, px: 0.2924300597940488?},
{pc: 0.7803658846130199?, ps: 0.6253231853466966?, pr: 0.1520127908172118?, py: 0.4152908622716472?, px: 0.3000498775196634?}]


These solutions check numerically :

sage: [[((v:=u.subs({x:s[px], y:s[py], r:s[pr], sin(beta):s[ps], cos(beta):s[pc]})).lhs()-v.rhs()).n(digits=30) for u in Sys0] for s in Sols]
[[-1.84889274661174641893373882488e-32,
1.04000216996910736065022808900e-32,
2.00296714216272528717821706029e-32,
-4.93038065763132378382330353302e-32],
[0.000000000000000000000000000000,
0.000000000000000000000000000000,
-2.59504013678489505919191027936e-32,
-4.93038065763132378382330353302e-32]]


But a formal check seems difficult : sage: [[((v:=u.subs({x:s[px], y:s[py], r:s[pr], sin(beta):s[ps], cos(beta):s[pc]})).lhs()-v.rhs()).is_zero() for u in Sys0] for s in Sols] "never" returns (meaning that I abported after about 5 minutes...).

Maybe check these derivations ?

EDIT : I confirm that this algorithm, applied to ypur derivarions of a, b, eq3, eq4 and the basic trigonometruic identity, finds the root for which you gave an approximate solution. After running :

reset()
from time import time as stime
RR.<x, y, r, s, c>=AA[]
Sys2 = [ # a
(x + 1/2 - AA(cos(pi/12))*2*r)^2 + (y -AA(sin(pi/12))*2*r)^2 -
(1/2-AA(cos(pi/12))*r*2-x)^2-(-sin(pi/12)*r*2-y)^2-12*r^2,
# b
(1/2 - AA(cos(pi/12))*r*2 - x)^2 + (-AA(sin(pi/12))*r*2 - y)^2 -
((1/2 - c*r - 2*AA(cos(5*pi/12))*r - x)^2 +
(1/2 -s*r -2*AA(sin(5*pi/12))*r - y)^2),
# eq3
(1/2 - AA(cos(pi/12))*r*2 - x)^2 + (AA(-sin(pi/12))*r*2 -y)^2 - 4*r^2,
# eq4
((c + 2*AA(cos(-7*pi/12)))*r)^2 + (1/2+(s + 2*AA(sin(-7*pi/12)))*r)^2 -
4*r^2,
# Basic
s^2 + c^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.11605914696138518) 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)


I get :

Solution dimension =  0
Number of solutions =  8 , found in 16.5647516.3 seconds.
Minimal polynomial (found in 0.9911016.3 seconds) :
x^32 - 33398/5041*x^30 + 5876439811/406586896*x^28 - 663235993/50823362*x^26 + 39334511659/6505390336*x^24 - 4714907137/3252695168*x^22 + 10731590793/104086245376*x^20 + 52193423/6505390336*x^18 + 22158771/13010780672*x^16 - 28083503/208172490752*x^14 - 34690087/26646078816256*x^12 - 2801773/13323039408128*x^10 + 25065867/426337261060096*x^8 - 91551/26646078816256*x^6 + 621971/6821396176961536*x^4 - 3975/3410698088480768*x^2 + 625/109142338831384576


12 of the 32 roots of this polynomial are real.

@rburing's solution gives the same result. Therefore, the solution is correct, buut applied to a set of equations not equivalent to the original ones...

Again, check those derivations...

HTH,

more

Thank you so much for your answer! I was able to reproduce your results. However, when trying to replicate your solution to another slightly more complex system, it does not seem to work anymore. (see post https://ask.sagemath.org/question/726...). It is a very symilar system, however with one more unknown angle variable. Any idea why this no longer works? In advance thanks for your help. kr,

c.

( 2023-08-16 18:21:21 +0200 )edit