itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis
Subject: itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis
From: Valery Pipin
Date: Sun, 13 Feb 2011 13:25:32 -0800
I would say
> Please don't hesitate to correct me if I am wrong, but it seems to me that
> you are expecting the result to be expressed in the coordinate base,
the text books (unfortunately not Landay -Lifshitz, you can look to Mizner
Torn, Wheeler, or B Schutz) call this orthonormal but non-coordinate basis.
For this basis, product of the basis components is the unit matrix. While
the answer in this basis looks, sometimes, simplier, it is not good for the
calculus purpose.
For example, the curl of the velocity flow in the spherical coordinates
load("itensor.lisp");
if get('ctensor, 'version) = false then load(ctensor);
/* define dimension and the name for the metric */
idim(3);
remcomps(g);
imetric(g);
/*define the components of the curl using the Levi-Chevitta symbol*/
remcomps(curlc);
components(curlc([],[i]),'levi_civita([],[i,n,m])*covdiff(V([m],[]),n));
/* show them */
eqn :ishow(curl([],[i]) =canform(rename(expand(curlc([],[i])))))$
/* convert itensor's curl ctensor format*/
display2d:false;
eqnc : ic_convert(eqn);
/* define coordinates */
ct_coords:[r,th,ph];
depends([Vr,Vt,Om],[r,th]);
/* NB! the proper factors for covariant basis, which is used by ctensor*/
V:[Vr,Vt*r,Om*r^2*sin(th)^2];
/*define the metric and compute connectivity componentets of the metrics*/
lg:matrix([1,0,0],[0,r^2,0],[0,0,r^2*sin(th)^2])$
dlt:matrix([1,0,0],[0,1,0],[0,0,1])$
ug:invert(lg)$
christof(all);
/*NB! this a metric factor for the curl! */
sgdet:r^2*sin(th);
/* Below is ctensor loop to compute components */
/* I replace 'levi_civita[%1,%2,i] -> lc0([%1,%2,i])/sgdet */
/* This should be implemented somehow in a future */
for i thru dim do
curl[i]:sum(sum(lc0([%1,%2,i])/sgdet*diff(V[%2],ct_coords[%1]),%1,
1,dim),%2,1,dim)
-sum(sum(sum(lc0([%1,%2,i])/sgdet*mcs[%1,%2,%3]*V[%3],%1,
1,dim),%2,1,dim),%3,1,dim)
display2d:true;
ratexpand(trigsimp(ratexpand(curl[1])));
/* gives*/
'diff(Om,th,1)*sin(th)+2*Om*cos(th)
ratexpand(trigsimp(ratexpand(r*curl[2])));
/* gives*/
-'diff(Om,r,1)*r*sin(th)-2*Om*sin(th)
ratexpand(trigsimp(ratexpand(r*sin(th)*curl[3])));
/* gives*/
'diff(Vt,r,1)+Vt/r-'diff(Vr,th,1)/r
FWIW
Valery