Code: Selecteer alles
import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sps
fig, ax1= plt.subplots(figsize=(15, 15))
M=1.989*10**30
G=6.67408*10**(-11)
Ro=7*10**8
Sigma=0
c=300000000
phi=np.linspace(0,20*np.pi, 100000)
esqrt=np.sqrt((Ro-2*M*G/c**2)*(Ro+6*M*G/c**2))
e1=(Ro-2*M*G/c**2+esqrt)/(4*M*G*Ro/c**2)
print('e1: ' + str(e1))
e2=1/Ro
print('e2: ' + str(e2))
e3=(Ro-2*M*G/c**2-esqrt)/(4*M*G*Ro/c**2)
print('e3: ' + str(e3))
Tau=np.sqrt(M*G*(e1-e3)/(2*c**2))
print('Tau: ' + str(Tau))
h=np.sqrt((e2-e3)/(e1-e3))
print('h: ' + str(h))
val=Tau*phi+Sigma
sn,_,_,_=sps.ellipj(val,h)
r=1/(e3+(e2-e3)*sn**2)
x=r*np.cos(phi)
y=r*np.sin(phi)
ax1.plot(x,y)
Code: Selecteer alles
M=1.989*10**30
G=6.67408*10**(-11)
Ro=7*10**8
Code: Selecteer alles
M=1.989e30
G=6.67408e-11
Ro=7e8
10. Period of Revolution
We shall now calculate the period of revolution of a test body describing a closed orbit around a heavy object of mass M producing the gravitational field.
Code: Selecteer alles
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import ellipj
t = np.linspace(np.pi/2 - 1,np.pi/2 + 1,1000)
sn,_,_,_=ellipj(0.500001*t+(-0.78540 + 1.57194),0.00290319)
x = (1/(-1.42857e-9 + ( (7e8)**-1 - -1.42857e-9)*sn*sn))*np.cos(t)
y = (1/(-1.42857e-9 + ( (7e8)**-1 - -1.42857e-9)*sn*sn))*np.sin(t)
plt.plot(x,y,c=(1,0.2,0.5),lw=1)
plt.title('lichtbaan')
plt.axis('on')
plt.show()