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

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