Ask Your Question

cyrille's profile - activity

2018-02-09 05:19:29 +0200 received badge  Notable Question (source)
2017-06-04 16:00:01 +0200 received badge  Popular Question (source)
2016-02-27 23:12:54 +0200 received badge  Editor (source)
2016-02-27 08:55:33 +0200 asked a question Solving a system of equations using mpmath.findroot

Hi All,

A few weeks ago, the code below, which was designed to compute some points was working perfectly. After compiling it a few days ago, I got : ValueError: Could not find root within given tolerance. (7235.55 > 2.1684e-19) Try another starting point or tweak arguments.

Please I will be very pleased if someone could help me solve this problem. Thanks for your understanding

 import mpmath
 theta=pi/12

p1=vector([0,0,0])
p2=vector([-12,0,0])
p3=vector([1/24,-17/24*sqrt(287),0])

#Calcul du point p4

x4,r4=var('x4,r4')
T4=solve([(p1[0]-x4)^2+(p1[1]-r4*cos(theta))^2+(p1[2]-r4*sin(theta))^2==25,(p2[0]-x4)^2+(p2[1]-r4*cos(theta))^2+(p2[2]-r4*sin(theta))^2==100],x4,r4,solution_dict=True)

a=T4[0].values()
b=T4[1].values()
p4=vector([a[1],0,0])
if b[0]<0:
    p4[1]=a[0]*cos(theta)
    p4[2]=a[0]*sin(theta)
else:
    p4[1]=b[0]*cos(theta)
    p4[2]=b[0]*sin(theta)


var(" x5 y5 z5 x6 y6 z6 x7 y7 z7")

eq25 = (p2[0]-x5)^2+(p2[1]-y5)^2+(p2[2]-z5)^2-100 == 0
eq46 = (p4[0]-x6)^2+(p4[1]-y6)^2+(p4[2]-z6)^2-144 == 0
eq45 = (p4[0]-x5)^2+(p4[1]-y5)^2+(p4[2]-z5)^2-121 == 0
eq16 = (p1[0]-x6)^2+(p1[1]-y6)^2+(p1[2]-z6)^2-100 == 0
eq27 = (p2[0]-x7)^2+(p2[1]-y7)^2+(p2[2]-z7)^2-144 == 0
eq37 = (p3[0]-x7)^2+(p3[1]-y7)^2+(p3[2]-z7)^2-144 == 0
eq56 = (x6-x5)^2+(y6-y5)^2+(z6-z5)^2-144 == 0
eq67 = (x6-x7)^2+(y6-y7)^2+(z6-z7)^2-100 == 0
eq57 = (x7-x5)^2+(y7-y5)^2+(z7-z5)^2-25 == 0

# Calcul des points p5, p6, et p7

f= [lambda x5,y5,z5,x6,y6,z6,x7,y7,z7: eq25.lhs().subs(x5=RR(x5), y5=RR(y5), z5=RR(z5), x6=RR(x6), y6=RR(y6), z6=RR(z6), x7=RR(x7), y7=RR(y7), z7=RR(z7)),
    lambda x5,y5,z5,x6,y6,z6,x7,y7,z7: eq46.lhs().subs(x5=RR(x5), y5=RR(y5), z5=RR(z5), x6=RR(x6), y6=RR(y6), z6=RR(z6), x7=RR(x7), y7=RR(y7), z7=RR(z7)),
    lambda x5,y5,z5,x6,y6,z6,x7,y7,z7: eq45.lhs().subs(x5=RR(x5), y5=RR(y5), z5=RR(z5), x6=RR(x6), y6=RR(y6), z6=RR(z6), x7=RR(x7), y7=RR(y7), z7=RR(z7)),
    lambda x5,y5,z5,x6,y6,z6,x7,y7,z7: eq16.lhs().subs(x5=RR(x5), y5=RR(y5), z5=RR(z5), x6=RR(x6), y6=RR(y6), z6=RR(z6), x7=RR(x7), y7=RR(y7), z7=RR(z7)),
    lambda x5,y5,z5,x6,y6,z6,x7,y7,z7: eq27.lhs().subs(x5=RR(x5), y5=RR(y5), z5=RR(z5), x6=RR(x6), y6=RR(y6), z6=RR(z6), x7=RR ...
(more)
2016-02-20 13:26:38 +0200 asked a question Export a VRML from SAGE and view the VRML file.

I have a program that has as output a Polyhedra (3D object, Jmol.png is an image of it) in SAGE, and I needed to export the VRML file for further use. I used the right click to export the VRML file (a file such as exporting.png). When I opened the VRML file(extension .wrl), the resulting 3D image really different from the one produced by SAGE. Please how can I do to have a proper 3d object Similar to what appears in SAGE? Thank you in advance and have a nice weekend.