Essays/SpaceTime2D/SpaceTime2D01

From J Wiki
Jump to navigation Jump to search


1 References

1. 'Mathematics of Physics and Modern Engineering' by I. S. Sokolnikoff and R. M. Redheffer (Second Edition, 1966).
2. 'Applications of the Absolute Differential Calculus' by A. J. McCONNELL.
3. 'Tensor Analysis' by I. S. Sokolnikoff (Second Edition, 1964).


2 Verbs

2.1 General
NB. ... script SpaceTime2D.ijs ...

gXR0=:>@(0{])
gXR1=:>@(1{])

gXL0=:>@(0{[)
gXL1=:>@(1{[)

gXo1=:>@(0{[)
gXo2=:>@(1{[)
gXa0=:>@(2{[)
gXb0=:>@(3{[)
gXc =:>@(4{[)
gXID=:>@(5{[)

NB. ... from 'numeric' ...

gXsteps=:{.+(1&{-{.)*(i.@>:%])@{:

NB. ... tolerant 'set zero' (see 'Essays/Tolerant Comparison') ...

gXtsz=:$@]$[0:`(I.@([>!.0|@]))`]},@]
gXts0=:(2^_44)&gXtsz

NB. ... tolerant 'equal' (see 'Essays/Tolerant Comparison') ...

gXteq=:*./@,@((>@(0{])|@:->@(1{]))<:!.0[*>@(0{])>.&:|>@(1{]))

NB. ... verbs useful for tolerant comparison ...

gXnzmin  =:<./@:|@((0<!.0|)#])@,
gXnzmax  =:>./@:|@((0<!.0|)#])@,
gXnzcount=:+/@(0<!.0|)@,

NB. ... axes sum ...

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

NB. ... trig verbs ...

sin=:1&o.
cos=:2&o.
arctant1=:(1p1+_3&o.@({:%{.))`( (2p1+_3&o.@({:%{.))`(_3&o.@({:%{.))@.(>:&0@{:) )@.(>&0@{.)
arctant0=:3r2p1"_`( 1r2p1"_)@.(>&0@{:)`0:@.(=&0@{:)
arctan  =:arctant1`arctant0@.(=&0@{.)"1

NB. ... jhostpath removed from J8 ...

jhostpath=:]


2.2 Bessel Functions

... Sokolnikoff and Redheffer Chapter 3 Section 21 ...

For the purpose of generating an arbitrary 2-dimensional spacetime manifold the Bessel
function of order 2 is used.

(see 'Studio->Demos->plot->Gallery->Drum')


GST0101C.jpg


GST0102C.jpg


NB. ... script SpaceTime2D.ijs (continued) ...

NB. ... when a0=1 ...

bSrhoG  =:>@(0{[)
bSderivG=:>@(1{[)
bSlimitG=:>@(2{[)

bSrhoR  =:>@(0{])
bSderivR=:>@(1{])
bSlimitR=:>@(2{])
bSsignR =:>@(3{])
bSxR    =:>@(4{])
bSnR    =:>@(5{])
bSmltR  =:>@(6{])
bStermR =:>@(7{])
bStotR  =:>@(8{])

bSrhoL  =:>@(0{[)
bSderivL=:>@(1{[)
bSlimitL=:>@(2{[)
bSsignL =:>@(3{[)
bSxL    =:>@(4{[)
bSnL    =:>@(5{[)
bSmltL  =:>@(6{[)
bStermL =:>@(7{[)
bStotL  =:>@(8{[)

NB. ... initial term ...

bSinitd0=:]^bSrhoG
bSinitd1=:bSrhoG*]^bSrhoG-1:
bSinitd2=:bSrhoG*(bSrhoG-1:)*]^bSrhoG-2:
bSinitd3=:bSrhoG*(bSrhoG-1:)*(bSrhoG-2:)*]^bSrhoG-3:
bSinitd4=:bSrhoG*(bSrhoG-1:)*(bSrhoG-2:)*(bSrhoG-3:)*]^bSrhoG-4:

NB. ... subsequent terms ...

bStermd0Mlt=:-@bSsignL*]
bStermd0Pwr=:(bSnL+2:)+bSrhoL
bStermd0   =:bStermd0Mlt*bSxL^bStermd0Pwr

bStermd1Mlt=:-@bSsignL*]*((bSnL+2:)+bSrhoL)
bStermd1Pwr=:(bSnL+2:)+bSrhoL-1:
bStermd1   =:bStermd1Mlt*bSxL^bStermd1Pwr

bStermd2Mlt=:-@bSsignL*]*((bSnL+2:)+bSrhoL)*((bSnL+2:)+bSrhoL-1:)
bStermd2Pwr=:(bSnL+2:)+bSrhoL-2:
bStermd2   =:bStermd2Mlt*bSxL^bStermd2Pwr

bStermd3Mlt=:-@bSsignL*]*((bSnL+2:)+bSrhoL)*((bSnL+2:)+bSrhoL-1:)*((bSnL+2:)+bSrhoL-2:)
bStermd3Pwr=:(bSnL+2:)+bSrhoL-3:
bStermd3   =:bStermd3Mlt*bSxL^bStermd3Pwr

bStermd4Mlt=:-@bSsignL*]*((bSnL+2:)+bSrhoL)*((bSnL+2:)+bSrhoL-1:)*((bSnL+2:)+bSrhoL-2:)*((bSnL+2:)+bSrhoL-3:)
bStermd4Pwr=:(bSnL+2:)+bSrhoL-4:
bStermd4   =:bStermd4Mlt*bSxL^bStermd4Pwr

NB. ... verbs ...

bSinpInit=:bSinitd0`bSinitd1`bSinitd2`bSinitd3`bSinitd4@.bSderivG
bSinp    =:(bSrhoG;bSderivG;bSlimitG;1;];0;1;(];])@bSinpInit)"1 0

bSmult=:%@((bSnR+2:)*(2*bSrhoR)+bSnR+2:)*bSmltR

bSnextTerm=:bStermd0`bStermd1`bStermd2`bStermd3`bStermd4@.bSderivL
bSnext    =:bSrhoL;bSderivL;bSlimitL;-@bSsignL;bSxL;(bSnL+2:);];bSnextTerm([;[+])bStotL

NB. ... Bessel ...

bSbssl=:bStotR"1@:(]`(] bSnext bSmult)@.((bSlimitR<|@bStermR)+.0(=!.0)bStermR)^:_"1)@:bSinp


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

NB. ... for example ...
NB. ... using p=0.75 and p=-0.75 ...

load 'plot'
pd (];( 0.75;0;2^_44)bSbssl]) gXsteps 0.01 11.62 101
pd (];(_0.75;0;2^_44)bSbssl]) gXsteps 0.5  11.62 101
pd 'pdf'
pd 'show'


STgraphic01.jpg
... real solutions for \rho=0.75 and \rho=-0.75 ...


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

NB. ... check derivatives ...
NB. ... for example, using p=2 ...

   (((2;1;2^_44)bSbssl])((2^_19)gXteq[;])((2;0;2^_44)bSbssl]) D.1)"0 gXsteps _11.62 11.62 21
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

   (((2;2;2^_44)bSbssl])((2^_14)gXteq[;])((2;1;2^_44)bSbssl]) D.1)"0 gXsteps _11.62 11.62 21
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

   (((2;3;2^_44)bSbssl])((2^_18)gXteq[;])((2;2;2^_44)bSbssl]) D.1)"0 gXsteps _11.62 11.62 21
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

   (((2;4;2^_44)bSbssl])((2^_17)gXteq[;])((2;3;2^_44)bSbssl]) D.1)"0 gXsteps _11.62 11.62 21
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1


GST0103C.jpg


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

NB. ... for example ...
NB. ... using p=0.75 ...

   p1a1t1=:(]^2:)*(0.75;2;2^_44)bSbssl]
   p1a1t2=:]*(0.75;1;2^_44)bSbssl]
   p1a1t3=:((]^2:)-0.75^2:)*(0.75;0;2^_44)bSbssl]
   p1a1  =:(p1a1t1+p1a1t2+p1a1t3)"0

   (0=!.0])@((2^_33)&gXtsz@:p1a1) gXsteps _11.62 11.62 21
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

NB. ... and ...
NB. ... using p=-0.75 ...

   p1a2t1=:(]^2:)*(_0.75;2;2^_44)bSbssl]
   p1a2t2=:]*(_0.75;1;2^_44)bSbssl]
   p1a2t3=:((]^2:)-_0.75^2:)*(_0.75;0;2^_44)bSbssl]
   p1a2  =:(p1a2t1+p1a2t2+p1a2t3)"0

   (0=!.0])@((2^_31)&gXtsz@:p1a2) gXsteps _11.62 11.62 21
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1


NB. ... script SpaceTime2D.ijs (continued) ...

NB. ... Bessel function of order 2 and derivatives ...

bSj2D0=:((2;0;2^_44)bSbssl])`0:@.(0=!.0])"0
bSj2D1=:((2;1;2^_44)bSbssl])`0:@.(0=!.0])"0
bSj2D2=:((2;2;2^_44)bSbssl])`2:@.(0=!.0])"0
bSj2D3=:((2;3;2^_44)bSbssl])`0:@.(0=!.0])"0
bSj2D4=:((2;4;2^_44)bSbssl])`0:@.(0=!.0])"0


2.3 Coordinates
STgraphic02.jpg
... coordinates ...


GST0104C.jpg


NB. ... script SpaceTime2D.ijs (continued) ...

NB. ... coordinates ...

cv1=:0{]
cv2=:1{]

cx1=:0{]
cx2=:1{]

cy1=:0{]
cy2=:1{]

cq1=:0{]
cq2=:1{]

NB. ... verbs ...

x1=:(cv1*cos@cv2)"1
x2=:(cv1*sin@cv2)"1
xc=:(x1,x2)"1

y1=:(cx1+gXo1)"1
y2=:(cx2+gXo2)"1
yc=:(y1,y2)"1

q1=:((*:@cy1+*:@cy2)^0.5"_)"1
q2=:arctan@(cy1,cy2)"1
qc=:(q1,q2)"1

t=:(gXa0*bSj2D0@(gXb0*cq1)*cos@(2*cq2))"1

vGen=:(0{])(,"0"0 1&gXsteps)1{]

xcC=:xc`(''"_)@.($@]-:1$0:)
ycC=:([(yc)xc)`(''"_)@.($@]-:1$0:)
qcC=:([qc[(yc)xc)`(''"_)@.($@]-:1$0:)


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

   p1b1=:gXts0@xcC-:gXts0@([((cy1-gXo1),cy2-gXo2)"1[((cq1*cos@cq2),cq1*sin@cq2)"1 qcC)
   (0.25;0.25;2;11.62;1) p1b1 vGen 0 0.646447 30,:0 2p1 100
1


2.4 Vibrating Drum

... Sokolnikoff and Redheffer Chapter 7 Section 15 ...

(see 'Studio->Demos->plot->Gallery->Drum')


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

load 'plot'
pd 'viewpoint 3 3 1'
pd 'viewsize 1 1 0.1'
pd (0;0;1;11.62;1) (x1;x2;[t qcC) vGen 0 1 30,:0 2p1 100
pd 'pdf'
pd 'show'


STgraphic03.jpg
... a surface ...



Download: File:LST0101C.txt
Download: File:LST0102C.txt
Download: File:LST0103C.txt
Download: File:LST0104C.txt




Download MoinMoin source: File:SpaceTime2D01.ijs




Next Page: Essays/SpaceTime2D/SpaceTime2D02
Prev Page: Essays/SpaceTime2D




Contributed by Tom Allen