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

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