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

5ce5316a33 2021-03-01    1: % Calculations concerning the special metric of Dieter Egger
5ce5316a33 2021-03-01    2: % Small and capital letters are treated as being equivalent
5ce5316a33 2021-03-01    3: 
5ce5316a33 2021-03-01    4: % Dimension of space-time
5ce5316a33 2021-03-01    5: n:=3;
5ce5316a33 2021-03-01    6: 
5ce5316a33 2021-03-01    7: % turn off extra echoes
5ce5316a33 2021-03-01    8: off echo;
5ce5316a33 2021-03-01    9: 
5ce5316a33 2021-03-01   10: % smaller exponents first
5ce5316a33 2021-03-01   11: on revpri;
5ce5316a33 2021-03-01   12: 
5ce5316a33 2021-03-01   13: % Coordinates
5ce5316a33 2021-03-01   14: OPERATOR X$
5ce5316a33 2021-03-01   15: X(0):=t$
5ce5316a33 2021-03-01   16: X(1):=lambda0$
5ce5316a33 2021-03-01   17: X(2):=lambda1$
5ce5316a33 2021-03-01   18: 
5ce5316a33 2021-03-01   19: % Vectors (1-dim arrays start with index 0)
5ce5316a33 2021-03-01   20: ARRAY U(n), V(n)$
5ce5316a33 2021-03-01   21: 
5ce5316a33 2021-03-01   22: % place (fixed to origin)
5ce5316a33 2021-03-01   23: U(0):=a0*asin(t)$
5ce5316a33 2021-03-01   24: U(1):=0$
5ce5316a33 2021-03-01   25: U(2):=0$
5ce5316a33 2021-03-01   26: 
5ce5316a33 2021-03-01   27: % Rule
5ce5316a33 2021-03-01   28: trig1:={sin(~x)^2=>(1-cos(x)^2)}$
5ce5316a33 2021-03-01   29: let trig1$
5ce5316a33 2021-03-01   30: 
5ce5316a33 2021-03-01   31: % Procedure
5ce5316a33 2021-03-01   32: procedure showMatrix(mm); begin
5ce5316a33 2021-03-01   33: MATRIX hh(n,n)$
5ce5316a33 2021-03-01   34: FOR I:=0:n-1 DO FOR J:=0:n-1 DO hh(I+1,J+1):=mm(I,J)$
5ce5316a33 2021-03-01   35: write hh; end;
5ce5316a33 2021-03-01   36: 
5ce5316a33 2021-03-01   37: % Arrays (2-dim arrays start with indices (0,0))
5ce5316a33 2021-03-01   38: 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   39: ARRAY EIT(n,n), ENI(n,n)$
5ce5316a33 2021-03-01   40: 
5ce5316a33 2021-03-01   41: % Metric (cellar indices)
5ce5316a33 2021-03-01   42: G(0,0):=a0^2/(1-t^2)$
5ce5316a33 2021-03-01   43: G(1,1):=a0^2*(1-t^2)$
5ce5316a33 2021-03-01   44: G(2,2):=a0^2*(1-t^2)*cos(lambda0)^2$
5ce5316a33 2021-03-01   45: 
5ce5316a33 2021-03-01   46: % Inverse Metric (roof indices)
5ce5316a33 2021-03-01   47: MATRIX MG(n,n), MGINV(n,n)$
5ce5316a33 2021-03-01   48: FOR I:=0:n-1 DO FOR J:=0:n-1 DO MG(I+1,J+1):=G(I,J)$
5ce5316a33 2021-03-01   49: MGINV:=1/MG$
5ce5316a33 2021-03-01   50: FOR I:=0:n-1 DO FOR J:=0:n-1 DO GINV(I,J):=MGINV(I+1,J+1)$
5ce5316a33 2021-03-01   51: 
5ce5316a33 2021-03-01   52: write "g = ",mg;
5ce5316a33 2021-03-01   53: write "ginv = ",mginv;
5ce5316a33 2021-03-01   54: write "g*ginv = ",mg*mginv;
5ce5316a33 2021-03-01   55: 
5ce5316a33 2021-03-01   56: % velocity
5ce5316a33 2021-03-01   57: for i:=0:n-1 do v(i):=df(u(i),t)$
5ce5316a33 2021-03-01   58: 
5ce5316a33 2021-03-01   59: % max. velocity
5ce5316a33 2021-03-01   60: Array vmax(n)$
5ce5316a33 2021-03-01   61: svmax:=a0/sqrt(1-t^2)$
5ce5316a33 2021-03-01   62: for i:=0:n-1 do vmax(i):=svmax$
5ce5316a33 2021-03-01   63: svmaxq:=svmax*svmax$
5ce5316a33 2021-03-01   64: write "max. velocity = ",svmax;
5ce5316a33 2021-03-01   65: 
5ce5316a33 2021-03-01   66: % energy impulse tensor (eit, roof indices)
5ce5316a33 2021-03-01   67: 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   68: write "eit roof = "; showMatrix(eit);
5ce5316a33 2021-03-01   69: 
5ce5316a33 2021-03-01   70: % energy impulse tensor (eni, cellar indices, including kappa)
5ce5316a33 2021-03-01   71: 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   72: write "eni = -kappa*(eit cellar) = "; showMatrix(eni);
5ce5316a33 2021-03-01   73: 
5ce5316a33 2021-03-01   74: % Christoffel symbols (Fliessbach)
5ce5316a33 2021-03-01   75: 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   76:   
5ce5316a33 2021-03-01   77: % curvature tensor (Fliessbach)
5ce5316a33 2021-03-01   78: 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   79:  
5ce5316a33 2021-03-01   80: % Ricci tensor (Fliessbach)
5ce5316a33 2021-03-01   81: 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   82: write "ricci = "; showMatrix(ricci);
5ce5316a33 2021-03-01   83: 
5ce5316a33 2021-03-01   84: % curvature scalar
5ce5316a33 2021-03-01   85: R:= FOR I:=0:n-1 SUM FOR J:=0:n-1 SUM GINV(I,J)*RICCI(I,J)$
5ce5316a33 2021-03-01   86: write "curvature scalar r = ",r;
5ce5316a33 2021-03-01   87: 
5ce5316a33 2021-03-01   88: % Einstein tensor
5ce5316a33 2021-03-01   89: 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   90: write "einstein = "; showMatrix(einst);
5ce5316a33 2021-03-01   91: 
5ce5316a33 2021-03-01   92: % solving field equations
5ce5316a33 2021-03-01   93: write "solving field equations ...";
5ce5316a33 2021-03-01   94: on factor;
5ce5316a33 2021-03-01   95: erho:=solve(eni(0,0)=einst(0,0),rho)$
5ce5316a33 2021-03-01   96: write "mass density = ", erho;
5ce5316a33 2021-03-01   97: 
5ce5316a33 2021-03-01   98: ep:=solve(eni(1,1)=einst(1,1),p)$
5ce5316a33 2021-03-01   99: write "pressure = ", ep;
5ce5316a33 2021-03-01  100: off factor;
5ce5316a33 2021-03-01  101: 
5ce5316a33 2021-03-01  102: ferho:=sub(ep,erho)$
5ce5316a33 2021-03-01  103: write "final mass density = ", ferho;
5ce5316a33 2021-03-01  104: 
5ce5316a33 2021-03-01  105: %--------------------------------------------------------------
5ce5316a33 2021-03-01  106: % write results to file
5ce5316a33 2021-03-01  107: OUT "metric3d_results.txt";
5ce5316a33 2021-03-01  108: off echo;
5ce5316a33 2021-03-01  109: off nat;
5ce5316a33 2021-03-01  110: 
5ce5316a33 2021-03-01  111: % Metric
5ce5316a33 2021-03-01  112: write "metric = ";
5ce5316a33 2021-03-01  113: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ", G(I,J)$
5ce5316a33 2021-03-01  114: 
5ce5316a33 2021-03-01  115: % Inverse Metric
5ce5316a33 2021-03-01  116: WRITE "inverse metric = ";
5ce5316a33 2021-03-01  117: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ", GINV(I,J)$
5ce5316a33 2021-03-01  118: 
5ce5316a33 2021-03-01  119: % Christoffel symbols
5ce5316a33 2021-03-01  120: write "christoffel symbols = ";
5ce5316a33 2021-03-01  121: 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  122: 
5ce5316a33 2021-03-01  123: % curvature tensor
5ce5316a33 2021-03-01  124: write "curvature tensor = ";
5ce5316a33 2021-03-01  125: 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  126:   
5ce5316a33 2021-03-01  127: % Ricci tensor
5ce5316a33 2021-03-01  128: write "ricci tensor = ";
5ce5316a33 2021-03-01  129: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ", RICCI(I,J)$
5ce5316a33 2021-03-01  130: 
5ce5316a33 2021-03-01  131: % curvature scalar
5ce5316a33 2021-03-01  132: write "curvature scalar = ",R$
5ce5316a33 2021-03-01  133: 
5ce5316a33 2021-03-01  134: % Einstein tensor
5ce5316a33 2021-03-01  135: write "einstein tensor = ";
5ce5316a33 2021-03-01  136: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ",EINST(I,J)$
5ce5316a33 2021-03-01  137: 
5ce5316a33 2021-03-01  138: % energy impulse tensor
5ce5316a33 2021-03-01  139: write "energy impulse tensor eit (roof) = ";
5ce5316a33 2021-03-01  140: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ",eit(I,J);
5ce5316a33 2021-03-01  141: 
5ce5316a33 2021-03-01  142: % energy impulse tensor
5ce5316a33 2021-03-01  143: write "energy impulse tensor eni (with kappa, cellar) = ";
5ce5316a33 2021-03-01  144: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ",eni(I,J);
5ce5316a33 2021-03-01  145: 
5ce5316a33 2021-03-01  146: % solving field equations
5ce5316a33 2021-03-01  147: write "solving field equations ...";
5ce5316a33 2021-03-01  148: on factor;
5ce5316a33 2021-03-01  149: write "mass density = ", erho;
5ce5316a33 2021-03-01  150: write "pressure = ", ep;
5ce5316a33 2021-03-01  151: off factor;
5ce5316a33 2021-03-01  152: write "final mass density = ", ferho;
5ce5316a33 2021-03-01  153: 
5ce5316a33 2021-03-01  154: SHUT "metric3d_results.txt";
5ce5316a33 2021-03-01  155: 
5ce5316a33 2021-03-01  156: off revpri;
5ce5316a33 2021-03-01  157: on nat;
5ce5316a33 2021-03-01  158: 
5ce5316a33 2021-03-01  159: END;
5ce5316a33 2021-03-01  160: 

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