Data Loading...

Curvilinear Coordinate Example: Spherical Coordinates Flipbook PDF

9/6/01 Curvilinear Coordinate Example: Spherical Coordinates The following worksheet is a paradigm for forming the metri


103 Views
7 Downloads
FLIP PDF 60.31KB

DOWNLOAD FLIP

REPORT DMCA

9/6/01

Curvilinear Coordinate Example: Spherical Coordinates The following worksheet is a paradigm for forming the metric tensor and the associated metric tensor in the sense that the calculation blocks are general. The choice of coordinate system, of course, determines the output of each block. The various simplification, which are not central to the calculations, may also be different for different coordinate systems. You might want to set up something of your own. We may do others later in the course. (It's probably also worth noting that the worksheet could have been compacted by defining arrays of arrays. I did not do that in the interest of greater clarity.) Define arrays for the Cartesian and curvilinear coordinates STUDENT > y:=array(1..3):x:=array(1..3): Suppose x to be spherical coordinates, x[1] = r, x[2] = theta, x[3] = phi, which makes the transformation STUDENT > y[1]:=x[1]*sin(x[2])*cos(x[3]): y[2]:=x[1]*sin(x[2])*sin(x[3]): y[3]:=x[1]*cos(x[2]): print(y); [ x1 sin( x2 ) cos( x3 ), x1 sin( x2 ) sin( x3 ), x1 cos( x2 ) ] Define the spherical basis vectors and calculate their components STUDENT > g1:=array(1..3):g2:=array(1..3):g3:=array(1..3): for i from 1 to 3 do g1[i]:=diff(y[i],x[1]) od: for i from 1 to 3 do g2[i]:=diff(y[i],x[2]) od: for i from 1 to 3 do g3[i]:=diff(y[i],x[3]) od: print(g1);print(g2);print(g3); [ sin( x2 ) cos( x3 ), sin( x2 ) sin( x3 ), cos( x2 ) ] [ x1 cos( x2 ) cos( x3 ), x1 cos( x2 ) sin( x3 ), −x1 sin( x2 ) ] [ −x1 sin( x2 ) sin( x3 ), x1 sin( x2 ) cos( x3 ), 0 ] Note that these are not unit vectors, although they are orthogonal, as you can readily establish. Now we can define the metric tensor for this system (I call this gll to leave me a symbol for the associated metric tensor, ghh.) I will do the calculations in an awkward, but I hope clear, way. STUDENT > gll:=array(1..3,1..3): I can find all six distinct elements by brute force dot products, and then fill in the symmetric elements. STUDENT > gll[1,1]:=0: for i from 1 to 3 do gll[1,1]:=gll[1,1]+g1[i]*g1[i] od: gll[1,2]:=0: for i from 1 to 3 do gll[1,2]:=gll[1,2]+g1[i]*g2[i] od: gll[1,3]:=0: for i from 1 to 3 do gll[1,3]:=gll[1,3]+g1[i]*g3[i] od: gll[2,2]:=0:

Page 1

Maple V Release 4 - Student Edition

for i from 1 to 3 do gll[2,2]:=gll[2,2]+g2[i]*g2[i] od: gll[2,3]:=0: for i from 1 to 3 do gll[2,3]:=gll[2,3]+g2[i]*g3[i] od: gll[3,3]:=0: for i from 1 to 3 do gll[3,3]:=gll[3,3]+g3[i]*g3[i] od: gll[2,1]:=gll[1,2]:gll[3,2]:=gll[2,3]:gll[3,1]:=gll[1,3]: print(gll); [ sin( x2 ) cos( x3 )2 + sin( x2 )2 sin( x3 )2 + cos( x2 )2 , sin( x2 ) cos( x3 )2 x1 cos( x2 ) + sin( x2 ) sin( x3 )2 x1 cos( x2 ) − cos( x2 ) x1 sin( x2 ) , 0 ] [ sin( x2 ) cos( x3 )2 x1 cos( x2 ) + sin( x2 ) sin( x3 )2 x1 cos( x2 ) − cos( x2 ) x1 sin( x2 ) , x12 cos( x2 )2 cos( x3 )2 + x12 cos( x2 )2 sin( x3 )2 + x12 sin( x2 )2 , 0 ] [ 0 , 0 , x12 sin( x2 )2 sin( x3 )2 + x12 sin( x2 )2 cos( x3 )2 ] 2

As you can see, Maple does not automatically simplify the various elements, so I have to do that in two steps STUDENT > for i from 1 to 3 do for j from 1 to 3 do gll[i,j]:=simplify(gll[i,j],symbolic) od:od: print(gll); 0 1 0    2 0 x1  0   2 − x 2 cos( x )2 0 0 x  1 1 2  STUDENT > simplify(gll[3,3]-x[1]^2*sin(x[2])^2); 0 STUDENT > gll[3,3]:=x[1]^2*sin(x[2])^2: print(gll); 1 0 0    0 x12  0   2 sin( x ) 2 0 0 x  1 2  Since I have foregone the linear algebra package in favor of indicial notation, the dot and cross products I need to find the reciprocal basis vectors and the associated metric tensor need to be done in full indicial glory. Define the alternating tensor and print out the nonzero elements to confirm we've got it right. STUDENT > eijk:=array(1..3,1..3,1..3): for i from 1 to 3 do for j from 1 to 3 do for k from 1 to 3 do eijk[i,j,k]:=0: od:od:od: eijk[1,2,3]:=1:eijk[2,3,1]:=1:eijk[3,1,2]:=1: eijk[1,3,2]:=-1:eijk[2,1,3]:=-1:eijk[3,2,1]:=-1: for i from 1 to 3 do for j from 1 to 3 do for k from 1 to 3 do if eijk[i,j,k]0 then print(i,j,k,eijk[i,j,k]) fi: od:od:od: 1, 2, 3, 1 1, 3, 2, -1 Page 2

Maple V Release 4 - Student Edition

2, 1, 3, -1 2, 3, 1, 1 3, 1, 2, 1 3, 2, 1, -1 I will take the slow road and construct the reciprocal basis vectors one at a time by forming first the relevant cross product and then divide each by the Jacobian (scalar triple product) found above. STUDENT > g2xg3:=array(1..3): for i from 1 to 3 do g2xg3[i]:=0: for j from 1 to 3 do for k from 1 to 3 do g2xg3[i]:=g2xg3[i]+eijk[i,j,k]*g2[j]*g3[k] od:od: g2xg3[i]:=simplify(g2xg3[i],symbolic); od: print(g2xg3); [ x12 cos( x3 ) − x12 cos( x3 ) cos( x2 )2, x12 sin( x3 ) − x12 sin( x3 ) cos( x2 )2, x12 cos( x2 ) sin( x2 ) ] STUDENT > J:=0: for i from 1 to 3 do J:=J+g1[i]*g2xg3[i] od: J:=simplify(J,symbolic); J := sin( x2 ) x12 STUDENT > rg1:=array(1..3): for i from 1 to 3 do rg1[i]:=simplify(g2xg3[i]/J,symbolic) od: print(rg1); [ sin( x2 ) cos( x3 ), sin( x2 ) sin( x3 ), cos( x2 ) ] STUDENT > g3xg1:=array(1..3): for i from 1 to 3 do g3xg1[i]:=0: for j from 1 to 3 do for k from 1 to 3 do g3xg1[i]:=g3xg1[i]+eijk[i,j,k]*g3[j]*g1[k] od:od: g3xg1[i]:=simplify(g3xg1[i],symbolic); od: print(g3xg1); rg2:=array(1..3): for i from 1 to 3 do rg2[i]:=simplify(g3xg1[i]/J,symbolic) od: print(rg2); [ x1 sin( x2 ) cos( x3 ) cos( x2 ), x1 sin( x2 ) sin( x3 ) cos( x2 ), −x1 + x1 cos( x2 )2 ]  cos( x3 ) cos( x2 ) sin( x3 ) cos( x2 ) sin( x2 )    , ,− x1 x1 x1   STUDENT > g1xg2:=array(1..3): for i from 1 to 3 do g1xg2[i]:=0: for j from 1 to 3 do for k from 1 to 3 do g1xg2[i]:=g1xg2[i]+eijk[i,j,k]*g1[j]*g2[k] od:od: g1xg2[i]:=simplify(g1xg2[i],symbolic); od: print(g1xg2); rg3:=array(1..3): for i from 1 to 3 do rg3[i]:=simplify(g1xg2[i]/J,symbolic)

Page 3

Maple V Release 4 - Student Edition

od: print(rg3); [ −sin( x3 ) x1, cos( x3 ) x1, 0 ]  sin( x3 ) cos( x3 )   − , , 0   x1 sin( x2 ) x1 sin( x2 )  I leeave it to you to show that the basis and reciprocal basis satisfy the appropriate orthonormality conditions. The associated metric tensor can be found directly from the reciprocal basis in the same way as I found the metric tensor from the basis. STUDENT > ghh:=array(1..3,1..3): ghh[1,1]:=0: for i from 1 to 3 do ghh[1,1]:=ghh[1,1]+rg1[i]*rg1[i] od: ghh[1,2]:=0: for i from 1 to 3 do ghh[1,2]:=ghh[1,2]+rg1[i]*rg2[i] od: ghh[1,3]:=0: for i from 1 to 3 do ghh[1,3]:=ghh[1,3]+rg1[i]*rg3[i] od: ghh[2,2]:=0: for i from 1 to 3 do ghh[2,2]:=ghh[2,2]+rg2[i]*rg2[i] od: ghh[2,3]:=0: for i from 1 to 3 do ghh[2,3]:=ghh[2,3]+rg2[i]*rg3[i] od: ghh[3,3]:=0: for i from 1 to 3 do ghh[3,3]:=ghh[3,3]+rg3[i]*rg3[i] od: ghh[2,1]:=ghh[1,2]:ghh[3,2]:=ghh[2,3]:ghh[3,1]:=ghh[1,3]: print(ghh);   sin( x2 )2 cos( x3 )2 + sin( x2 )2 sin( x3 )2 + cos( x2 )2 ,   sin( x2 ) cos( x3 )2 cos( x2 ) sin( x2 ) sin( x3 )2 cos( x2 ) cos( x2 ) sin( x2 ) + − , 0  x1 x1 x1   sin( x2 ) cos( x3 )2 cos( x2 ) sin( x2 ) sin( x3 )2 cos( x2 ) cos( x2 ) sin( x2 )  , + −  x1 x1 x1   cos( x3 )2 cos( x2 )2 sin( x3 )2 cos( x2 )2 sin( x2 )2  + + , 0  x1 2 x1 2 x 12  2 2    0 , 0 , sin( x3 ) + cos( x3 )    x12 sin( x2 )2 x12 sin( x2 )2   As in the case of the metric tensor, I need to do some manual simplification to get the associated metric tensor in a more reasonable form STUDENT > for i from 1 to 3 do for j from 1 to 3 do ghh[i,j]:=simplify(ghh[i,j],symbolic) od:od: print(ghh);

Page 4

Maple V Release 4 - Student Edition

1 0 0     1  0  0   2 x1     1   0 0 − 2  2  x1 ( −1 + cos( x2 ) )   STUDENT > subs(cos(x[2])^2=1-sin(x[2])^2,ghh[3,3]); 1 2 x1 sin( x2 )2 STUDENT > simplify(ghh[3,3]-",symbolic); 0 STUDENT > ghh[3,3]:="": print(ghh); 1 0 0     1  0  0   2 x1     1   0  0 2 2 x1 sin( x2 )   The metric tensor and the associated metric tensor are both diagonal, so that both the basis and the reciprocal basis are orthogonal. It is also clear by inspection that the metric tensor and the associated metric tensor are mutual inverses.

Page 5

Maple V Release 4 - Student Edition