Essays/Schwarzschild/Schwarzschild02

From J Wiki
Jump to navigation Jump to search


GSC0200C.jpg


NB. ... script Schwarzschild.ijs (continued) ...

S00type     =:(<00 00)"_
S01config   =:(01 00;01 01;01 02;01 03;01 04;01 05)"_
S02xL       =:(02 00;02 01;02 02;02 03)"_
S03xH       =:(03 00;03 01;03 02;03 03)"_
S04dxL      =:(04 00;04 01;04 02;04 03)"_
S05dxH      =:(05 00;05 01;05 02;05 03)"_
   S0503dx4 =:(<05 03)"_
S06ctrl     =:(06 00;06 01;06 02;06 03;06 04;06 05)"_
   S0600ds  =:(<06 00)"_
   S0601dxR =:(<06 01)"_
   S0602dxI =:(<06 02)"_
   S0603lmt =:(<06 03)"_
   S0604nmbr=:(<06 04)"_
   S0605max =:(<06 05)"_
S07incr     =:(<07 00)"_
S08d2       =:(08 00;08 01;08 02;08 03)"_
S09d1L      =:(09 00;09 01;09 02;09 03)"_
S10d1H      =:(10 00;10 01;10 02;10 03)"_
S11count    =:(11 00;11 01)"_
   S1100nmbr=:(<11 00)"_
   S1101max =:(<11 01)"_

vS00=:(S00type  ;vS00type)U]
vS01=:(S01config;vS01config)U]
vS03=:(S03xH    ;vS03xH)U]
vS05=:(S05dxH   ;vS05dxH)U]
vS06=:(S06ctrl  ;vS06ctrl)U]
vS11=:(S11count ;vS11count)U]

vS=:vS11@vS06@vS05@vS03@vS01@vS00@(12 6$_"_)

NB. ... binary search ...

vSbNdx4Nxt=:(S0503dx4;(S0601dxR{])+((S0602dxI{])-S0601dxR{])%2:)U]
vSbNdx4ds =:(S0600ds;%:@(((S01config{])([gcv gg)S03xH{])+/@(+/)@:*(]*/])@(S05dxH{])))U]
vSbNdx4set=:((S0601dxR;S0503dx4{])U])`((S0602dxI;S0503dx4{])U])@.(0-:0{+.@(S0600ds{]))
vSbNnmbr  =:(S0604nmbr;1+S0604nmbr{])U]
vSbNcycl  =:vSbNnmbr@vSbNdx4set@vSbNdx4ds@vSbNdx4Nxt
vSbN      =:vSbNcycl`]@.((|@(S0600ds{])<S0603lmt{])+.(S0604nmbr{])=S0605max{])^:a:


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

   gg=:gs                     NB. ... set the metric ...

   vS00type  =:0"_
   vS01config=:1.5,1.5,0,0,0,0"_
   vS03xH    =:5.7,0.5p1,0,0"_
   vS05dxH   =:0,0,0.01,0"_
   vS06ctrl  =:1,0.05,0.06,(2^_30),0,100"_
   vS11count =:0,350"_

NB. ... origin for null geodesic (world line of light) ...

   (9!:11)16
   {:@vSbN@vS''
                      0                   _                   _                     _  _   _
                    1.5                 1.5                   0                     0  0   0
                      _                   _                   _                     _  _   _
                    5.7   1.570796326794897                   0                     0  _   _
                      _                   _                   _                     _  _   _
                      0                   0                0.01   0.05521271995151521  _   _
0j6.585445079827193e_10 0.05521271995151519 0.05521271995151521 9.313225746154785e_10 49 100
                      _                   _                   _                     _  _   _
                      _                   _                   _                     _  _   _
                      _                   _                   _                     _  _   _
                      _                   _                   _                     _  _   _
                      0                 350                   _                     _  _   _


NB. ... script Schwarzschild.ijs (continued) ...

vSgDiTinvf=:((0{])^2:)+((1{])^2:)+((2{])^2:)+(3{])^2:
vSgDiTnull=:(S07incr;(S03xH{])(vSgDiTinvf@([+])-vSgDiTinvf@[)S05dxH{])U]
vSgDiTds  =:(S07incr;%:@(((S01config{])([gcv gg)S03xH{])+/@(+/)@:*(]*/])@(S05dxH{])))U]
vSgDiTd1  =:(S10d1H;(S05dxH{])%S07incr{])U]
vSgDiTinit=:vSgDiTd1@(vSgDiTnull@{:@vSbN`vSgDiTds@.(S00type{]))

vSgDxHtoL =:((S03xH;0 0 0 0"_)U])@((S02xL;S03xH{])U])
vSgDdxHtoL=:((S05dxH;0 0 0 0"_)U])@((S04dxL;S05dxH{])U])
vSgDdsClr =:((S0600ds;0:)U])@((S06ctrl;$@(S06ctrl{])$_"_)U])
vSgDd2Clr =:(S08d2;0 0 0 0"_)U]
vSgDd1HtoL=:((S10d1H;0 0 0 0"_)U])@((S09d1L;S10d1H{])U])
vSgDsetup =:vSgDd1HtoL@vSgDd2Clr@vSgDdsClr@vSgDdxHtoL@vSgDxHtoL

vSgDdxH =:(S05dxH;(S09d1L{])*S07incr{])U]
vSgDxH  =:(S03xH;(S02xL{])+S05dxH{])U]
vSgDds  =:(S0600ds;%:@(((S01config{])([gcv gg)S02xL{])+/@(+/)@:*(]*/])@(S05dxH{])))U]
vSgDd2  =:(S08d2;-@(((S01config{])([ch2k gg)S02xL{])+/"1@((<0 2)|:(0|:[)smx])(]*/])@(S09d1L{])))U]
vSgDd1H =:(S10d1H;(S09d1L{])+(S08d2{])*S07incr{])U]
vSgDnmbr=:(S1100nmbr;1+S1100nmbr{])U]
vSgDcycl=:vSgDnmbr@vSgDd1H@vSgDd2@vSgDds@vSgDxH@vSgDdxH@vSgDsetup
vSgD    =:vSgDcycl`]@.((S1100nmbr{])=S1101max{])^:a:@vSgDiTinit

vSgDplot=:<"1@(0|:])@:({."1)@:+.@:(((cx1*cos@cx3),cx1*sin@cx3)@(S03xH{])"2)


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

gg=:gs                     NB. ... set the metric ...

load 'plot'
pd 'title geodesics'

NB. ... null geodesic (blue) ...

vS00type  =:0"_
vS01config=:1.5,1.5,0,0,0,0"_
vS03xH    =:5.7,0.5p1,0,0"_
vS05dxH   =:0,0,0.01,0"_
vS06ctrl  =:1,0.05,0.06,(2^_30),0,100"_
vS11count =:0,350"_
pd vSgDplot vSgD@vS''

NB. ... 'spacelike' (red) ...

vS00type  =:1"_
vS01config=:1.5,1.5,0,0,0,0"_
vS03xH    =:5.7,0.5p1,0,0"_
vS05dxH   =:0,0,0.01,0.05"_
vS06ctrl  =:1,_,_,_,_,_"_
vS11count =:0,350"_
pd vSgDplot vSgD@vS''

NB. ... 'timelike' (green) ...

vS00type  =:1"_
vS01config=:1.5,1.5,0,0,0,0"_
vS03xH    =:5.7,0.5p1,0,0"_
vS05dxH   =:0,0,0.01,0.06"_
vS06ctrl  =:1,_,_,_,_,_"_
vS11count =:0,350"_
pd vSgDplot vSgD@vS''

NB. ...
NB. ... complete with opposite direction ...
NB. ...

NB. ... null geodesic ...

vS00type  =:0"_
vS01config=:1.5,1.5,0,0,0,0"_
vS03xH    =:5.7,0.5p1,0,0"_
vS05dxH   =:0,0,_0.01,0"_
vS06ctrl  =:1,0.05,0.06,(2^_30),0,100"_
vS11count =:0,350"_
pd vSgDplot vSgD@vS''

NB. ... 'spacelike' ...

vS00type  =:1"_
vS01config=:1.5,1.5,0,0,0,0"_
vS03xH    =:5.7,0.5p1,0,0"_
vS05dxH   =:0,0,_0.01,0.05"_
vS06ctrl  =:1,_,_,_,_,_"_
vS11count =:0,350"_
pd vSgDplot vSgD@vS''

NB. ... 'timelike' ...

vS00type  =:1"_
vS01config=:1.5,1.5,0,0,0,0"_
vS03xH    =:5.7,0.5p1,0,0"_
vS05dxH   =:0,0,_0.01,0.06"_
vS06ctrl  =:1,_,_,_,_,_"_
vS11count =:0,350"_
pd vSgDplot vSgD@vS''

pd 'pdf'
pd 'show'


SCSchwarzschild0200.jpg


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

   gg=:gs                     NB. ... set the metric ...

NB. ... null geodesic ...

   vS00type  =:0"_
   vS01config=:1.5,1.5,0,0,0,0"_
   vS03xH    =:5.7,0.5p1,0,0"_
   vS05dxH   =:0,0,0.01,0"_
   vS06ctrl  =:1,0.05,0.06,(2^_30),0,100"_
   vS11count =:0,350"_

   *./ (0=]) ((2^_9)tsz]) (S0600ds{])"2@vSgD@vS''
1



Download: File:LSC0200C.txt




Download MoinMoin source: File:Schwarzschild02.ijs




Next Page: Essays/Schwarzschild/Schwarzschild03
Prev Page: Essays/Schwarzschild/Schwarzschild01




Contributed by Tom Allen