Origin for each line in src/metric3d.red from check-in 5ce5316a33:

5ce5316a33 2021-03-01 jeff@gridfini: % Calculations concerning the special metric of Dieter Egger
5ce5316a33 2021-03-01 jeff@gridfini: % Small and capital letters are treated as being equivalent
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Dimension of space-time
5ce5316a33 2021-03-01 jeff@gridfini: n:=3;
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % turn off extra echoes
5ce5316a33 2021-03-01 jeff@gridfini: off echo;
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % smaller exponents first
5ce5316a33 2021-03-01 jeff@gridfini: on revpri;
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Coordinates
5ce5316a33 2021-03-01 jeff@gridfini: OPERATOR X$
5ce5316a33 2021-03-01 jeff@gridfini: X(0):=t$
5ce5316a33 2021-03-01 jeff@gridfini: X(1):=lambda0$
5ce5316a33 2021-03-01 jeff@gridfini: X(2):=lambda1$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Vectors (1-dim arrays start with index 0)
5ce5316a33 2021-03-01 jeff@gridfini: ARRAY U(n), V(n)$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % place (fixed to origin)
5ce5316a33 2021-03-01 jeff@gridfini: U(0):=a0*asin(t)$
5ce5316a33 2021-03-01 jeff@gridfini: U(1):=0$
5ce5316a33 2021-03-01 jeff@gridfini: U(2):=0$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Rule
5ce5316a33 2021-03-01 jeff@gridfini: trig1:={sin(~x)^2=>(1-cos(x)^2)}$
5ce5316a33 2021-03-01 jeff@gridfini: let trig1$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Procedure
5ce5316a33 2021-03-01 jeff@gridfini: procedure showMatrix(mm); begin
5ce5316a33 2021-03-01 jeff@gridfini: MATRIX hh(n,n)$
5ce5316a33 2021-03-01 jeff@gridfini: FOR I:=0:n-1 DO FOR J:=0:n-1 DO hh(I+1,J+1):=mm(I,J)$
5ce5316a33 2021-03-01 jeff@gridfini: write hh; end;
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Arrays (2-dim arrays start with indices (0,0))
5ce5316a33 2021-03-01 jeff@gridfini: ARRAY G(n,n), GINV(n,n), CHRIST(n,n,n), RIEM(n,n,n,n), RICCI(n,n), EINST(n,n)$
5ce5316a33 2021-03-01 jeff@gridfini: ARRAY EIT(n,n), ENI(n,n)$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Metric (cellar indices)
5ce5316a33 2021-03-01 jeff@gridfini: G(0,0):=a0^2/(1-t^2)$
5ce5316a33 2021-03-01 jeff@gridfini: G(1,1):=a0^2*(1-t^2)$
5ce5316a33 2021-03-01 jeff@gridfini: G(2,2):=a0^2*(1-t^2)*cos(lambda0)^2$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Inverse Metric (roof indices)
5ce5316a33 2021-03-01 jeff@gridfini: MATRIX MG(n,n), MGINV(n,n)$
5ce5316a33 2021-03-01 jeff@gridfini: FOR I:=0:n-1 DO FOR J:=0:n-1 DO MG(I+1,J+1):=G(I,J)$
5ce5316a33 2021-03-01 jeff@gridfini: MGINV:=1/MG$
5ce5316a33 2021-03-01 jeff@gridfini: FOR I:=0:n-1 DO FOR J:=0:n-1 DO GINV(I,J):=MGINV(I+1,J+1)$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: write "g = ",mg;
5ce5316a33 2021-03-01 jeff@gridfini: write "ginv = ",mginv;
5ce5316a33 2021-03-01 jeff@gridfini: write "g*ginv = ",mg*mginv;
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % velocity
5ce5316a33 2021-03-01 jeff@gridfini: for i:=0:n-1 do v(i):=df(u(i),t)$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % max. velocity
5ce5316a33 2021-03-01 jeff@gridfini: Array vmax(n)$
5ce5316a33 2021-03-01 jeff@gridfini: svmax:=a0/sqrt(1-t^2)$
5ce5316a33 2021-03-01 jeff@gridfini: for i:=0:n-1 do vmax(i):=svmax$
5ce5316a33 2021-03-01 jeff@gridfini: svmaxq:=svmax*svmax$
5ce5316a33 2021-03-01 jeff@gridfini: write "max. velocity = ",svmax;
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % energy impulse tensor (eit, roof indices)
5ce5316a33 2021-03-01 jeff@gridfini: for i:=0:n-1 do for j:=0:n-1 do eit(i,j):=v(i)*v(j)*(p/svmaxq + rho) - p * ginv(i,j)$  
5ce5316a33 2021-03-01 jeff@gridfini: write "eit roof = "; showMatrix(eit);
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % energy impulse tensor (eni, cellar indices, including kappa)
5ce5316a33 2021-03-01 jeff@gridfini: for i:=0:n-1 do for j:=0:n-1 do eni(i,j) := - kappa * for k:=0:n-1 sum g(i,k)* for l:=0:n-1 sum g(j,l)*eit(k,l)$
5ce5316a33 2021-03-01 jeff@gridfini: write "eni = -kappa*(eit cellar) = "; showMatrix(eni);
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Christoffel symbols (Fliessbach)
5ce5316a33 2021-03-01 jeff@gridfini: for k:=0:n-1 do for l:=0:n-1 do for m:=0:n-1 do CHRIST(k,l,m):= for n:=0:n-1 sum GINV(k,n)/2 * (DF(G(m,n),X(l)) + DF(G(l,n),X(m)) - DF(G(m,l),X(n)))$
5ce5316a33 2021-03-01 jeff@gridfini:   
5ce5316a33 2021-03-01 jeff@gridfini: % curvature tensor (Fliessbach)
5ce5316a33 2021-03-01 jeff@gridfini: for m:=0:n-1 do for i:=0:n-1 do for k:=0:n-1 do for p:=0:n-1 do RIEM(m,i,k,p) :=  DF(CHRIST(m,i,k),X(p)) - DF(CHRIST(m,i,p),X(k)) + FOR r:=0:n-1 SUM CHRIST(r,i,k)*CHRIST(m,r,p) - CHRIST(r,i,p)*CHRIST(m,r,k)$
5ce5316a33 2021-03-01 jeff@gridfini:  
5ce5316a33 2021-03-01 jeff@gridfini: % Ricci tensor (Fliessbach)
5ce5316a33 2021-03-01 jeff@gridfini: FOR I:=0:n-1 DO FOR J:=0:n-1 DO RICCI(I,J):= FOR M:=0:n-1 SUM RIEM(M,I,M,J)$
5ce5316a33 2021-03-01 jeff@gridfini: write "ricci = "; showMatrix(ricci);
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % curvature scalar
5ce5316a33 2021-03-01 jeff@gridfini: R:= FOR I:=0:n-1 SUM FOR J:=0:n-1 SUM GINV(I,J)*RICCI(I,J)$
5ce5316a33 2021-03-01 jeff@gridfini: write "curvature scalar r = ",r;
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Einstein tensor
5ce5316a33 2021-03-01 jeff@gridfini: FOR I:=0:n-1 DO FOR J:=0:n-1 DO EINST(I,J):=RICCI(I,J)-R/2*G(I,J)$
5ce5316a33 2021-03-01 jeff@gridfini: write "einstein = "; showMatrix(einst);
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % solving field equations
5ce5316a33 2021-03-01 jeff@gridfini: write "solving field equations ...";
5ce5316a33 2021-03-01 jeff@gridfini: on factor;
5ce5316a33 2021-03-01 jeff@gridfini: erho:=solve(eni(0,0)=einst(0,0),rho)$
5ce5316a33 2021-03-01 jeff@gridfini: write "mass density = ", erho;
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: ep:=solve(eni(1,1)=einst(1,1),p)$
5ce5316a33 2021-03-01 jeff@gridfini: write "pressure = ", ep;
5ce5316a33 2021-03-01 jeff@gridfini: off factor;
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: ferho:=sub(ep,erho)$
5ce5316a33 2021-03-01 jeff@gridfini: write "final mass density = ", ferho;
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: %--------------------------------------------------------------
5ce5316a33 2021-03-01 jeff@gridfini: % write results to file
5ce5316a33 2021-03-01 jeff@gridfini: OUT "metric3d_results.txt";
5ce5316a33 2021-03-01 jeff@gridfini: off echo;
5ce5316a33 2021-03-01 jeff@gridfini: off nat;
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Metric
5ce5316a33 2021-03-01 jeff@gridfini: write "metric = ";
5ce5316a33 2021-03-01 jeff@gridfini: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ", G(I,J)$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Inverse Metric
5ce5316a33 2021-03-01 jeff@gridfini: WRITE "inverse metric = ";
5ce5316a33 2021-03-01 jeff@gridfini: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ", GINV(I,J)$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Christoffel symbols
5ce5316a33 2021-03-01 jeff@gridfini: write "christoffel symbols = ";
5ce5316a33 2021-03-01 jeff@gridfini: FOR K:=0:n-1 DO FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",K,",",I,",",J,") = ", CHRIST(K,I,J)$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % curvature tensor
5ce5316a33 2021-03-01 jeff@gridfini: write "curvature tensor = ";
5ce5316a33 2021-03-01 jeff@gridfini: FOR I:=0:n-1 DO FOR J:=0:n-1 DO FOR K:=0:n-1 DO FOR L:=0:n-1 DO WRITE "(",I,",",J,",",K,",",L,") = ", RIEM(I,J,K,L)$
5ce5316a33 2021-03-01 jeff@gridfini:   
5ce5316a33 2021-03-01 jeff@gridfini: % Ricci tensor
5ce5316a33 2021-03-01 jeff@gridfini: write "ricci tensor = ";
5ce5316a33 2021-03-01 jeff@gridfini: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ", RICCI(I,J)$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % curvature scalar
5ce5316a33 2021-03-01 jeff@gridfini: write "curvature scalar = ",R$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % Einstein tensor
5ce5316a33 2021-03-01 jeff@gridfini: write "einstein tensor = ";
5ce5316a33 2021-03-01 jeff@gridfini: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ",EINST(I,J)$
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % energy impulse tensor
5ce5316a33 2021-03-01 jeff@gridfini: write "energy impulse tensor eit (roof) = ";
5ce5316a33 2021-03-01 jeff@gridfini: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ",eit(I,J);
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % energy impulse tensor
5ce5316a33 2021-03-01 jeff@gridfini: write "energy impulse tensor eni (with kappa, cellar) = ";
5ce5316a33 2021-03-01 jeff@gridfini: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ",eni(I,J);
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: % solving field equations
5ce5316a33 2021-03-01 jeff@gridfini: write "solving field equations ...";
5ce5316a33 2021-03-01 jeff@gridfini: on factor;
5ce5316a33 2021-03-01 jeff@gridfini: write "mass density = ", erho;
5ce5316a33 2021-03-01 jeff@gridfini: write "pressure = ", ep;
5ce5316a33 2021-03-01 jeff@gridfini: off factor;
5ce5316a33 2021-03-01 jeff@gridfini: write "final mass density = ", ferho;
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: SHUT "metric3d_results.txt";
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: off revpri;
5ce5316a33 2021-03-01 jeff@gridfini: on nat;
5ce5316a33 2021-03-01 jeff@gridfini: 
5ce5316a33 2021-03-01 jeff@gridfini: END;
5ce5316a33 2021-03-01 jeff@gridfini: 

olli-scripts
English Homepage | German Homepage | DL2MIE | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]