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