Origin for each line in src/metric4d.red from check-in c1ddb4c814:

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

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