import math
# Variable Declaration
h = 150; # height of satellite from earth in km
G = 6.67*10**-11; # Gravitational constant
M = 5.98*10**24; # mass of the earth in kg
Re = 6370; # radius of earth in km
# Calculations
u = G*M
V = math.sqrt(u/float(((Re + h)*10**3))) # orbital velocity
V1 = V/float(1000); # orbital velocity in km/s
# Result
print'Orbital velocity = %3.3f km/s'%V1;
import math
# Variable Declaration
Ap_Pe_diff = 30000; # difference between apogee and perigee in Km
a = 16000; # semi major axis of orbit
# Calculations
e = Ap_Pe_diff/float((2*a)); # Eccentricity
# Result
print'Eccentricity = %3.2f'%e;
import math
# Variable Declaration
a1 = 18000; # semi major axis of the elliptical orbits of satellite 1
a2 = 24000; # semi major axis of the elliptical orbits of satellite 2
# Calculations
# T = 2*math.pi*math.sqrt(a**3/float(u));
#let K = T2/float(T1);
K = (a2/float(a1))**(3/float(2)); # Ratio of orbital periods
# Result
print'The orbital period of satellite-2 is %3.2f times the orbital period of satellite-1'%K;
import math
# Variable Declaration
h = 35800; # height of satellite orbit from earth in km
G = 6.67*10**-11; # Gravitational constant
M = 5.98*10**24; # mass of the earth in kg
Re = 6364; # radius of earth in km
i = 2; # inclination angle
# Calculations
u = G*M
r = Re+h;
Vi = (math.sqrt(u/float(r*10**3)))*math.tan((i*math.pi)/float(180)); # magnitude of velocity impulse
V = Vi # magnitude of velocity impulse in m/s
# Result
print'Magnitude of velocity impulse = %d m/s'%V;
import math
# Variable Declaration
h = 13622; # ht of circular orbit from earth's surface
Re = 6378; # Radius of earth in km
# Calculations
R = Re+h; # Radius of circular orbit
pimax = 180 - (2*math.acos(Re/float(R)))*(180/float(math.pi)); # Maximum shadow angle
eclipmax_time = (pimax/float(360))*24; # maximum daily eclipse duration
# Result
print'maximum shadow angle = %3.1f°\n'%pimax,'Maximum daily eclipse duration = %3.2fhours'%eclipmax_time;
import math
# Given data
h = 35786; # ht of geo.stationary orbit above earth surface
T = 365; # time in days
r = 6378 # radius of earth in km
# ie(t) = 23.4*sin(2*%pi*t/T)
# for a circular orbit of 20000 km radius ,phi = 37.4° ,Therefore, the time from first day of eclipse to equinox is given by substituting ie(t) = 37.4/2 = 18.7°
phi = 37.4
ie = (phi/2)*(math.pi/180)
k = 23.4*(math.pi/180)
t = (365/(2*math.pi))*math.asin((ie/k))
# for geostationary orbit
phimax = 180 - 2*(math.acos(r/(r+h)))*(180/math.pi)
t_geo = (365/(2*math.pi))*math.asin((8.7*math.pi/180)/k)
# Output
print'Total time from first day of eclipse to last day of eclipse = %3.1f days'%t
print '\nTotal time from first day of eclipse to last day of eclipse for geostationary orbit = %3.2f days'%t_geo
import math
# Given data
m = 100; # mass of satellite
V = 8000; # orbital velocity in m/s
Re = 6370; # radius of earth in Km
H = 200; # satellite height above earth surface
# Calculations
CF = (m*V**2)/float(((Re+H)*10**3)); # centrifugal force
# output
print'Centrifugal Force = %d Newtons'%CF;
import math
# Variable Declaration
Apogee = 30000; # Apogee pt of satellite elliptical orbit
Perige = 1000; # perigee pt of satellite elliptical orbit
# Calculations
a = (Apogee + Perige)/float(2); # semi major axis
# Result
print'Semi-major axis = %d Km'%a;
import math
# variable Declaration
farth = 30000; # farthest point in satellite elliptic eccentric orbit
closest = 200; # closest point in satellite elliptic eccentric orbit
Re = 6370; # Radius of earth in km
# Calculations
Apogee = farth + Re; # Apogee in km
Perigee = closest + Re; # perigee in km
a = (Apogee + Perigee)/float((2)); # semi-major axis
e = (Apogee - Perigee)/float((2*a)); # orbit eccentricity
# Result
print'Apogee = %d km\n'%Apogee;
print'Perigee = %d km\n'%Perigee;
print'orbit eccentricity = %3.3f'%e;
import math
# Given data
e = 0.5; # orbit eccentricity
ae = 14000; # from fig. the distance from center of ellipse to the centre of earth
# Calculations
a = ae/float(e); # semi major axis
apogee = a*(1 + e); # Apogee in km
perige = a*(1 - e); # perigee in km
# output
print'Apogee = %d km\n'%apogee,'Perigee = %d km'%perige;
import math
# variable Declaration
G = 6.67*10**-11; # Gravitational constant
M = 5.98*10**24; # mass of the earth in kg
Re = 6370*10**3; # radius of earth in m
# Calculations
u = G*M
Vesc = math.sqrt(2*u/float(Re));
Ves = Vesc/float(1000); # escape velocity in km/s
# Result
print'Escape velocity = %3.1f km/s'%Ves;
import math
# Variable Declaration
a = 25000*10**3; # semimajor axis in m from fig
G = 6.67*10**-11; # Gravitational constant
M = 5.98*10**24; # mass of the earth in kg
h = 0
# Calculations
u = G*M;
T = 2*math.pi*math.sqrt((a**3)/float(u));
hr = T/float(3600); # conv. from sec to hrs and min
t = (T%3600); # conv. from sec to hrs and min
mi = t/float(60); # conv. from sec to hrs and min
# Result
print'Orbital time period = %d'%hr,'Hours %d minutes'%mi;
import math
# variable Declaration
apogee = 35000; # farthest point in kms
perigee = 500; # closest point in kms
r = float(6360); # radius of earth in kms
G = 6.67*10**-11 # gravitational constant
M = 5.98*10**24; # mass of earth in kgs
# calculations
#funcprot(0)
apogee_dist = apogee + r # apogee distance in kms
perigee_dist= perigee+r ; # perigee distance in kms
a = (apogee_dist + perigee_dist)/2; # semi-major axis of elliptical orbit
T = (2*math.pi)*math.sqrt((a*10**3)**3/(G*M)); # orbital time period
hr = T/float(3600) # conv. from sec to hrs and min
t = T%3600 # conv. from sec to hrs and min
mi = t/60 # conv. from sec to hrs and min
u = G*M
Vapogee = math.sqrt(u*((2/(apogee_dist*10**3)) - (1/(a*10**3)))); # velocity at apogee point
Vperigee = math.sqrt((G*M)*((2/(perigee_dist*10**3)-(1/(a*10**3))))) # velocity at perigee point
# Result
print'Orbital Time Period = %d Hrs'%hr,'%d min' %mi
print'Velocity at apogee = %3.3f Km/s' %(Vapogee/1000)
print 'Velocity at perigee = %3.3f Km/s'%(Vperigee/1000)
print'Note: Calculation mistake in textbook in finding velocity at apogee point'
import math
# Variable Declaration
ra_S_rp = 50000; # sum of apogee and perigee distance
ra_D_rp = 30000; # difference of apogee and perigee distances
# Calculations
e = ra_D_rp/float(ra_S_rp); # eccentricity
# Result
print'Target eccentricity = %3.1f'%e;
import math
# Given data
a = 20000; # semi major axis of elliptical sate. orbit in kms
b = 16000; # semi minor axis of elliptical sate. orbit in kms
# calculations
# a = (ra + rp)/2
# b = math.sqrt(ra*rp)
# let k = (ra + rp)
# let l = ra*rp
k = 2*a; # ra+ rp ----------------1
l = b**2; # ra*rp -----------------2
# ra**2 -40000ra + 256000000
Ap = (k - (math.sqrt(k**2-4*1*l)))/(2*1)
Pe = (k + (math.sqrt(k**2-4*1*l)))/(2*1)
print'Apogee distance = %d km\n'%Ap,'Perigee distance = %d km' %Pe;
import math
# Variable delaration
H = 35800; # height of orbit in kms
re = 6364; # radius of earth in kms
i = 2; # angle of inclination in degrees
# Calculations
r = H+re; # radius of orbit in kms
lamdamax = i; # max latitude deviation
long_dev = (i**2)/float(228); # max. longitude deviation
disp_lamda = (r*i*math.pi/180) # max disp in km due to lamdamax
max_disp1 = disp_lamda*(long_dev/lamdamax) # max disp.due to max.longitude deviation
# Result
print'Maximum deviation in latitude = %d°'%lamdamax
print'Maximum deviation in longitude = %3.4f°'%long_dev
print'Maximum displacements due to latitude displacement = %d Km'%disp_lamda
print'Maximum displacements due to longitude displacement = %3.1f Km\n'%max_disp1 ;
import math
# Variable Declaration
r = 42164; # orbital radius in kms
Dlamda_max = 500; # max displacement due to latitude deviation
# Calculations
i = Dlamda_max/float(r); # angle of inclination in radians
i_deg = i*180/math.pi; # rad to deg conv
# Result
print'Angle of inclination = %3.2f°'%i_deg;
import math
# Variable Declaration
H = 35786; # ht of orbit from earth surface
Re = float(6378) # radius of earth in kms
# Calculations
# For theoretical max coverage angle,elevation angle E = 0
E = 0
# max coverage angle = 2amax
# 2amax = 2asin(Re/(Re+H)cosE)
amax = 2*math.asin((Re/(Re+H))*math.cos(E))
amax_deg = amax*180/math.pi # rad to deg conversion
D = math.sqrt( Re**2 + (Re+H)**2 - 2*Re*(Re + H)*math.asin(E + math.asin((Re/(Re+H))*math.cos(E)))) # Max slant range
# Result
print'Maximum Coverage angle = %3.1f°'%amax_deg
print'Maximum slant Range = %d Km'%D;