User:Tom Allen/TensorExperimentsR12

From J Wiki
Jump to navigation Jump to search


NB. ... script experimentalR.ijs ...

rfaV28=:(gXRa06*cx2)+gXRa07*cx3

rfaV28XX=:([cfMP4 gXRa06XX,:cx2XX)+&.>[cfMP4 gXRa07XX,:cx3XX


rfaV29=:sin@rfaV28

rfaV29XX=:[cfFN4(sin@rfaV28;cos@rfaV28;-@sin@rfaV28;-@cos@rfaV28;sin@rfaV28;cos@rfaV28),:rfaV28XX


rfaV30=:cos@rfaV28

rfaV30XX=:[cfFN4(cos@rfaV28;-@sin@rfaV28;-@cos@rfaV28;sin@rfaV28;cos@rfaV28;-@sin@rfaV28),:rfaV28XX


rfaV31=:rfaV29+rfaV30

rfaV31XX=:rfaV29XX+&.>rfaV30XX


NB. ... script experimentalR.ijs ...

rfaV32=:gXRa00*cx0*sin@cx1

rfaV32XX=:[cfMP4 gXRa00XX,:[cfMP4 cx0XX,:[cfFN4(sin@cx1;cos@cx1;-@sin@cx1;-@cos@cx1;sin@cx1;cos@cx1),:cx1XX


rfaV33=:rfaV32*rfaV21*rfaV27*rfaV31+gXRa08

rfaV33XX=:[cfMP4 rfaV32XX,:[cfMP4 rfaV21XX,:[cfMP4 rfaV27XX,:rfaV31XX+&.>gXRa08XX


rfaV34=:rfaV33*-@sin@cx2

rfaV34XX=:[cfMP4 rfaV33XX,:[cfFN4(-@sin@cx2;-@cos@cx2;sin@cx2;cos@cx2;-@sin@cx2;-@cos@cx2),:cx2XX


rfaV35=:rfaV33*cos@cx2

rfaV35XX=:[cfMP4 rfaV33XX,:[cfFN4(cos@cx2;-@sin@cx2;-@cos@cx2;sin@cx2;cos@cx2;-@sin@cx2),:cx2XX


NB. ... script experimentalR.ijs ...

rfaV36=:gXRa00*rfaV21*rfaV27*rfaV31+gXRa08

rfaV36XX=:[cfMP4 gXRa00XX,:[cfMP4 rfaV21XX,:[cfMP4 rfaV27XX,:rfaV31XX+&.>gXRa08XX


NB. ... script experimentalR.ijs ...

rfaV37=:-@gXRa00*gXRa06*%@gXRa07

rfaV37XX=:(-@gXRa00*gXRa06*%@gXRa07);((1$4:)$0:);((2$4:)$0:);((3$4:)$0:);((4$4:)$0:);(5$4:)$0:


rfaV38=:rfaV37*rfaV21*rfaV27*rfaV31+gXRa09

rfaV38XX=:[cfMP4 rfaV37XX,:[cfMP4 rfaV21XX,:[cfMP4 rfaV27XX,:rfaV31XX+&.>gXRa09XX


NB. ... script experimentalR.ijs ...

rfaV39XX=:[rfTT4([rfxXXS rfyc),:rfaV34XX
rfaV40XX=:[rfTT4([rfxXXS rfyc),:rfaV35XX
rfaV41XX=:[rfTT4([rfxXXS rfyc),:rfaV38XX

rfaV42=:rfaV34,rfaV35,0,rfaV38

rfaV42XX=:<@:>"1@(0|:])@(rfaV39XX,rfaV40XX,gXR400XX,:rfaV41XX)


NB. ... script experimentalR.ijs ...

rfaV43=:0,0,rfaV36,rfaV38

rfaV43XX=:<@:>"1@(0|:])@(gXR400XX,gXR400XX,rfaV36XX,:rfaV38XX)


NB. ... script experimentalR.ijs ...

NB. ... hkyR03 is not required (only x points to be used as input) ...

hkxR03=:hkxR02,<@:>"1@(0|:])@:(rfaV42XX"_ 1),:<@:>"1@(0|:])@:(rfaV43XX"_ 1)


NB. ... script experimentalR.ijs ...

gXS=:gXSAll

hkxRutil=:<@:>"1@(0|:])@:(rfaV42XX"_ 1),:<@:>"1@(0|:])@:(rfaV43XX"_ 1)

hkxR03S=:hkxR02,hkxRutil+&.>"1 gXS hkxRutil]


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

   gXRAll=:,:@(1 1 2 8 1 1 1 _1 0 0"_)
   
   xCpts=:_ 0.7 1.3 26,_ 0.4p1 0.6p1 26,_ 0 2p1 26,:_ 0 2p1 26"_
   
   A=:(gXR([Ocndc       xRef@hkxR03)])                               ((0;50"_)pTRandom xCpts)''
   B=:(gXR((0|:[:(gXR([(0{])@Ocn       xRef@hkxR03),:@])D.1])"_ 1)]) ((0;50"_)pTRandom xCpts)''
   
   A (((2^_44);2^_17)qteq[;])"2 B
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

   A=:(gXR([Ocndcdc     xRef@hkxR03)])                               ((0;50"_)pTRandom xCpts)''
   B=:(gXR((0|:[:(gXR([(0{])@Ocndc     xRef@hkxR03),:@])D.1])"_ 1)]) ((0;50"_)pTRandom xCpts)''
   
   A (((2^_44);2^_14)qteq[;])"3 B
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

   A=:(gXR([Ocndcdcdc   xRef@hkxR03)])                               ((0;50"_)pTRandom xCpts)''
   B=:(gXR((0|:[:(gXR([(0{])@Ocndcdc   xRef@hkxR03),:@])D.1])"_ 1)]) ((0;50"_)pTRandom xCpts)''
   
   A (((2^_44);2^_09)qteq[;])"4 B
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

   A=:(gXR([Ocndcdcdcdc xRef@hkxR03)])                               ((0;50"_)pTRandom xCpts)''
   B=:(gXR((0|:[:(gXR([(0{])@Ocndcdcdc xRef@hkxR03),:@])D.1])"_ 1)]) ((0;50"_)pTRandom xCpts)''
   
   A (((2^_44);2^_09)qteq[;])"5 B
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


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

   gXRAll=:,:@(1 1 2 8 1 1 1 _1 0 0"_)
   
   xCpts=:_ 0.7 1.3 21,_ 0.4p1 0.6p1 21,_ 0.01p1 1.99p1 21,:_ 0 2p1 21"_
   
   A=:(gXR([Ocndc       yRef@hkxR03)])                                           ((0;50"_)pTRandom xCpts)''
   B=:(gXR((0|:[:(gXR([(0{])@Ocn       yRef@([hkxR03 rfxc"_ 1)),:@])D.1])"_ 1)]) ((0;50"_)rfyc"1@pTRandom xCpts)''
   
   A (((2^_44);2^_12)qteq[;])"2 B
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
   
   A=:(gXR([Ocndcdc     yRef@hkxR03)])                                           ((0;50"_)pTRandom xCpts)''
   B=:(gXR((0|:[:(gXR([(0{])@Ocndc     yRef@([hkxR03 rfxc"_ 1)),:@])D.1])"_ 1)]) ((0;50"_)rfyc"1@pTRandom xCpts)''
   
   A (((2^_44);2^_11)qteq[;])"3 B
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
   
   A=:(gXR([Ocndcdcdc   yRef@hkxR03)])                                           ((0;50"_)pTRandom xCpts)''
   B=:(gXR((0|:[:(gXR([(0{])@Ocndcdc   yRef@([hkxR03 rfxc"_ 1)),:@])D.1])"_ 1)]) ((0;50"_)rfyc"1@pTRandom xCpts)''
   
   A (((2^_44);2^_10)qteq[;])"4 B
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
   
   A=:(gXR([Ocndcdcdcdc yRef@hkxR03)])                                           ((0;50"_)pTRandom xCpts)''
   B=:(gXR((0|:[:(gXR([(0{])@Ocndcdcdc yRef@([hkxR03 rfxc"_ 1)),:@])D.1])"_ 1)]) ((0;50"_)rfyc"1@pTRandom xCpts)''
   
   A (((2^_44);2^_08)qteq[;])"5 B
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


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

   gXRAll=:,:@(1 1 2 8 1 1 1 _1 0 0"_)
   
   xCpts=:_ 0.7 1.3 26,_ 0.4p1 0.6p1 26,_ 0 2p1 26,:_ 0 2p1 26"_
   
NB. ... divergence is 0 (conservation of energy) ...

   (0=]) ((2^_44)qtsz]) +/@((<0 1)|:])"2 (gXR([Ocncv yRef@hkxR03)]) ((0;50"_)pTRandom xCpts)''
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
   
   (0=]) ((2^_44)qtsz]) +/@((<0 1)|:])"2 (gXR([Ocncv xRef@hkxR03)]) ((0;50"_)pTRandom xCpts)''
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


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

   gXRAll=:,:@(1 1 2 8 1 1 1 _1 0 0"_)
   
   xCpts=:_ 0.7 1.3 26,_ 0.4p1 0.6p1 26,_ 0 2p1 26,:_ 0 2p1 26"_
   
NB. ... R is a tensor ...

   vA =:[R xRef
   vB0=:((0|:[)smx])"2 5
   vB1=:((0|:[)smx])"2 5
   vB2=:((0|:[)smx])"2 5
   vB3=:((0|:[)smx])"2 5
   vB4=:((   [)smx])"2 5
   vB =:[(xdy vB4 ydx vB3 ydx vB2 ydx vB1 ydx vB0 R)yRef

   (gXR([(vA(((2^_44);2^_28)qteq[;])"5 vB)hkxR03)]) ((0;50"_)pTRandom xCpts)''
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