Essays/Christoffel/Christoffel04
10.5 Covariant Differentiation (ISS Section 33)
NB. ... script (ijs) ... f=:(*:@x1**:@sin@x2*x3)"1
NB. ... execute (ijx) ... $f xpgen'' 8000
NB. ... script (ijs) ... A=:((2*x1**:@sin@x2*x3),(2**:@x1*sin@x2*cos@x2*x3),*:@x1**:@sin@x2)"1
NB. ... execute (ijx) ... $A xpgen'' 8000 3
...
... check using the 'D.' primitive ...
...
NB. ... execute (ijx) ... +/@:((A((2^_21)teq[;])f D.1)"1) xpgen'' 8000
NB. ... script (ijs) ... B=:axs@((0;dxdy),0;A)"1
NB. ... execute (ijx) ... $B xpgen'' 8000 3
...
... check using the 'D.' primitive ...
...
NB. ... execute (ijx) ... NB. ... example ... nzmin B xpgen'' 0.00220366 nzmin (2^_21)&tsz@(f@cxx D.1@cyy)"1 xpgen'' 0.00220367 nzmax B xpgen'' 29.1275 nzmax (2^_21)&tsz@(f@cxx D.1@cyy)"1 xpgen'' 29.1275 nzcount B xpgen'' 16000 nzcount (2^_21)&tsz@(f@cxx D.1@cyy)"1 xpgen'' 16000 NB. ... so ... +/@:((B((2^_19)teq[;])(2^_21)&tsz@(f@cxx D.1@cyy))"1) xpgen'' 8000
NB. ... script (ijs) ... dAdx0=:(2**:@sin@x2*x3),(4*x1*(sin@x2*cos@x2)*x3),2*x1**:@sin@x2 dAdx1=:(4*x1*(sin@x2*cos@x2)*x3),(2**:@x1*(*:@cos@x2-*:@sin@x2)*x3),2**:@x1*sin@x2*cos@x2 dAdx2=:(2*x1**:@sin@x2),(2**:@x1*sin@x2*cos@x2),0: dAdx =:(3 3$dAdx0,dAdx1,dAdx2)"1
NB. ... execute (ijx) ... $dAdx xpgen'' 8000 3 3
...
... check using the 'D.' primitive ...
...
NB. ... execute (ijx) ... +/@:((dAdx((2^_19)teq[;])0|:A D.1)"1) xpgen'' 8000
NB. ... script (ijs) ... d2Adxdx00=:0,(4*(sin@x2*cos@x2)*x3),2**:@sin@x2 d2Adxdx01=:(4*(sin@x2*cos@x2)*x3),(4*x1*(*:@cos@x2-*:@sin@x2)*x3),4*x1*sin@x2*cos@x2 d2Adxdx02=:(2**:@sin@x2),(4*x1*sin@x2*cos@x2),0: d2Adxdx10=:(4*(sin@x2*cos@x2)*x3),(4*x1*(*:@cos@x2-*:@sin@x2)*x3),4*x1*sin@x2*cos@x2 d2Adxdx11=:(4*x1*(*:@cos@x2-*:@sin@x2)*x3),(-@(8**:@x1*(sin@x2*cos@x2)*x3)),2**:@x1**:@cos@x2-*:@sin@x2 d2Adxdx12=:(4*x1*sin@x2*cos@x2),(2**:@x1**:@cos@x2-*:@sin@x2),0: d2Adxdx20=:(2**:@sin@x2),(4*x1*sin@x2*cos@x2),0: d2Adxdx21=:(4*x1*sin@x2*cos@x2),(2**:@x1**:@cos@x2-*:@sin@x2),0: d2Adxdx22=:0,0,0: d2Adxdx0=:d2Adxdx00,d2Adxdx01,d2Adxdx02 d2Adxdx1=:d2Adxdx10,d2Adxdx11,d2Adxdx12 d2Adxdx2=:d2Adxdx20,d2Adxdx21,d2Adxdx22 d2Adxdx =:(3 3 3$d2Adxdx0,d2Adxdx1,d2Adxdx2)"1
NB. ... execute (ijx) ... $d2Adxdx xpgen'' 8000 3 3 3
...
... check using the 'D.' primitive ...
...
NB. ... execute (ijx) ... +/@:((d2Adxdx((2^_19)teq[;])0|:dAdx D.1)"1) xpgen'' 8000
NB. ... script (ijs) ... dBdyt1p0=:axs@((0;dxdy),1;dAdx) dBdyt1 =:axs@((0;dxdy),1;dBdyt1p0) dBdyt2p0=:axs@((2;d2xdydx),0;dxdy) dBdyt2 =:axs@((0;dBdyt2p0),0;A) dBdy =:(dBdyt1(+tz)dBdyt2)"1
NB. ... execute (ijx) ... $dBdy xpgen'' 8000 3 3
...
... check using the 'D.' primitive ...
...
NB. ... execute (ijx) ... +/@:((dBdy((2^_19)teq[;])(2^_23)&tsz@(0|:B@cxx D.1@cyy))"1) xpgen'' 8000
NB. ... script (ijs) ... Acv=:(dAdx(-tz)axs@((2;hC2k),0;A))"1
NB. ... execute (ijx) ... $Acv xpgen'' 8000 3 3
NB. ... script (ijs) ... Bcv=:(dBdy(-tz)axs@((2;gC2k),0;B))"1
NB. ... execute (ijx) ... $Bcv xpgen'' 8000 3 3
NB. ... execute (ijx) ... s0t1p0=:axs@((0;dxdy),1;Acv) s0t1 =:axs@((0;dxdy),1;s0t1p0) +/@:((Bcv-:s0t1)"1) xpgen'' 8000
NB. ... script (ijs) ... dAcvdx=:(d2Adxdx(-tz)axs@((2;dhC2kdx),0;A)(+tz)axs@((2;hC2k),0;dAdx))"1
NB. ... execute (ijx) ... $dAcvdx xpgen'' 8000 3 3 3
...
... check using the 'D.' primitive ...
...
NB. ... execute (ijx) ... +/@:((dAcvdx((2^_19)teq[;])0|:Acv D.1)"1) xpgen'' 8000
NB. ... script (ijs) ... Acvcvp0=:(dAcvdx(-tz)(1|:axs@((2;hC2k),0;Acv))(+tz)0|:0|:axs@((2;hC2k),1;Acv))"1 Acvcv =:(2^_42)&tsz@Acvcvp0 NB. special
NB. ... execute (ijx) ... $Acvcv xpgen'' 8000 3 3 3 nzmin Acvcvp0 xpgen'' 5.68434e_14 nzmin Acvcv xpgen'' 0.0244717
NB. ... script (ijs) ... Bcvcvp0=:axs@((0;dxdy),2;Acvcv) Bcvcvp1=:axs@((0;dxdy),2;Bcvcvp0) Bcvcv =:axs@((0;dxdy),2;Bcvcvp1)"1
NB. ... execute (ijx) ... $Bcvcv xpgen'' 8000 3 3 3
NB. ... execute (ijx) ... NB. ... for this xpgen ... NB. ... values calculated are within a reasonable range ... nf0=:cxx;cyy;dxdy;dydx;d2xdydx;d2ydxdx;h20;h02;dh20dx;hC1k;hC2k;dhC2kdx nf1=:f;A;B;dAdx;d2Adxdx;dBdy;Acv;Bcv;dAcvdx;Acvcv;Bcvcv (0j_3&":@nzmin;0j_3&":@nzmax;6&":@nzcount)&>@(nf0,nf1) xpgen'' ┌────────┬───────┬──────┐ │1.571e_2│1.020e1│ 24000│ ├────────┼───────┼──────┤ │1.224e_2│9.877e0│ 24000│ ├────────┼───────┼──────┤ │2.447e_3│1.263e1│ 64000│ ├────────┼───────┼──────┤ │1.224e_2│9.877e0│ 64000│ ├────────┼───────┼──────┤ │2.447e_4│7.973e1│152000│ ├────────┼───────┼──────┤ │1.224e_2│9.877e0│152000│ ├────────┼───────┼──────┤ │6.118e_3│1.000e2│ 24000│ ├────────┼───────┼──────┤ │1.000e_2│1.635e2│ 24000│ ├────────┼───────┼──────┤ │2.447e_2│9.978e1│ 24000│ ├────────┼───────┼──────┤ │1.224e_2│4.989e1│ 72000│ ├────────┼───────┼──────┤ │1.224e_2│1.000e1│ 72000│ ├────────┼───────┼──────┤ │1.000e_2│4.086e1│ 80000│ ├────────┼───────┼──────┤ │9.610e_4│1.379e2│ 8000│ ├────────┼───────┼──────┤ │3.844e_3│1.411e2│ 24000│ ├────────┼───────┼──────┤ │2.204e_3│2.913e1│ 16000│ ├────────┼───────┼──────┤ │5.191e_3│2.689e2│ 64000│ ├────────┼───────┼──────┤ │2.076e_2│5.643e2│152000│ ├────────┼───────┼──────┤ │5.142e_3│3.136e0│ 32000│ ├────────┼───────┼──────┤ │1.922e_3│2.758e2│ 72000│ ├────────┼───────┼──────┤ │5.142e_3│3.136e0│ 32000│ ├────────┼───────┼──────┤ │7.688e_3│2.821e2│176000│ ├────────┼───────┼──────┤ │2.447e_2│3.902e2│ 8000│ ├────────┼───────┼──────┤ │1.550e_3│4.927e1│ 64000│ └────────┴───────┴──────┘
Download: File:LCH0400C.txt
Download: File:LCH0401C.txt
Download: File:LCH0403C.txt
Download: File:LCH0405C.txt
Download: File:LCH0407C.txt
Download: File:LCH0409C.txt
Download: File:LCH0411C.txt
Download: File:LCH0412C.txt
Download: File:LCH0413C.txt
Download: File:LCH0414C.txt
Download: File:LCH0415C.txt
Download: File:LCH0416C.txt
Download: File:LCH0418C.txt
Download: File:LCH0419C.txt
Download MoinMoin source: File:Christoffel04.ijs
Next Page: Essays/Christoffel/Christoffel05
Prev Page: Essays/Christoffel/Christoffel03
Contributed by Tom Allen