# User:Tom Allen/TensorExperimentsZ00

NOTE: TensorExperimentsZ is stand-alone using verbs from Essays/TensorExperiments.

```NB. ... script experimentalZ.ijs ...

gXb10=:(<1 0){[   NB. powerR                               (standing wave)
gXb11=:(<1 1){[   NB. scaleR                               (standing wave)
gXb12=:(<1 2){[   NB. powerS                               (standing wave)
gXb13=:(<1 3){[   NB. frequency                            (standing wave)
gXb14=:(<1 4){[   NB. multiplier                           (standing wave)
gXb15=:(<1 5){[   NB.                                      (movement     )

gXZ=:gXcw,:gXbAll

gXb10XX=:gXb10;((1\$4:)\$0:);((2\$4:)\$0:);((3\$4:)\$0:);((4\$4:)\$0:);(5\$4:)\$0:
gXb11XX=:gXb11;((1\$4:)\$0:);((2\$4:)\$0:);((3\$4:)\$0:);((4\$4:)\$0:);(5\$4:)\$0:
gXb12XX=:gXb12;((1\$4:)\$0:);((2\$4:)\$0:);((3\$4:)\$0:);((4\$4:)\$0:);(5\$4:)\$0:
gXb13XX=:gXb13;((1\$4:)\$0:);((2\$4:)\$0:);((3\$4:)\$0:);((4\$4:)\$0:);(5\$4:)\$0:
gXb14XX=:gXb14;((1\$4:)\$0:);((2\$4:)\$0:);((3\$4:)\$0:);((4\$4:)\$0:);(5\$4:)\$0:
gXb15XX=:gXb15;((1\$4:)\$0:);((2\$4:)\$0:);((3\$4:)\$0:);((4\$4:)\$0:);(5\$4:)\$0:

cz0=:0{]
cz1=:1{]
cz2=:2{]
cz3=:3{]

cz0XX=:cz0;(1,0,0,0:);((2\$4:)\$0:);((3\$4:)\$0:);((4\$4:)\$0:);(5\$4:)\$0:
cz1XX=:cz1;(0,1,0,0:);((2\$4:)\$0:);((3\$4:)\$0:);((4\$4:)\$0:);(5\$4:)\$0:
cz2XX=:cz2;(0,0,1,0:);((2\$4:)\$0:);((3\$4:)\$0:);((4\$4:)\$0:);(5\$4:)\$0:
cz3XX=:cz3;(0,0,0,1:);((2\$4:)\$0:);((3\$4:)\$0:);((4\$4:)\$0:);(5\$4:)\$0:

NB. ... open/get/put/close array on disk file (utility verbs) ...

arrayPath=:jpath '~temp\'

arrayOpen =:                    1!:21@<@(arrayPath"_,])
arrayGet  =:                [\$_".1!:1@<@(arrayPath"_,])
arrayPut  =:[(":!.17@,@[(1!:2)1!:21@])<@(arrayPath"_,])
arrayClose=:                    1!:22@<@(arrayPath"_,])
```

```NB. ... script experimentalZ.ijs ...

zPy=:cy0,cy1,cy2,cy3
yPz=:cz0,cz1,cz2,cz3

zpts=:[zPy"_ 1 ypts
```

```NB. ... script experimentalZ.ijs ...

zdy        =:1 0 0 0,0 1 0 0,0 0 1 0,:0 0 0 1"_
zdydy      =:(3\$4:)\$0:
zdydydy    =:(4\$4:)\$0:
zdydydydy  =:(5\$4:)\$0:
zdydydydydy=:(6\$4:)\$0:

ydz        =:1 0 0 0,0 1 0 0,0 0 1 0,:0 0 0 1"_
ydzdz      =:(3\$4:)\$0:
ydzdzdz    =:(4\$4:)\$0:
ydzdzdzdz  =:(5\$4:)\$0:
ydzdzdzdzdz=:(6\$4:)\$0:
```

```NB. ... script experimentalZ.ijs ...

zdx        =:([zdy"_ 1 ypts)([smx 0|:])"2 2 ydx
zdxdx      =:([zdy"_ 1 ypts)([smx 0|:])"2 3 ydxdx
zdxdxdx    =:([zdy"_ 1 ypts)([smx 0|:])"2 4 ydxdxdx
zdxdxdxdx  =:([zdy"_ 1 ypts)([smx 0|:])"2 5 ydxdxdxdx
zdxdxdxdxdx=:([zdy"_ 1 ypts)([smx 0|:])"2 6 ydxdxdxdxdx
```

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

gXcw  =: _  0  _  _  _  _"_
gXbAll=: _  _  _  _  _  0"_

xCpts=:_ 1 3 27,_ 0 1p1 27,_ 0 2p1 27,:_ 0 20 27"_

A=:(gXZ([zdx         hkxAB)])                             ((0.1;50"_)pTRandom xCpts)''
B=:(gXZ(0|:[:(gXZ([(0{])@zpts      hkxAB),:@])D.1])"_ 1]) ((0.1;50"_)pTRandom xCpts)''

A (((2^_44);2^_19)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=:(gXZ([zdxdx       hkxAB)])                             ((0.1;50"_)pTRandom xCpts)''
B=:(gXZ(0|:[:(gXZ([(0{])@zdx       hkxAB),:@])D.1])"_ 1]) ((0.1;50"_)pTRandom xCpts)''

A (((2^_44);2^_19)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=:(gXZ([zdxdxdx     hkxAB)])                             ((0.1;50"_)pTRandom xCpts)''
B=:(gXZ(0|:[:(gXZ([(0{])@zdxdx     hkxAB),:@])D.1])"_ 1]) ((0.1;50"_)pTRandom xCpts)''

A (((2^_44);2^_19)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=:(gXZ([zdxdxdxdx   hkxAB)])                             ((0.1;50"_)pTRandom xCpts)''
B=:(gXZ(0|:[:(gXZ([(0{])@zdxdxdx   hkxAB),:@])D.1])"_ 1]) ((0.1;50"_)pTRandom xCpts)''

A (((2^_44);2^_19)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

A=:(gXZ([zdxdxdxdxdx hkxAB)])                             ((0.1;50"_)pTRandom xCpts)''
B=:(gXZ(0|:[:(gXZ([(0{])@zdxdxdxdx hkxAB),:@])D.1])"_ 1]) ((0.1;50"_)pTRandom xCpts)''

A (((2^_44);2^_19)qteq[;])"6 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. ... script experimentalZ.ijs ...

xdz        =:(0        |:])"2@(([ydz"_ 1 zpts)(                                                                    ((0|:[)smx])"2 2)xdy        )
xdzdz      =:(0 1      |:])"3@(([ydz"_ 1 zpts)(                                                   [((0|:[)smx])"2 3((0|:[)smx])"2 3)xdydy      )
xdzdzdz    =:(0 1 2    |:])"4@(([ydz"_ 1 zpts)(                                  [((0|:[)smx])"2 4[((0|:[)smx])"2 4((0|:[)smx])"2 4)xdydydy    )
xdzdzdzdz  =:(0 1 2 3  |:])"5@(([ydz"_ 1 zpts)(                 [((0|:[)smx])"2 5[((0|:[)smx])"2 5[((0|:[)smx])"2 5((0|:[)smx])"2 5)xdydydydy  )
xdzdzdzdzdz=:(0 1 2 3 4|:])"6@(([ydz"_ 1 zpts)([((0|:[)smx])"2 6[((0|:[)smx])"2 6[((0|:[)smx])"2 6[((0|:[)smx])"2 6((0|:[)smx])"2 6)xdydydydydy)
```

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

gXcw  =: _  0  _  _  _  _"_
gXbAll=: _  _  _  _  _  0"_

xCpts=:_ 1 3 27,_ 0 1p1 27,_ 0 2p1 27,:_ 0 2 27"_

NB. ... a check ...

(gXZ(([([([([([ypts hkxAB)xpts)hkyAB)yPz"_ 1)[zpts hkxAB)-:"1[ypts hkxAB)])       ((0.1;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. ... derivatives ...

A=:(gXZ([xdz         hkxAB)])                                                     ((0.1;10"_)pTRandom xCpts)''
B=:(gXZ([(0|:[:(gXZ([([(0{])@xpts      hkyAB)yPz"_ 1),:@])D.1])"_ 1[zpts hkxAB)]) ((0.1;10"_)pTRandom xCpts)''

A (((2^_44);2^_21)qteq[;])"2 B
1 1 1 1 1 1 1 1 1 1

A=:(gXZ([xdzdz       hkxAB)])                                                     ((0.1;10"_)pTRandom xCpts)''
B=:(gXZ([(0|:[:(gXZ([([(0{])@xdz       hkyAB)yPz"_ 1),:@])D.1])"_ 1[zpts hkxAB)]) ((0.1;10"_)pTRandom xCpts)''

A (((2^_44);2^_20)qteq[;])"3 B
1 1 1 1 1 1 1 1 1 1

A=:(gXZ([xdzdzdz     hkxAB)])                                                     ((0.1;10"_)pTRandom xCpts)''
B=:(gXZ([(0|:[:(gXZ([([(0{])@xdzdz     hkyAB)yPz"_ 1),:@])D.1])"_ 1[zpts hkxAB)]) ((0.1;10"_)pTRandom xCpts)''

A (((2^_44);2^_18)qteq[;])"4 B
1 1 1 1 1 1 1 1 1 1

A=:(gXZ([xdzdzdzdz   hkxAB)])                                                     ((0.1;10"_)pTRandom xCpts)''
B=:(gXZ([(0|:[:(gXZ([([(0{])@xdzdzdz   hkyAB)yPz"_ 1),:@])D.1])"_ 1[zpts hkxAB)]) ((0.1;10"_)pTRandom xCpts)''

A (((2^_44);2^_15)qteq[;])"5 B
1 1 1 1 1 1 1 1 1 1

A=:(gXZ([xdzdzdzdzdz hkxAB)])                                                     ((0.1;10"_)pTRandom xCpts)''
B=:(gXZ([(0|:[:(gXZ([([(0{])@xdzdzdzdz hkyAB)yPz"_ 1),:@])D.1])"_ 1[zpts hkxAB)]) ((0.1;10"_)pTRandom xCpts)''

A (((2^_44);2^_11)qteq[;])"6 B
1 1 1 1 1 1 1 1 1 1
```