# Chapter 15: General Relativity¶

## Example 15.1, Page 562¶

In :
import math

#Variable declaration
g = 9.8;    # Acceleration due to gravity, m/sec^2
H = 10000;    # Altitude of the aeroplane above the surface of earth, m
c = 3.00e+008;    # Speed of light in free space, m/s
T = 45*3600;    # Time taken by the airplane to from eastward to westward trip, s

#Calculations
delta_T_G = g*H*T/(c**2*1e-009);    # Time difference in the two clocks due to gravitational redshift, ns
C = 4e+007;    # Circumference of the earth, m
v = 300;        # Speed of the jet airplane, m/s
T0 = C/v;    # Time of flight of jet airplane very near the surface of the earth, s
bita = v/c;    # Boost parameter
# As from special relativity time dilation relation, T = T0*sqrt(1-bita^2), solving for T0 - T = delta_T_R, we have
delta_T_R = T0*(1-math.sqrt(1-bita**2))/1e-009;    # Time difference in the two clocks due to special relativity, ns

#Result
print "The gravitational time dilation effect of %d ns is larger than the approximate %4.1f ns of that of special relativity."%(math.ceil(delta_T_G), delta_T_R)

The gravitational time dilation effect of 177 ns is larger than the approximate 66.7 ns of that of special relativity.


## Example 15.2, Page 567¶

In :
import math

#Variable declaration
c = 3.00e+008;    # Speed of light in free space, m/s
G = 6.67e-011;    # Newton's gravitational constant, N-Sq.m/per kg square
M_S = 2.0e+030;    # Mass of the sun, kg
M_E = 6.0e+024;    # Mass of the earth, kg

#Calculations
r_S = 2*G*M_S/(c**2*1e+003);    # Schwarzschild radius for sun, km
r_E = 2*G*M_E/(c**2*1e-003);    # Schwarzschild radius for earth, mm

#Results
print "The Schwarzschild radius for sun = %d km"%math.ceil(r_S)
print "The Schwarzschild radius for earth = %d mm"%math.ceil(r_E)

The Schwarzschild radius for sun = 3 km
The Schwarzschild radius for earth = 9 mm


## Example 15.3, Page 568¶

In :
import math
import scipy

#Variable declaration
c = 3.00e+008;    # Speed of light in free space, m/s
G = 6.67e-011;    # Newton's gravitational constant, N-Sq.m/per kg square
h = 6.62e-034;    # Planck's constant, Js

#Calculations
h_bar = h/(2*math.pi);    # Reduced Planck's constant, Js
sigma = 5.67e-008;    # Stefan-Boltzmann constant, W per Sq.m per K^4
k = 1.38e-023;    # Boltzmann constant, J/K
M0 = 1.99e+030;    # Mass of the sun, kg
alpha = 2*sigma*h_bar**4*c**6/((8*math.pi)**3*k**4*G**2);    # A constant, kg^3/s
T = lambda M: 1/alpha*M**2

The time required for the 3-solar-mass black hole to evaporate = 5.7e+68 y