import math
#Variable Declaration
r1=6370.0 # Earth's Orbit in km
r2=630.0 # Height of satellite from surface in km
G=6.67*10**-11 # Gravitational constant inNm^2/kg^2
M=5.98*10**24 # Mass of earth in kg
#Calculation
R=r1+r2
v=math.sqrt(G*M/(R*10**3))
#Result
print("The velocity of sattelite %.2fkm/s"%(math.floor(v/10)*10**-2))
import math
#Variable Declaration
A=45000.0 #Apogee in km
P=7000.0 #Perigee in km
#Calculation
#(a)
a=(A+P)/2
#(b)
e=(A-P)/(2*a)
#(c)
e=(math.floor(e*100))/100
d=a*e
#Result
print("(a)\nSemi-major axis of elliptical orbit is %d km"%a)
print("\n(b)\nEccentricity = %.2f"%e)
print("\n(c)\nThe distance between centre of earth and centre of ellipse is %d km "%d)
#Variable Declaration
ma=42000.0 # Major axis distance in Km
P=8000.0 # Perigee distance in Km
#Calculation
A=ma-P
e=(A-P)/ma
#Result
print("Apogee=%dkm\n Eccentricity=%.2f"%(A,e))
#Variable Declaration
e=0.6 #Eccentricity
d=18000.0 #distance between earth's centre and centre of ellipse
#Calculation
a=d/e
A=a*(1+e)
P=a*(1-e)
#Result
print("Semi-major axis of elliptical orbit is %d km\n Apogee distance=%dkm\n Perigee distance=%dkm"%(a,A,P))
#Variable Declaration
AP_diff=30000.0 #difference between apogee and perigee in km
AP_sum=62800.0 #Apogee+perigee
#Calculation
E=AP_diff/AP_sum
#Result
print("Orbit Eccentricity= %.3f"%E)
import math
#Variable Declaration
R=7000.0*10**3 # sattelite orbit in m
mu=39.8*10**13 # constant G*M in Nm^2/kg
A=47000.0*10**3 # appogee distance in m
P=7000.0*10**3 # perigee distance in m
#Calculation
v=math.sqrt(mu/R)
a=(A+P)/2
v1=math.sqrt(mu*((2/R)-(1/a)))
#Result
print("Velocity of satellite A at point X is v=%.2fkm/s\nVelocity of satellite B at point X is V=%.3fkm/s"%(v/1000,v1/1000))
#value in book is different at 3rd decimal place.
import math
#Variable Declaration
R=42000.0*10**3 #sattelite orbit in m
mu=39.8*10**13 #constant G*M in Nm^2/kg
A=42000.0*10**3 #appogee distance in m
P=7000.0*10**3 #perigee distance in m
#Calculation
v=math.sqrt(mu/R)
a=(A+P)/2
v1=math.sqrt(mu*((2/R)-(1/a)))
#Result
print("Velocity of satellite A at point X is v=%.3fkm/s\n Velocity of satellite B at point X is V=%.3fkm/s"%(v/1000,v1/1000))
import math
#Variable Declaration
R=25000.0*10**3 #sattelite orbit in m
mu=39.8*10**13 #constant G*M in Nm^2/kg
A=43000.0*10**3 #appogee distance in m
P=7000.0*10**3 #perigee distance in m
#Calculation
v=math.sqrt(mu/R)
a=(A+P)/2
v1=math.sqrt(mu*((2/R)-(1/a)))
#Result
print("Velocity of satellite A at point X is v=%.3fkm/s\n Velocity of satellite B at point X is V=%.3fkm/s"%(v/1000,v1/1000))
#value in book is different at 3rd decimal place.
import math
#Variable Declaration
a=(50000.0/2)*10**3 #Semi-major axis in m
mu=39.8*10**13 #constant G*M in Nm^2/kg
#Calculation
T=2*math.pi*math.sqrt((a**3)/mu) #math.pi gives variation in answer
h=T/(60*60)
x=T%3600
m=x/60
s=x%60
#Result
print("Orbital time period is given by, T = %dsec\n\t\t\t\t = %dh %dm %ds"%(T,math.floor(h),math.floor(m),math.floor(s)))
#value in book is different for seconds.
#Variable Declaration
a1=18000.0*10**3 #Semi-major axis for first satellite in m
a2=24000.0*10**3 #Semi-major axis f0r 2nd satellite in m
#Calculation
T2_by_T1=(a2/a1)**(3.0/2.0)
#Result
print("Orbital time period of sattelite 2 is %.2f times that of sattelite 1"%T2_by_T1)
import math
#Variable Declaration
a=25000.0*10**3 #appogee distance in m
b=18330.0*10**3 #perigee distance in m
#Calculation
e=(math.sqrt(a**2-b**2)/a)
#Result
print("Apogee distance = a(1+e)= %dkm\n Perigee distance = a(1-e)= %dkm\n"%(a*(1+e)/1000,math.ceil(a*(1-e)/1000)))
#Variable Declaration
e=0.6 # eccentricity of elliptical orbit
a=0.97 # area of shaded region
b=2.17 # Area of non-shaded region
t=3 # time taken by satellite to move from pt B to A
#Calculation
x=b/a
y=x*t
#Result
print("Time taken by satellite to move from A to B is %.3f hours "%y)
#Variable Declaration
A=42000.0 # Apogee in km
P=8000.0 # Perigee in km
v_p=9.142 # velocity at perigee point
#Calculation
v_a=v_p*P/A
#Result
print("Velocity at apogee = %.3f km/s"%v_a)
import math
#Variable Declaration
theta=56.245 #angle made by direction of satellite with local horizontal
d=16000.0 #distance of particular point
P=8000.0 #Perigee in m
v_p=9.142 #velocity at perigee point
#Calculation
v=(P*v_p)/(d*math.floor(math.cos(theta*math.pi/180)*1000)/1000)
#Result
print("The velocity of satellite at that particular point is %.3f km/s"%v)
import math
#Variable Declaration
A1=12000.0 # first Apogee distance
P=8000.0 # Perigee distance
v1=1.0 # assume v1 as 1
v2=1.2*v1 # 20% higher than v1
#Calculation
x=(v2/v1)**2
k=(((1+(P/A1))/x)-1)
k=math.floor(k*10**4)/10**4
A2=P/k
#Result
print("A2 = %.0fkm"%math.ceil(A2))
import math
#Variable Declaration
vp=8.0 # horizontal velocity of satellite in km/s
r=1620.0 # distance from earth's surface in km
R=6380.0 # Earth's radius in km
d=10000.0 # distance of point at which velocity to be calculated
theta=30.0 # angle made by satellite with local horzon at that point
#Calculation
P=r+R
v=(vp*P)/(d*math.cos(theta*math.pi/180))
#Result
print("v = %.2f km/s"%v)
import math
#Variable Declaration
r=620.0 # distance from earth's surface in km
vp=8.0 # horizontal velocity of satelliteat 9000km height in km/s
R=6380.0 # Earth's radius in km
d=9000.0 # distance of point at which velocity to be calculated
theta=30.0 # angle made by satellite with local horzon at that point
mu=39.8*10**13 # Nm**2/kg
#Calculation
P=r+R
m=vp*d*math.cos(theta*math.pi/180)/P #m=sqrt((2mu/P)-[2mu/(A+P)])
m=(m*10**3)**2
x=(2*mu/(P*10**3))-m #x=[2mu/(A+P)]
x=math.floor(x/10**4)*10**4
k=(2*mu)/x #k=A+P
k=math.ceil(k/10**4)*10**4
A=k-(P*10**3)
#Result
print("A = %.0f km"%(A/1000))
import math
#variable declaration
R=6380 #Earth's radius in km
T=86160 #Orbital period of Geostationary satellite in km
mu=39.8*10**13 #in Nm^2/k
#calculations
r=(T*math.sqrt(mu)/(2*math.pi))**(2.0/3.0) # Answer matches to the answer given in the book if value of pi is taken as 3.14
#Result
print('Radius of satellite is, r = %.0f km'%(r/1000))
print('Therefore, height of satellite orbit above earth surface is %.0f km '%((r/1000)-R))
import math
#variable declaration
R=6380 #radius of earth in km
P=400 #Perigee distance in km
A=40000 #Apogee distance in km
mu=39.8*10**13 #in Nm^2/k
#calculation
a=(A+P+R+R)/2 #semi-major axis of the elliptical orbit
T=(2*math.pi*(a*10**3)**(3.0/2.0))/math.sqrt(mu)
h=T/(60*60)
x=T%3600
m=x/60
s=x%60
#Result
print('T = %dsec\n = %dh %dm %ds\n\nThis approximately equal to 12 hour'%(T,math.floor(h),math.floor(m),math.floor(s)))