Essays/Torsion Tensor/TorsionTensor00

From J Wiki
Jump to: navigation, search


NB. ... script torsiontensor.ijs ...

gXc =:(<0 0){[
gXm =:(<0 1){[
gXe =:(<0 2){[
gXp0=:(<1 0){[
gXp1=:(<1 1){[
gXp2=:(<1 2){[
gXq0=:(<2 0){[
gXq1=:(<2 1){[
gXq2=:(<2 2){[
gXw0=:(<3 0){[

gXT=:gXcme,gXpAll,gXqAll,:gXwAll

sin=:1&o.
cos=:2&o.

aVn2=:~.@(](([-:"1/:~"1@])#]),/^:1@(],"1"1 _~^:1])@:(,"0)@])
aVn3=:~.@(](([-:"1/:~"1@])#]),/^:2@(],"1"1 _~^:2])@:(,"0)@])

cy0=:(0{])"_ 1
cy1=:(1{])"_ 1
cy2=:(2{])"_ 1
cy3=:(3{])"_ 1

cx0=:(0{])"_ 1
cx1=:(1{])"_ 1
cx2=:(2{])"_ 1
cx3=:(3{])"_ 1

yCsteps =:(0{])+((1{])-0{])*((i.@>:@])%])@(2{])
yCtotal =:,/^:3@>@(,"1"1 _&.>/)@:(<@:(,"0)@yCsteps"1)
yCselect=:?.@([$0{$@]){]
yCrandom=:[yCselect[:yCtotal]

qtsz=:$@]$[0:`(I.@([>!.0|@]))`]},@]
qteq=:*./@,@([((>@(0{])|@:->@(1{]))<:!.0>@(1{[)*>@(0{])>.&:|>@(1{]))(>@(0{[)qtsz>@(0{]));>@(0{[)qtsz>@(1{]))

nzstats=:((<./;>./)@:|@((0<!.0|)#]),<@(+/)@(0<!.0|))@,

smx=:+/@(*"1)"1 _"_


GTT0000C.jpg


NB. ... script torsiontensor.ijs ...

bt1      =:  2*gXm*cy0^_1:
bt1dy    =: _2*gXm*cy0^_2:
bt1dydy  =:  4*gXm*cy0^_3:
bt1dydydy=:_12*gXm*cy0^_4:


GTT0001C.jpg


NB. ... script torsiontensor.ijs ...

bt2=:(gXe^2:)*((gXc^2:)*cy0^2:)^_1:

bt2dy=:-@(gXe^2:)*(2*(gXc^2:)*cy0)*((gXc^2:)*cy0^2:)^_2:

bt2dydyt1=: 2*(gXe^2:)*((2*(gXc^2:)*cy0)^2:)*((gXc^2:)*cy0^2:)^_3:
bt2dydyt2=:_1*(gXe^2:)*(2*gXc^2:)*((gXc^2:)*cy0^2:)^_2:
bt2dydy  =:bt2dydyt1+bt2dydyt2

bt2dydydyt1=:_6*(gXe^2:)*((2*(gXc^2:)*cy0)^3:)*((gXc^2:)*cy0^2:)^_4:
bt2dydydyt2=: 6*(gXe^2:)*(2*gXc^2:)*(2*(gXc^2:)*cy0)*((gXc^2:)*cy0^2:)^_3:
bt2dydydy  =:bt2dydydyt1+bt2dydydyt2


GTT0002C.jpg


NB. ... script torsiontensor.ijs ...

btS      =:1+-@bt1      +bt2
btSdy    =:  -@bt1dy    +bt2dy
btSdydy  =:  -@bt1dydy  +bt2dydy
btSdydydy=:  -@bt1dydydy+bt2dydydy


GTT0003C.jpg


NB. ... script torsiontensor.ijs ...

atS=:btS^_1:

atSdy=:-@(btS^_2:)*btSdy

atSdydyt1=:_1*(btS^_2:)*btSdydy
atSdydyt2=: 2*(btS^_3:)*btSdy^2:
atSdydy  =:atSdydyt1+atSdydyt2

atSdydydyt1=:_1*(btS^_2:)*btSdydydy
atSdydydyt2=: 6*(btS^_3:)*btSdy*btSdydy
atSdydydyt3=:_6*(btS^_4:)*btSdy^3:
atSdydydy  =:atSdydydyt1+atSdydydyt2+atSdydydyt3


GTT0004C.jpg


NB. ... script torsiontensor.ijs ...

hycv00=:atS
hycv11=:cy0^2:
hycv22=:(cy0^2:)*sin@cy1^2:
hycv33=:-@(gXc^2:)*btS
hycv  =:((hycv00,hycv11,hycv22,hycv33)[`((0 0;1 1;2 2;3 3)"_)`]}4 4$0:)"_ 1


GTT0005C.jpg


NB. ... script torsiontensor.ijs ...

hycv00y0=:atSdy
hycv11y0=:2*cy0
hycv22y0=:2*cy0*sin@cy1^2:
hycv22y1=:2*(cy0^2:)*sin@cy1*cos@cy1
hycv33y0=:-@(gXc^2:)*btSdy
hycvdy  =:((hycv00y0,hycv11y0,hycv22y0,hycv22y1,hycv33y0)[`((0 0 0;1 1 0;2 2 0;2 2 1;3 3 0)"_)`]}4 4 4$0:)"_ 1


GTT0006C.jpg


NB. ... script torsiontensor.ijs ...

hycv00y0y0=:atSdydy
hycv11y0y0=:2:
hycv22y0y0=:2*sin@cy1^2:
hycv22y0y1=:4*cy0*sin@cy1*cos@cy1
hycv22y1y1=:(_2*(cy0^2:)*sin@cy1^2:)+2*(cy0^2:)*cos@cy1^2:
hycv33y0y0=:-@(gXc^2:)*btSdydy

aV0000  =:>@(0{]);([hycv00y0y0>@(0{]))`(<"1@(0 0,"1 aVn2@(0 0"_)))`(>@(1{]))}
aV1100  =:>@(0{]);([hycv11y0y0>@(0{]))`(<"1@(1 1,"1 aVn2@(0 0"_)))`(>@(1{]))}
aV2200  =:>@(0{]);([hycv22y0y0>@(0{]))`(<"1@(2 2,"1 aVn2@(0 0"_)))`(>@(1{]))}
aV2201  =:>@(0{]);([hycv22y0y1>@(0{]))`(<"1@(2 2,"1 aVn2@(0 1"_)))`(>@(1{]))}
aV2211  =:>@(0{]);([hycv22y1y1>@(0{]))`(<"1@(2 2,"1 aVn2@(1 1"_)))`(>@(1{]))}
aV3300  =:>@(0{]);([hycv33y0y0>@(0{]))`(<"1@(3 3,"1 aVn2@(0 0"_)))`(>@(1{]))}
hycvdydy=:>@(1{])@(([aV0000[aV1100[aV2200[aV2201[aV2211[aV3300(cy0,cy1,cy2,cy3);(4$4:)$0:)"_ 1)


GTT0007C.jpg


NB. ... script torsiontensor.ijs ...

hycv00y0y0y0=:atSdydydy
hycv22y0y0y1=:4*sin@cy1*cos@cy1
hycv22y0y1y1=:(_4*cy0*sin@cy1^2:)+4*cy0*cos@cy1^2:
hycv22y1y1y1=:_8*(cy0^2:)*sin@cy1*cos@cy1
hycv33y0y0y0=:-@(gXc^2:)*btSdydydy

aV00000   =:>@(0{]);([hycv00y0y0y0>@(0{]))`(<"1@(0 0,"1 aVn3@(0 0 0"_)))`(>@(1{]))}
aV22001   =:>@(0{]);([hycv22y0y0y1>@(0{]))`(<"1@(2 2,"1 aVn3@(0 0 1"_)))`(>@(1{]))}
aV22011   =:>@(0{]);([hycv22y0y1y1>@(0{]))`(<"1@(2 2,"1 aVn3@(0 1 1"_)))`(>@(1{]))}
aV22111   =:>@(0{]);([hycv22y1y1y1>@(0{]))`(<"1@(2 2,"1 aVn3@(1 1 1"_)))`(>@(1{]))}
aV33000   =:>@(0{]);([hycv33y0y0y0>@(0{]))`(<"1@(3 3,"1 aVn3@(0 0 0"_)))`(>@(1{]))}
hycvdydydy=:>@(1{])@(([aV00000[aV22001[aV22011[aV22111[aV33000(cy0,cy1,cy2,cy3);(5$4:)$0:)"_ 1)


NB. ... execute (ijx) ...

   gXcme =:( 1.50  1.45  1.51 )"_
   gXpAll=:( 0     0     0    )"_
   gXqAll=:( 0     0     0    )"_
   gXwAll=:( 0     _     _    )"_

   yCpts=:3.5 10 28,(0.1,(1p1-0.1),28),0 2p1 44,:0 6 20"_

   (gXT(hycvdy    (((2^_18);2^_19)qteq[;])"3(0|:[:(gXT hycv    ])D.1])"_ 1)]) (50 yCrandom yCpts)''
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

   (gXT(hycvdydy  (((2^_19);2^_18)qteq[;])"4(0|:[:(gXT hycvdy  ])D.1])"_ 1)]) (50 yCrandom yCpts)''
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

   (gXT(hycvdydydy(((2^_16);2^_18)qteq[;])"5(0|:[:(gXT hycvdydy])D.1])"_ 1)]) (50 yCrandom yCpts)''
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1


GTT0008C.jpg


NB. ... script torsiontensor.ijs ...

k0=:(gXp0*^@(gXp1*cy0)*sin@(gXp2*cy3))"_ 1


NB. ... plot (ijs) ...

gXcme =:( 0   0    0   )"_
gXpAll=:( 6  _1.4  1.7 )"_
gXqAll=:( 0   0    0   )"_
gXwAll=:( 0   _    _   )"_

yCpts=:0.3 2 50,(0.1,(1p1-0.1),28),0 2p1 50,:1 8 50"_

load 'plot'
pd (gXT(cy0;cy3;k0)]) (51 51$]) (~:@:((0 3{])"1)#]) yCtotal@yCpts''
pd 'pdf'
pd 'show'


TTgraphic000.jpg
... a surface for k0 ...


GTT0009C.jpg


NB. ... script torsiontensor.ijs ...

k0y0=:(gXp0*gXp1*^@(gXp1*cy0)*sin@(gXp2*cy3))"_ 1
k0y3=:(gXp0*gXp2*^@(gXp1*cy0)*cos@(gXp2*cy3))"_ 1

k0y0y0=:(gXp0*(gXp1^2:)*^@(gXp1*cy0)*sin@(gXp2*cy3))"_ 1
k0y0y3=:(gXp0*gXp1*gXp2*^@(gXp1*cy0)*cos@(gXp2*cy3))"_ 1
k0y3y3=:(-@gXp0*(gXp2^2:)*^@(gXp1*cy0)*sin@(gXp2*cy3))"_ 1

k0y0y0y0=:(gXp0*(gXp1^3:)*^@(gXp1*cy0)*sin@(gXp2*cy3))"_ 1
k0y0y0y3=:(gXp0*(gXp1^2:)*gXp2*^@(gXp1*cy0)*cos@(gXp2*cy3))"_ 1
k0y0y3y3=:(-@gXp0*gXp1*(gXp2^2:)*^@(gXp1*cy0)*sin@(gXp2*cy3))"_ 1
k0y3y3y3=:(-@gXp0*(gXp2^3:)*^@(gXp1*cy0)*cos@(gXp2*cy3))"_ 1


GTT0010C.jpg


NB. ... script torsiontensor.ijs ...

Pyhicv0=:k0y0
Pyhicv3=:k0y3
Pyhicv =:((Pyhicv0,Pyhicv3)[`((0;3)"_)`]}4$0:)"_ 1


Pyhicv0y0=:k0y0y0
Pyhicv0y3=:k0y0y3
Pyhicv3y3=:k0y3y3

PH00=:>@(0{]);([Pyhicv0y0>@(0{]))`(<"1@aVn2@(0 0"_))`(>@(1{]))}
PH03=:>@(0{]);([Pyhicv0y3>@(0{]))`(<"1@aVn2@(0 3"_))`(>@(1{]))}
PH33=:>@(0{]);([Pyhicv3y3>@(0{]))`(<"1@aVn2@(3 3"_))`(>@(1{]))}

Pyhicvdy=:>@(1{])@(([PH33[PH03[PH00(cy0,cy1,cy2,cy3);(2$4:)$0:)"_ 1)


Pyhicv0y0y0=:k0y0y0y0
Pyhicv0y0y3=:k0y0y0y3
Pyhicv0y3y3=:k0y0y3y3
Pyhicv3y3y3=:k0y3y3y3

PH000=:>@(0{]);([Pyhicv0y0y0>@(0{]))`(<"1@aVn3@(0 0 0"_))`(>@(1{]))}
PH003=:>@(0{]);([Pyhicv0y0y3>@(0{]))`(<"1@aVn3@(0 0 3"_))`(>@(1{]))}
PH033=:>@(0{]);([Pyhicv0y3y3>@(0{]))`(<"1@aVn3@(0 3 3"_))`(>@(1{]))}
PH333=:>@(0{]);([Pyhicv3y3y3>@(0{]))`(<"1@aVn3@(3 3 3"_))`(>@(1{]))}

Pyhicvdydy=:>@(1{])@(([PH333[PH033[PH003[PH000(cy0,cy1,cy2,cy3);(3$4:)$0:)"_ 1)


NB. ... execute (ijx) ...

   gXcme =:( 0   0    0   )"_
   gXpAll=:( 6  _1.4  1.7 )"_
   gXqAll=:( 0   0    0   )"_
   gXwAll=:( 0   _    _   )"_

   yCpts=:0.3 2 50,(0.1,(1p1-0.1),28),0 2p1 50,:1 8 50"_

   (gXT(Pyhicvdy  (((2^_44);2^_14)qteq[;])"2(0|:[:(gXT Pyhicv  ])D.1])"_ 1)]) (50 yCrandom yCpts)''
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

   (gXT(Pyhicvdydy(((2^_44);2^_14)qteq[;])"3(0|:[:(gXT Pyhicvdy])D.1])"_ 1)]) (50 yCrandom yCpts)''
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1


GTT0011C.jpg


NB. ... script torsiontensor.ijs ...

k1=:(gXq0*(gXq1*cy0)^gXq2)"_ 1


NB. ... plot (ijs) ...

gXcme =:( 0  0   0 )"_
gXpAll=:( 0  0   0 )"_
gXqAll=:( 1  1  _1 )"_
gXwAll=:( 0  _   _ )"_

yCpts=:0.3 2 50,(0.1,(1p1-0.1),28),0 2p1 50,:1 8 50"_

load 'plot'
pd (gXT((cy0*cos@cy2);(cy0*sin@cy2);k1)]) (51 51$]) (~:@:((0 2{])"1)#]) yCtotal@yCpts''
pd 'pdf'
pd 'show'


TTgraphic001.jpg
... a surface for k1 ...


GTT0012C.jpg


NB. ... script torsiontensor.ijs ...

k1y0    =:(gXq0*(gXq1^1:)*gXq2                    *(gXq1*cy0)^gXq2-1:)"_ 1
k1y0y0  =:(gXq0*(gXq1^2:)*gXq2*(gXq2-1:)          *(gXq1*cy0)^gXq2-2:)"_ 1
k1y0y0y0=:(gXq0*(gXq1^3:)*gXq2*(gXq2-1:)*(gXq2-2:)*(gXq1*cy0)^gXq2-3:)"_ 1


GTT0013C.jpg


NB. ... script torsiontensor.ijs ...

Oymg3=:-@k1
Oymg =:(Oymg3[`3:`]}4$0:)"_ 1

Oymg3y0=:-@k1y0
Oymgdy =:(Oymg3y0[`((<3 0)"_)`]}4 4$0:)"_ 1

Oymg3y0y0=:-@k1y0y0
OM300    =:>@(0{]);([Oymg3y0y0>@(0{]))`(<"1@(3,"1 aVn2@(0 0"_)))`(>@(1{]))}
Oymgdydy =:>@(1{])@(([OM300(cy0,cy1,cy2,cy3);(3$4:)$0:)"_ 1)

Oymg3y0y0y0=:-@k1y0y0y0
OM3000     =:>@(0{]);([Oymg3y0y0y0>@(0{]))`(<"1@(3,"1 aVn3@(0 0 0"_)))`(>@(1{]))}
Oymgdydydy =:>@(1{])@(([OM3000(cy0,cy1,cy2,cy3);(4$4:)$0:)"_ 1)


NB. ... execute (ijx) ...

   gXcme =:( 0  0   0 )"_
   gXpAll=:( 0  0   0 )"_
   gXqAll=:( 1  1  _1 )"_
   gXwAll=:( 0  _   _ )"_

   yCpts=:0.3 2 50,(0.1,(1p1-0.1),28),0 2p1 50,:1 8 50"_

   (gXT(Oymgdy    (((2^_44);2^_23)qteq[;])"2(0|:[:(gXT Oymg    ])D.1])"_ 1)]) (50 yCrandom yCpts)''
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

   (gXT(Oymgdydy  (((2^_44);2^_22)qteq[;])"3(0|:[:(gXT Oymgdy  ])D.1])"_ 1)]) (50 yCrandom yCpts)''
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

   (gXT(Oymgdydydy(((2^_44);2^_22)qteq[;])"4(0|:[:(gXT Oymgdydy])D.1])"_ 1)]) (50 yCrandom yCpts)''
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1


GTT0014C.jpg


NB. ... script torsiontensor.ijs ...

xfromy=:(cy0,cy1,(cy2-gXw0*cy3),cy3)"_ 1
yfromx=:(cx0,cx1,(cx2+gXw0*cx3),cx3)"_ 1


NB. ... script torsiontensor.ijs ...

xcdy=:((1,0,0,0:),(0,1,0,0:),(0,0,1,-@gXw0),:0,0,0,1:)"_ 1
ycdx=:((1,0,0,0:),(0,1,0,0:),(0,0,1,  gXw0),:0,0,0,1:)"_ 1

tT21=: smx"2 1
tT22=:[smx"2 2 smx"2 2
tT23=:[smx"2 3[smx"2 3 smx"2 3
tT24=:[smx"2 4[smx"2 4[smx"2 4 smx"2 4
tT25=:[smx"2 5[smx"2 5[smx"2 5[smx"2 5 smx"2 5

hxcv      =:([(0|:])"2@:ycdx xfromy)tT22 hycv
hxcvdx    =:([(0|:])"2@:ycdx xfromy)tT23 hycvdy
hxcvdxdx  =:([(0|:])"2@:ycdx xfromy)tT24 hycvdydy
hxcvdxdxdx=:([(0|:])"2@:ycdx xfromy)tT25 hycvdydydy

Pxhicv    =:([(0|:])"2@:ycdx xfromy)tT21 Pyhicv
Pxhicvdx  =:([(0|:])"2@:ycdx xfromy)tT22 Pyhicvdy
Pxhicvdxdx=:([(0|:])"2@:ycdx xfromy)tT23 Pyhicvdydy

Oxmg      =:([(0|:])"2@:ycdx xfromy)tT21 Oymg
Oxmgdx    =:([(0|:])"2@:ycdx xfromy)tT22 Oymgdy
Oxmgdxdx  =:([(0|:])"2@:ycdx xfromy)tT23 Oymgdydy
Oxmgdxdxdx=:([(0|:])"2@:ycdx xfromy)tT24 Oymgdydydy

hkAy=:hycv;hycvdy;hycvdydy;hycvdydydy;Pyhicv;Pyhicvdy;Pyhicvdydy;Oymg;Oymgdy;Oymgdydy;Oymgdydydy
hkAx=:hxcv;hxcvdx;hxcvdxdx;hxcvdxdxdx;Pxhicv;Pxhicvdx;Pxhicvdxdx;Oxmg;Oxmgdx;Oxmgdxdx;Oxmgdxdxdx

hcv      =:>@( 0{])
hcvdx    =:>@( 1{])
hcvdxdx  =:>@( 2{])
hcvdxdxdx=:>@( 3{])
Phicv    =:>@( 4{])
Phicvdx  =:>@( 5{])
Phicvdxdx=:>@( 6{])
Omg      =:>@( 7{])
Omgdx    =:>@( 8{])
Omgdxdx  =:>@( 9{])
Omgdxdxdx=:>@(10{])


NB. ... execute (ijx) ...

   gXcme =:( 1.5    0.45   0.754 )"_
   gXpAll=:( 6     _1.4    1.7   )"_
   gXqAll=:( 1      1     _1     )"_
   gXwAll=:( 1.25   _      _     )"_

   yCpts=:0.3 2 50,(0.1,(1p1-0.1),28),0 2p1 50,:1 8 50"_

   $(gXT hkAy]) (1000 yCrandom yCpts)''
11
   $(gXT hkAx]) (1000 yCrandom yCpts)''
11



Download: File:LTT0000C.txt
Download: File:LTT0001C.txt
Download: File:LTT0002C.txt
Download: File:LTT0003C.txt
Download: File:LTT0004C.txt
Download: File:LTT0005C.txt
Download: File:LTT0006C.txt
Download: File:LTT0007C.txt
Download: File:LTT0008C.txt
Download: File:LTT0009C.txt
Download: File:LTT0010C.txt
Download: File:LTT0011C.txt
Download: File:LTT0012C.txt
Download: File:LTT0013C.txt
Download: File:LTT0014C.txt




Download MoinMoin source: File:TorsionTensor00.ijs




Next Page: Essays/Torsion Tensor/TorsionTensor01
Prev Page: Essays/Torsion Tensor




Contributed by Tom Allen