![]() | 1 | initial version |
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} $$
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's be clever about this system, so I'll translate it straightforwardly translate it (explcitly) as a polynomial system, adding $\sin^2 x + \cos^2x=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...).
Your approximate solution is not found. But this solution was based on your transformed equations, whose derivation is not clear to me.
Maybe check these derivations ?
HTH,
![]() | 2 | No.2 Revision |
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's be clever about this system, so I'll translate it straightforwardly translate it (explcitly) as a polynomial system, adding $\sin^2 x + \cos^2x=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...).
Your approximate solution is not found. But this solution was based on your transformed equations, whose derivation is not clear to me.
Maybe check these derivations ?
HTH,
![]() | 3 | No.3 Revision |
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 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's be clever about this system, so I'll translate it straightforwardly translate it (explcitly) as a polynomial system, adding $\sin^2 x + \cos^2x=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...).
Your approximate solution is not found. But this solution was based on your transformed equations, whose derivation is not clear to me.
Maybe check these derivations ?
HTH,
![]() | 4 | No.4 Revision |
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's can't be clever about this system, so I'll translate it straightforwardly translate it (explcitly) as a polynomial system, adding $\sin^2 x + \cos^2x=1$ 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...).
Your approximate solution is not found. But this solution was based on your transformed equations, whose derivation is not clear to me.
Maybe check these derivations ?
HTH,
![]() | 5 | No.5 Revision |
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 $\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...).
Your approximate solution is not found. But this solution was based on your transformed equations, whose derivation is not clear to me.
Maybe check these derivations ?
HTH,
![]() | 6 | No.6 Revision |
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...).
Your approximate solution is not found. But this solution was based on your transformed equations, whose derivation is not clear to me.
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.
@rburning'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,
![]() | 7 | No.7 Revision |
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...).
Your approximate solution is not found. But this solution was based on your transformed equations, whose derivation is not clear to me.
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.
@rburning's @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,
![]() | 8 | No.8 Revision |
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...).
Your approximate solution is not found. But this solution was based on your transformed equations, whose derivation is not clear to me.
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 @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,