tag:blogger.com,1999:blog-2520472460430880330.post4990456147223329149..comments2018-08-08T04:07:54.328-07:00Comments on The Official SymPy Blog: ProgressAnonymoushttp://www.blogger.com/profile/02845032202161204018noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-2520472460430880330.post-5191631522145608402012-04-07T22:20:44.115-07:002012-04-07T22:20:44.115-07:00Here's a copy of what I've written till no...Here's a copy of what I've written till now:<br /><br /><br />from sympy import *<br />def GLA(i,j,a):<br /><br /> theta = Symbol('theta')<br /> chy = Symbol('chy')<br /> sy = Symbol('sy')<br /> t = Symbol('t')<br /> temp1 = 0<br /> temp2 = 0<br /> temp3 = 0<br /> sumTialpha = 0<br /> sumTjalpha = 0<br /><br /> if a == 1:<br /> xa = 'theta'<br /> elif a == 2:<br /> xa = 'sy'<br /> elif a == 3:<br /> xa = 'chy'<br /> elif a == 4:<br /> xa = 't'<br /><br /> csc = exp(-log(sin(theta)))<br /> <br /> gl = [ [-exp(4*t), 0, 0, 0],[0, -exp(4*t)*sin(theta)**2-exp(6*t)*cos(theta)**2, -exp(6*t)*cos(theta), 0],[0,-exp(6*t)*cos(theta),-exp(6*t),0],[0, 0, 0, 1]]<br /> <br /> #gl = [ [-exp(4*t), 0, 0, 0],[0, -exp(4*t) -exp(6*t)*(theta**2), -exp(6*t)*(theta), 0],[0,-exp(6*t)*(theta),-exp(6*t),0],[0, 0, 0, 1]]<br /> <br /> gL = [[-1, 0, 0 , 0],[0,-1*(1/(sin(theta))*sin(theta)),cos(theta)/(sin(theta)*sin(theta)),0],[0,cos(theta)/(sin(theta)*sin(theta)),-1*(1/(sin(theta)*sin(theta))),0],[0,0,0,1]]<br /><br /> #gL = [[-1/exp(2*t), 0, 0 , 0],[0,-1/exp(2*t),theta/exp(2*t),0],[0,theta/exp(2*t),-(theta**2)/exp(2*t) - 1/exp(3*t),0],[0,0,0,1]]<br /><br /> T = [[[0,0,0,0],[0,0,sin(theta)*0.5,0],[0,sin(theta)*0.5,0,0],[0,0,0,0]],[[0,0.5*cot(theta),-0.5*csc,0],[0.5*cot(theta),0,0,0],[-0.5*csc,0,0,0],[0,0,0,0]],[[0,-0.5*csc,0.5*cot(theta),0],[-0.5*csc,0,0,0],[0.5*cot(theta),0,0,0]],[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]]<br /><br /> #T = [[[0,0,0,0],[0,-theta,-0.5,0],[0,-0.5,0,0],[0,0,0,0]],[[0,theta*0.5,0.5,0],[theta*0.5,0,0,0],[0.5,0,0,0],[0,0,0,0]],[[0,(1-theta**2)*0.5,-theta*0.5,0],[(1-theta**2)*0.5,0,0,0],[-theta*0.5,0,0,0],[0,0,0,0]],[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]]<br /><br /> k = diff(gl[i-1][j-1],xa)<br /><br /> while temp1 < 4:<br /> sumTialpha = sumTialpha + T[temp1][i-1][a-1]*gl[temp1][i-1]<br /> temp1 = temp1 + 1<br /><br /> while temp2 < 4:<br /> sumTjalpha = sumTjalpha + T[temp2][j-1][a-1]*gl[temp2][j-1]<br /> temp2 = temp2 + 1<br /><br /> return simplify(k - sumTialpha - sumTjalpha,ratio = 1.7)<br /><br />def glab(i,j,a,b):<br /><br /> theta = Symbol('theta')<br /> chy = Symbol('chy')<br /> sy = Symbol('sy')<br /> t = Symbol('t')<br /> temp1 = 0<br /> temp2 = 0<br /> temp3 = 0<br /> sumTibeta = 0<br /> sumTjbeta = 0<br /><br /> if a == 1:<br /> xa = 'theta'<br /> elif a == 2:<br /> xa = 'sy'<br /> elif a == 3:<br /> xa = 'chy'<br /> elif a == 4:<br /> xa = 't'<br /><br /> #gl = [ [-1, 0, 0, 0],[0, -1, -cos(theta), 0],[0,-cos(theta),-1,0],[0, 0, 0, 1]]<br /> <br /> gl = [ [-exp(2*t), 0, 0, 0],[0, -exp(2*t) -exp(3*t)*(theta**2), -exp(3*t)*(theta), 0],[0,-exp(3*t)*(theta),-exp(3*t),0],[0, 0, 0, 1]]<br /> <br /> #gL = [[-1, 0, 0 , 0],[0,-1*(1/(sin(theta))*sin(theta)),cos(theta)/(sin(theta)*sin(theta)),0],[0,cos(theta)/(sin(theta)*sin(theta)),-1*(1/(sin(theta)*sin(theta))),0],[0,0,0,1]]<br /><br /> gL = [[-1/exp(2*t), 0, 0 , 0],[0,-1/exp(2*t),theta/exp(2*t),0],[0,theta/exp(2*t),-(theta**2)/exp(2*t) - 1/exp(3*t),0],[0,0,0,1]]<br /><br /> #T = [[[0,0,0],[0,0,sin(theta)/2],[0,0,0]],[[0,cos(theta)/(2*sin(theta)),-1/sin(theta)],[0,0,0],[0,0,0]],[[0,cos(theta)/(2*sin(theta)),-1/sin(theta)],[0,0,0],[0,0,0]]]<br /><br /> T = [[[0,0,0],[0,-theta,-1/2],[0,-1/2,0]],[[0,theta/2,1/2],[theta/2,0,0],[1/2,0,0]],[[0,1/2 - (theta**2)/2,-(theta/2)],[1/2 - (theta**2)/2,0,0],[-theta/2,0,0]],[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]]<br /><br /> gla = GLA(i,j,a)<br /><br /> k = diff(gla,xa)<br /><br /> while temp1 < 4:<br /> sumTibeta = sumTibeta + T[i-1][b-1][temp1-1]<br /> temp1 = temp1+1<br /><br /> while temp2 < 4:<br /> sumTjbeta = sumTjbeta + T[j-1][b-1][temp2-1]<br /> temp2 = temp2+1<br /><br /> return k - sumTibeta*gla - sumTjbeta*glaNareshhttps://www.blogger.com/profile/08507285637110903822noreply@blogger.comtag:blogger.com,1999:blog-2520472460430880330.post-83995387460695506132012-04-07T22:18:11.843-07:002012-04-07T22:18:11.843-07:00Hey I'm looking for sympy code to compute chri...Hey I'm looking for sympy code to compute christoffel symbols. Facing a lot of problems currently while using sympy. I hope you can help.<br /><br />If you can kindly contact me at nareshshah139@gmail.com<br /><br />We can also talk on skype if necessary. Skype id: nareshshah139Nareshhttps://www.blogger.com/profile/08507285637110903822noreply@blogger.com