Origin for each line in src/metric2d.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:=2;
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: 
c1ddb4c814 2021-03-01   18: % lambda0 depends on t
c1ddb4c814 2021-03-01   19: DEPEND lambda0,t$
c1ddb4c814 2021-03-01   20: 
c1ddb4c814 2021-03-01   21: % Rules
c1ddb4c814 2021-03-01   22: trig1:={sin(~x)^2=>(1-cos(x)^2)}$
c1ddb4c814 2021-03-01   23: let trig1$
c1ddb4c814 2021-03-01   24: 
c1ddb4c814 2021-03-01   25: % Procedures
c1ddb4c814 2021-03-01   26: procedure kovab(aa,bb); begin
c1ddb4c814 2021-03-01   27: FOR I:=0:n-1 DO FOR J:=0:n-1 DO aa(I,J):=DF(bb(I),X(J))+FOR M:=0:n-1 SUM CHRIST(I,J,M)*bb(M)$
c1ddb4c814 2021-03-01   28: end;
c1ddb4c814 2021-03-01   29: 
c1ddb4c814 2021-03-01   30: procedure showMatrix(mm); begin
c1ddb4c814 2021-03-01   31: MATRIX hh(n,n)$
c1ddb4c814 2021-03-01   32: FOR I:=0:n-1 DO FOR J:=0:n-1 DO hh(I+1,J+1):=mm(I,J)$
c1ddb4c814 2021-03-01   33: write hh;
c1ddb4c814 2021-03-01   34: end;
c1ddb4c814 2021-03-01   35: 
c1ddb4c814 2021-03-01   36: procedure showVector(vv); begin
c1ddb4c814 2021-03-01   37: MATRIX hh(n,1)$
c1ddb4c814 2021-03-01   38: FOR I:=0:n-1 DO hh(I+1,1):=vv(I)$
c1ddb4c814 2021-03-01   39: write hh;
c1ddb4c814 2021-03-01   40: end;
c1ddb4c814 2021-03-01   41: 
c1ddb4c814 2021-03-01   42: % Vectors (1-dim arrays start with index 0)
c1ddb4c814 2021-03-01   43: ARRAY U(n), V(n), LV(n), B(n), LB(n), BG(n)$
c1ddb4c814 2021-03-01   44: 
c1ddb4c814 2021-03-01   45: % Arrays (2-dim arrays start with indices (0,0))
c1ddb4c814 2021-03-01   46: 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   47: ARRAY UKV(n,n)$
c1ddb4c814 2021-03-01   48: 
c1ddb4c814 2021-03-01   49: % Calculations
c1ddb4c814 2021-03-01   50: % optionally set maximum radius to 1
c1ddb4c814 2021-03-01   51: % a0:=1$
c1ddb4c814 2021-03-01   52: % or leave it open
c1ddb4c814 2021-03-01   53: a:=a0*sqrt(1-t^2)$
c1ddb4c814 2021-03-01   54: 
c1ddb4c814 2021-03-01   55: % Place
c1ddb4c814 2021-03-01   56: u(0):=a0*asin(t)$
c1ddb4c814 2021-03-01   57: u(1):=a*lambda0$
c1ddb4c814 2021-03-01   58: 
c1ddb4c814 2021-03-01   59: % Metric (cellar indices, covariant, default is zero)
c1ddb4c814 2021-03-01   60: G(0,0):=a0^2/(1-t^2)$
c1ddb4c814 2021-03-01   61: G(1,1):=a0^2*(1-t^2)$
c1ddb4c814 2021-03-01   62: 
c1ddb4c814 2021-03-01   63: % Inverse Metric (roof indices, contravariant)
c1ddb4c814 2021-03-01   64: MATRIX MG(n,n), MGINV(n,n)$
c1ddb4c814 2021-03-01   65: FOR I:=0:n-1 DO FOR J:=0:n-1 DO MG(I+1,J+1):=G(I,J)$
c1ddb4c814 2021-03-01   66: MGINV:=1/MG$
c1ddb4c814 2021-03-01   67: FOR I:=0:n-1 DO FOR J:=0:n-1 DO GINV(I,J):=MGINV(I+1,J+1)$
c1ddb4c814 2021-03-01   68: 
c1ddb4c814 2021-03-01   69: % show metric
c1ddb4c814 2021-03-01   70: write "g = ",mg;
c1ddb4c814 2021-03-01   71: write "ginv = ",mginv;
c1ddb4c814 2021-03-01   72: write "g*ginv = ",mg*mginv;
c1ddb4c814 2021-03-01   73: 
c1ddb4c814 2021-03-01   74: % Christoffel symbols
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 i:=0:n-1 sum GINV(k,i)/2 * (DF(G(m,i),X(l)) + DF(G(l,i),X(m)) - DF(G(m,l),X(i)));
c1ddb4c814 2021-03-01   76:   
c1ddb4c814 2021-03-01   77: % curvature tensor
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
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,J,M)$
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: % show place
c1ddb4c814 2021-03-01   93: write "place u = "; showVector(u);
c1ddb4c814 2021-03-01   94: 
c1ddb4c814 2021-03-01   95: % covariant derivative of place u
c1ddb4c814 2021-03-01   96: kovab(ukv,u)$
c1ddb4c814 2021-03-01   97: write "cov. deriv. of u = "; showMatrix(ukv);
c1ddb4c814 2021-03-01   98: 
c1ddb4c814 2021-03-01   99: % classical velocity
c1ddb4c814 2021-03-01  100: for k:=0:n-1 do v(k):=df(U(k),X(0))$
c1ddb4c814 2021-03-01  101: write "v = du/dt = "; showVector(v);
c1ddb4c814 2021-03-01  102: 
c1ddb4c814 2021-03-01  103: % local velocity with respect to (x0,x1)
c1ddb4c814 2021-03-01  104: for k:=0:n-1 do LV(k):=V(k)/V(0)$
c1ddb4c814 2021-03-01  105: write "lv = dx1/dx0 = "; showVector(lv);
c1ddb4c814 2021-03-01  106: 
c1ddb4c814 2021-03-01  107: % max. velocity
c1ddb4c814 2021-03-01  108: Array vmax(n)$
c1ddb4c814 2021-03-01  109: svmax:=a0/sqrt(1-t^2)$
c1ddb4c814 2021-03-01  110: for i:=0:n-1 do vmax(i):=svmax$
c1ddb4c814 2021-03-01  111: svmaxq:=svmax*svmax$
c1ddb4c814 2021-03-01  112: write "max. velocity = ",svmax;
c1ddb4c814 2021-03-01  113: 
c1ddb4c814 2021-03-01  114: % equation of motion
c1ddb4c814 2021-03-01  115: for k:=0:n-1 do BG(k):=-for m:=0:n-1 sum for n:=0:n-1 sum CHRIST(k,m,n)* vmax(m)*vmax(n)$
c1ddb4c814 2021-03-01  116: write "equation of motion = "; showVector(bg);
c1ddb4c814 2021-03-01  117: 
c1ddb4c814 2021-03-01  118: % local acceleration wrt (x0,x1)
c1ddb4c814 2021-03-01  119: for k:=0:n-1 do LB(k) :=1/V(0)*df(lv(k),x(0))$
c1ddb4c814 2021-03-01  120: write "la = dlv/dx0 * 1/v0 = "; showVector(lb);
c1ddb4c814 2021-03-01  121: 
c1ddb4c814 2021-03-01  122: %--------------------------------------------------------------
c1ddb4c814 2021-03-01  123: % write results to file
c1ddb4c814 2021-03-01  124: OUT "metric2d_results.txt";
c1ddb4c814 2021-03-01  125: off echo;
c1ddb4c814 2021-03-01  126: off nat;
c1ddb4c814 2021-03-01  127: 
c1ddb4c814 2021-03-01  128: % Metric
c1ddb4c814 2021-03-01  129: write "metric = ";
c1ddb4c814 2021-03-01  130: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ", G(I,J)$
c1ddb4c814 2021-03-01  131: 
c1ddb4c814 2021-03-01  132: % Inverse Metric
c1ddb4c814 2021-03-01  133: WRITE "inverse metric = ";
c1ddb4c814 2021-03-01  134: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ", GINV(I,J)$
c1ddb4c814 2021-03-01  135: 
c1ddb4c814 2021-03-01  136: % Christoffel symbols
c1ddb4c814 2021-03-01  137: write "christoffel symbols = ";
c1ddb4c814 2021-03-01  138: 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  139: 
c1ddb4c814 2021-03-01  140: % curvature tensor
c1ddb4c814 2021-03-01  141: write "curvature tensor = ";
c1ddb4c814 2021-03-01  142: 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  143:   
c1ddb4c814 2021-03-01  144: % Ricci tensor
c1ddb4c814 2021-03-01  145: write "ricci tensor = ";
c1ddb4c814 2021-03-01  146: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ", RICCI(I,J)$
c1ddb4c814 2021-03-01  147: 
c1ddb4c814 2021-03-01  148: % curvature scalar
c1ddb4c814 2021-03-01  149: write "curvature scalar = ",R$
c1ddb4c814 2021-03-01  150: 
c1ddb4c814 2021-03-01  151: % Einstein tensor
c1ddb4c814 2021-03-01  152: write "einstein tensor = ";
c1ddb4c814 2021-03-01  153: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ",EINST(I,J)$
c1ddb4c814 2021-03-01  154: 
c1ddb4c814 2021-03-01  155: % place U
c1ddb4c814 2021-03-01  156: write "place u = ";
c1ddb4c814 2021-03-01  157: FOR I:=0:n-1 DO WRITE "(",I,") = ", U(I)$
c1ddb4c814 2021-03-01  158: 
c1ddb4c814 2021-03-01  159: % covariant derivative of U
c1ddb4c814 2021-03-01  160: write "covariant derivative of u = ";
c1ddb4c814 2021-03-01  161: FOR I:=0:n-1 DO FOR J:=0:n-1 DO WRITE "(",I,",",J,") = ",Ukv(I,J)$
c1ddb4c814 2021-03-01  162: 
c1ddb4c814 2021-03-01  163: % velocity V
c1ddb4c814 2021-03-01  164: write "velocity v = ";
c1ddb4c814 2021-03-01  165: FOR I:=0:n-1 DO WRITE "(",I,") = ", V(I)$
c1ddb4c814 2021-03-01  166: 
c1ddb4c814 2021-03-01  167: % local velocity wrt (x0,x1)
c1ddb4c814 2021-03-01  168: write "local velocity wrt (x0,x1) = ";
c1ddb4c814 2021-03-01  169: FOR I:=0:n-1 DO WRITE "(",I,") = ", LV(I)$
c1ddb4c814 2021-03-01  170: 
c1ddb4c814 2021-03-01  171: % acceleration
c1ddb4c814 2021-03-01  172: write "acceleration = ";
c1ddb4c814 2021-03-01  173: FOR I:=0:n-1 DO WRITE "(",I,") = ", B(I)$
c1ddb4c814 2021-03-01  174: 
c1ddb4c814 2021-03-01  175: % local acceleration wrt (x0,x1)
c1ddb4c814 2021-03-01  176: write "local acceleration wrt (x0,x1) = ";
c1ddb4c814 2021-03-01  177: FOR I:=0:n-1 DO WRITE "(",I,") = ", LB(I)$
c1ddb4c814 2021-03-01  178: 
c1ddb4c814 2021-03-01  179: % equation of motion
c1ddb4c814 2021-03-01  180: write "equation of motion = ";
c1ddb4c814 2021-03-01  181: FOR I:=0:n-1 DO WRITE "(",I,") = ", BG(I)$
c1ddb4c814 2021-03-01  182: 
c1ddb4c814 2021-03-01  183: % equation of motion 
c1ddb4c814 2021-03-01  184: on factor;
c1ddb4c814 2021-03-01  185: write "equation of motion = ";
c1ddb4c814 2021-03-01  186: FOR I:=0:n-1 DO WRITE "(",I,")  =", BG(I)$
c1ddb4c814 2021-03-01  187: off factor;
c1ddb4c814 2021-03-01  188: 
c1ddb4c814 2021-03-01  189: SHUT "metric2d_results.txt";
c1ddb4c814 2021-03-01  190: 
c1ddb4c814 2021-03-01  191: off revpri;
c1ddb4c814 2021-03-01  192: on nat;
c1ddb4c814 2021-03-01  193: 
c1ddb4c814 2021-03-01  194: END;
c1ddb4c814 2021-03-01  195: 

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