summaryrefslogtreecommitdiff
path: root/2409/CH2
diff options
context:
space:
mode:
Diffstat (limited to '2409/CH2')
-rwxr-xr-x2409/CH2/EX2.1/Ex2_1.sce12
-rwxr-xr-x2409/CH2/EX2.10/Ex2_10.sce32
-rwxr-xr-x2409/CH2/EX2.11/Ex2_11.sce14
-rwxr-xr-x2409/CH2/EX2.12/Ex2_12.sce13
-rwxr-xr-x2409/CH2/EX2.13/Ex2_13.sce14
-rwxr-xr-x2409/CH2/EX2.14/Ex2_14.sce17
-rwxr-xr-x2409/CH2/EX2.15/Ex2_15.sce13
-rwxr-xr-x2409/CH2/EX2.17/Ex2_17.sce18
-rwxr-xr-x2409/CH2/EX2.18/Ex2_18.sce15
-rwxr-xr-x2409/CH2/EX2.19/Ex2_19.sce23
-rwxr-xr-x2409/CH2/EX2.2/Ex2_2.sce14
-rwxr-xr-x2409/CH2/EX2.20/Ex2_20.sce68
-rwxr-xr-x2409/CH2/EX2.21/Ex2_21.sce37
-rwxr-xr-x2409/CH2/EX2.3/Ex2_3.sce19
-rwxr-xr-x2409/CH2/EX2.4/Ex2_4.sce25
-rwxr-xr-x2409/CH2/EX2.5/Ex2_5.sce18
-rwxr-xr-x2409/CH2/EX2.6/Ex2_6.sce16
-rwxr-xr-x2409/CH2/EX2.7/Ex2_7.sce10
-rwxr-xr-x2409/CH2/EX2.8/Ex2_8.sce28
-rwxr-xr-x2409/CH2/EX2.9/Ex2_9.sce15
20 files changed, 421 insertions, 0 deletions
diff --git a/2409/CH2/EX2.1/Ex2_1.sce b/2409/CH2/EX2.1/Ex2_1.sce
new file mode 100755
index 000000000..d4df59454
--- /dev/null
+++ b/2409/CH2/EX2.1/Ex2_1.sce
@@ -0,0 +1,12 @@
+
+//Variable Declaration
+u=3.986*(10**14) //Earth's Gravitational constant(m^3/sec^2)
+
+//Calculation
+n=(2*3.14)/(24*60*60) //Mean Motion(rad/sec)
+a=((u/n**2)**(0.33333))/1000 //Radius of the orbit by kepler's 3rd law(km)
+
+//Result
+printf("The Radius of the circular orbit with 1 day period is : %d km",a)
+
+
diff --git a/2409/CH2/EX2.10/Ex2_10.sce b/2409/CH2/EX2.10/Ex2_10.sce
new file mode 100755
index 000000000..a2c9861dc
--- /dev/null
+++ b/2409/CH2/EX2.10/Ex2_10.sce
@@ -0,0 +1,32 @@
+
+
+//Variable Declaration
+
+y=2000 //year
+mon=12 //month
+dy=18 //day
+hours=13 //hours of the day
+minutes=0 //Minutes of the day
+seconds=0 //Seconds of the day
+
+
+//Calculation
+d=dy+(hours/24)+(minutes/(24*60))+seconds //Days in December
+if mon<=2 then
+ y=y-1
+ mon=mon+12
+else
+ y=y
+ mon=mon
+end
+
+A=floor(y/100) //Converting years to days
+B=2-A+floor(A/4) //Converting years to days
+C=floor(365.25*y) //rounding the days
+D=floor(30.6001*(mon+1)) //Converting months to days
+JD=B+C+D+d+1720994.5 //Adding reeference to number of days
+
+
+//Result
+
+printf("The Julian day of given day is : %.4f Days",JD)
diff --git a/2409/CH2/EX2.11/Ex2_11.sce b/2409/CH2/EX2.11/Ex2_11.sce
new file mode 100755
index 000000000..37a8c5a0d
--- /dev/null
+++ b/2409/CH2/EX2.11/Ex2_11.sce
@@ -0,0 +1,14 @@
+
+//Variable Declaration
+
+JDref=2415020 //Reference Julian days
+JC=36525
+JD=2451897.0417 //Julian days with reference from Example 2.10
+
+//Calculation
+
+T=(JD-JDref)/JC //Time in julian Centuries
+
+//Result
+
+printf("The time for given date is : %.8f Julian Centuries",T)
diff --git a/2409/CH2/EX2.12/Ex2_12.sce b/2409/CH2/EX2.12/Ex2_12.sce
new file mode 100755
index 000000000..8bac38044
--- /dev/null
+++ b/2409/CH2/EX2.12/Ex2_12.sce
@@ -0,0 +1,13 @@
+
+//Variable Declaration
+
+n=14.23304826 //Mean Motion (rev/day)
+M0=246.6853 //Mean Anomaly (degrees)
+t0=223.79688452 //Time of anomaly
+
+//Calculation
+
+T = (t0-(M0/(n*360))) //Time of perigee passage
+
+//Result
+printf("The time of perigee passage for NASA elements is : %.4f days",T)
diff --git a/2409/CH2/EX2.13/Ex2_13.sce b/2409/CH2/EX2.13/Ex2_13.sce
new file mode 100755
index 000000000..e99472444
--- /dev/null
+++ b/2409/CH2/EX2.13/Ex2_13.sce
@@ -0,0 +1,14 @@
+
+//Variable Declaration
+M=205 //Mean anomaly(degrees)
+e=0.0025 //Eccentricity
+E=%pi //Initial guess value for eccentric anomaly
+
+//Calculation
+
+function [y] = f(E)
+ y=M-E+e*sin(E)
+endfunction
+E=fsolve(3.142,f)
+
+printf("The Eccentric anomaly is: %.4f degrees",E)
diff --git a/2409/CH2/EX2.14/Ex2_14.sce b/2409/CH2/EX2.14/Ex2_14.sce
new file mode 100755
index 000000000..cff340896
--- /dev/null
+++ b/2409/CH2/EX2.14/Ex2_14.sce
@@ -0,0 +1,17 @@
+
+//Variable Declaration
+pi = %pi
+n=14.2171401*2*%pi/86400 //Mean motion (rad/sec)
+M=204.9779+0.001*180*5/pi //Mean anomaly(rad)
+e=9.5981*10**-3 //Eccentricity
+a=7194.9 //Semimajor axis(km)
+
+//Calculation
+
+v=(M*pi/180)+2*e*sin(M*pi/180)+(5*e**2*sin(2*M*pi)/(4*180)) //True Anomaly (radians)
+v=v*180/%pi //True anomaly(degrees)
+r=a*(1-e**2)/(1+e*cos(v)) //Magnitude of radius vector after 5s(km)
+
+//Results
+printf("The true anomaly is: %.3f degrees",v)
+printf("\nThe magnitude of radius vector 5s after epoch is: %d km",r)
diff --git a/2409/CH2/EX2.15/Ex2_15.sce b/2409/CH2/EX2.15/Ex2_15.sce
new file mode 100755
index 000000000..fb68a7e94
--- /dev/null
+++ b/2409/CH2/EX2.15/Ex2_15.sce
@@ -0,0 +1,13 @@
+
+//Variable Declaration
+
+v=204.81 //True anomaly(degrees) from Example 2.14
+r=7257 //Magnitude of radius vector(km) from Example 2.14
+
+//Calculation
+
+rP=r*cos(v*%pi/180) //P coordinate of radius vector(km)
+rQ=r*sin(v*%pi/180) //Q coordinate of radius vector(km)
+
+//Result
+printf("r in the perifocal coordinate system is %.2f Pkm %.2f Qkm",rP,rQ)
diff --git a/2409/CH2/EX2.17/Ex2_17.sce b/2409/CH2/EX2.17/Ex2_17.sce
new file mode 100755
index 000000000..078756ca0
--- /dev/null
+++ b/2409/CH2/EX2.17/Ex2_17.sce
@@ -0,0 +1,18 @@
+
+//Variable Declaration
+pi = %pi
+T=1.009638376 //Time in Julian centuries from Example 2.11
+UT=13 //Universal time(hours)
+
+//Calculation
+
+GST=(99.6910+36000.7689*T+0.004*T**2)*3.142/180 //GST(radians)
+UT=2*pi*UT/24 //Universal time converted to fraction of earth rotation (radians)
+
+GST=GST+UT
+
+
+GST=(modulo(GST,2*pi))*180/pi
+
+//Result
+printf("The GST for given date and time is %.2f degrees",GST)
diff --git a/2409/CH2/EX2.18/Ex2_18.sce b/2409/CH2/EX2.18/Ex2_18.sce
new file mode 100755
index 000000000..b4a0690f4
--- /dev/null
+++ b/2409/CH2/EX2.18/Ex2_18.sce
@@ -0,0 +1,15 @@
+
+//Variable Declararion
+pi = %pi
+WL=-89.26 //Expressing the longitude in degrees west
+GST=282.449 //GST from Example 2.17 (degrees)
+
+//Calculation
+
+EL=2*pi+WL //Longitude in degrees East
+LST=(GST+EL)*pi/180 //LST(radians)
+LST=(modulo(LST,2*pi))*180/pi //fmod removes multiple revolutions(Degrees)
+
+//Results
+printf("LST for Thunder Bay on given day is: %.2f Degrees",LST)
+
diff --git a/2409/CH2/EX2.19/Ex2_19.sce b/2409/CH2/EX2.19/Ex2_19.sce
new file mode 100755
index 000000000..4ad09938a
--- /dev/null
+++ b/2409/CH2/EX2.19/Ex2_19.sce
@@ -0,0 +1,23 @@
+
+//Variable Declaration
+
+LST=167.475 //LST(degrees)
+LE=48.42 //Latitude at thunder bay(degrees)
+H=200 //Height above sea level(metres)
+aE=6378.1414 //Semimajor axis(km)
+eE=0.08182 //Eccentricity
+
+//Calculation
+
+l=(aE/sqrt(1-eE**2*sin(LE*3.142/180)**2)+H/1000)*cos(LE*3.142/180)
+z=((aE*(1-eE**2))/sqrt(1-eE**2*sin(LE*3.142/180)**2)+H/1000)*sin(LE*3.142/180)
+RI=l*cos(LST*3.142/180) //I component of radius vector at thunder bay(km)
+RJ=l*sin(LST*3.142/180) //J component of radius vector at thunder bay(km)
+RK= z //Z component of radius vector at thunder bay(km)
+
+R=sqrt(RI**2+RJ**2+RK**2)
+
+
+//Results
+printf("The Radius vector components are %.2f ikm+ %.2f jkm+ %.2f kkm",RI,RJ,RK)
+printf("\nThe Magnitude of radius component is %.2f km",R)
diff --git a/2409/CH2/EX2.2/Ex2_2.sce b/2409/CH2/EX2.2/Ex2_2.sce
new file mode 100755
index 000000000..b151ba3d7
--- /dev/null
+++ b/2409/CH2/EX2.2/Ex2_2.sce
@@ -0,0 +1,14 @@
+
+//Variable Declaration
+NN=14.22296917 //Mean Motion (1/day)
+u=3.986005*(10**14) //Earth's Gravitational COnstant(m^3/sec^2)
+
+//Calculation
+n0=(NN*2*3.142)/(24*60*60) //Mean Motion(rad/sec)
+a=((u/n0**2)**(0.33333))/1000 //Radius of the orbit by kepler's 3rd law(km)
+
+
+//Result
+printf("The Semimajor axis for given satellite parameters is : %.2f km",a)
+
+
diff --git a/2409/CH2/EX2.20/Ex2_20.sce b/2409/CH2/EX2.20/Ex2_20.sce
new file mode 100755
index 000000000..7c4788bb5
--- /dev/null
+++ b/2409/CH2/EX2.20/Ex2_20.sce
@@ -0,0 +1,68 @@
+
+//Variable Declaration
+
+PI=-1280 //I component of range vector for a satellite(km)
+PJ=-1278 //J component of range vector for a satellite(km)
+PK=66 //K component of range vector for a satellite(km)
+GST=240 //GST(degrees)
+LE=48.42 //Latitude(Degrees)
+PE=-89.26 //Longitude(Degrees)
+H=200 //Height above mean sea level(metres)
+aE=6378.1414 //Semimajor axis(km)
+eE=0.08182 //Eccentricity
+
+
+//Calculation
+
+l=(aE/sqrt(1-eE**2*sin(LE*3.142/180)**2)+H/1000)*cos(LE*3.142/180)
+z=((aE*(1-eE**2))/sqrt(1-eE**2*sin(LE*3.142/180)**2)+H/1000)*sin(LE*3.142/180)
+SE=(atan(z/l))*180/3.142 //Geocentric latitude angle (degrees)
+LST=240+PE
+
+
+a=sin(SE*3.142/180)*cos(LST*3.142/180)
+b=sin(SE*3.142/180)*sin(LST*3.142/180)
+c=-cos(SE*3.142/180)
+d=-sin(LST*3.142/180)
+e=cos(LST*3.142/180)
+f=0
+g=cos(SE*3.142/180)*cos(LST*3.142/180)
+h=cos(SE*3.142/180)*sin(LST*3.142/180)
+i=sin(SE*3.142/180)
+
+D = [a,b,c;d,e,f;g,h,i]
+
+P= [PI;PJ;PK]
+
+R=D*P //Components of range of earth station
+Ro=sqrt(R(1,1)**2+R(2,1)**2+R(3,1)**2) //Magnitude of range of earth station(km)
+El=asin(R(3,1)/Ro) //Antenna elevation angle for the earth station(radians)
+El= El*180/3.142 //Converting El to degrees
+alpha=(atan(R(2,1)/R(3,1)))*180/3.142
+
+if ( R(1,1)<0 & R(2,1)>0 ) then
+ Aza=alpha
+else
+ Aza=0
+end
+if ( R(1,1)>0 & R(2,1)>0 ) then
+ Azb=180-alpha
+else:
+ Azb=0
+end
+
+if ( R(1,1)>0 & R(2,1)<0 ) then
+ Azc=180+alpha
+else
+ Azc=0
+end
+if ( R(1,1)<0 & R(2,1)<0 ) then
+ Azd=360-alpha
+else
+ Azd=0
+end
+Az= Aza+Azb+Azc+Azd //Azimuth angle (degrees)
+
+printf("The magnitude of range of earth station is %.0f km",Ro)
+printf("\nThe antenna elevation angle for the earth station are %.f degrees",El)
+printf("\nThe Azimuth angle for the earth station is %.2f degrees",Az)
diff --git a/2409/CH2/EX2.21/Ex2_21.sce b/2409/CH2/EX2.21/Ex2_21.sce
new file mode 100755
index 000000000..5e2fcafa4
--- /dev/null
+++ b/2409/CH2/EX2.21/Ex2_21.sce
@@ -0,0 +1,37 @@
+
+//Variable Declaration
+
+rI=-4685.3 //I component of radius vector from Example 2.16(km)
+rJ=5047.7 //J component of radius vector from Example 2.16(km)
+rK=-3289.1 //K component of radius vector from Example 2.16(km)
+aE=6378.1414 //Semimajor axis (km)
+eE=0.08182 //Eccentricity
+
+//Calculation
+
+r=sqrt(rI**2+rJ**2+rK**2)
+a=%pi //Guess value for LST(radians)
+b=atan(rK/rI) //Guess Value for latitude(radians)
+c=r-aE //Guess value for height(km)
+
+function [ans] = equations(p)
+ L = p(1)
+ h = p(2)
+ LST = p(3)
+ a = rI-((aE/sqrt(1-eE**2*sin(L)**2))+h)*cos(L)*cos(LST)
+ b = rJ-((aE/sqrt(1-eE**2*sin(L)**2))+h)*cos(L)*sin(LST)
+ c = rK-((aE*(1-eE**2)/sqrt(1-eE**2*sin(L)**2))+h)*sin(L)
+ ans = [a;b;c]
+endfunction
+
+ans = fsolve([b;c;a],equations)
+L = ans(1)
+h = ans(2)
+LST = ans(3)
+L= L*180/3.142 //Converting L into degrees
+h=round(h)
+LST=LST*180/3.142 //Converting LST into degrees
+
+printf("The latitude of subsatellite is %.2f degrees",L)
+printf("\nThe height of subsatellite is %.2f km",h)
+printf("\nThe LST of subsatellite is %.1f degrees",LST)
diff --git a/2409/CH2/EX2.3/Ex2_3.sce b/2409/CH2/EX2.3/Ex2_3.sce
new file mode 100755
index 000000000..1a91bf332
--- /dev/null
+++ b/2409/CH2/EX2.3/Ex2_3.sce
@@ -0,0 +1,19 @@
+
+//Variable Declaration
+
+R=6371 //Mean Earth's radius(km)
+e=0.0011501 //Eccentricity
+a=7192.3 //Semimajor axis(km)
+
+//Calculation
+
+ra=a*(1+e) //Radius Vector at apogee(km)
+rp=a*(1-e) //Radius Vector at perigee(km)
+ha=ra-R //Apogee height(km)
+hp=rp-R //Perigee height(km)
+
+
+//Result
+printf("The Apogee height for given orbital parameters is: %.2f km",ha)
+printf("The Apogee height for given orbital parameters is: %.2f km",hp)
+
diff --git a/2409/CH2/EX2.4/Ex2_4.sce b/2409/CH2/EX2.4/Ex2_4.sce
new file mode 100755
index 000000000..7e987acc0
--- /dev/null
+++ b/2409/CH2/EX2.4/Ex2_4.sce
@@ -0,0 +1,25 @@
+
+//Variable Declaration
+aE=6378.141 //Earth's equitorial radius(km)
+e=0.002 //Eccentricity
+p=12 //period from perigee to perigee (hours)
+K1=66063.1704 //Constant (km^2)
+u=3.986005*(10**14) //Earth's Gravitational constant(m^3/sec^2)
+
+
+//Calculation
+n=(2*%pi)/(12*60*60) //Mean Motion(rad/sec)
+anp=((u/n**2)**(0.3333))/1000 //Radius of the orbit by kepler's 3rd law(km)
+k2=(1-e**2)**1.5
+
+function [y]=f(a)
+ y=(n-((u/a**3)**0.5)*(1+K1/a**2*k2))
+endfunction
+a=fsolve(2,f)
+a=a/1000 //Converting a into km
+
+//Result
+
+printf("The nonperturbed value of semimajor axis is %.2f km",anp)
+printf("\nThe perturbed value of semimajor axis is %.2f km",a)
+
diff --git a/2409/CH2/EX2.5/Ex2_5.sce b/2409/CH2/EX2.5/Ex2_5.sce
new file mode 100755
index 000000000..13b83ab07
--- /dev/null
+++ b/2409/CH2/EX2.5/Ex2_5.sce
@@ -0,0 +1,18 @@
+
+//Variable Declaration
+i=98.6328 //Angle(degrees)
+e=0.0011501 //eccentricity
+n=14.23304826 //Mean Motion(1/day)
+a=7192.3 //Semimajor axis(km)
+K1=66063.1704 //Known constant(km^2)
+
+//Calculation
+
+n0=(2*180*n) //Mean Motion (deg/sec)
+K=(n0*K1)/((a**2)*((1-e**2)**2)) //Constant (deg/day)
+w=-K*cos(i*3.142/180) //Rate of regression of nodes(deg/day)
+W=K*(2-2.5*(sin(i*3.142/180))**2) //Rate of rotation of line of apsides(deg/day)
+
+//Results
+printf("The rate of regression of nodes is: %.3f deg/day",w)
+printf("\nThe rate of rotation of line of apsides is : %.3f deg/day",W)
diff --git a/2409/CH2/EX2.6/Ex2_6.sce b/2409/CH2/EX2.6/Ex2_6.sce
new file mode 100755
index 000000000..53f1dd6e3
--- /dev/null
+++ b/2409/CH2/EX2.6/Ex2_6.sce
@@ -0,0 +1,16 @@
+
+//Variable Declaration
+w=0.982 //rate of regression of nodes from Example 2.5(deg/day)
+W=-2.903 //rate of rotation of line of apsides from Example 2.5)deg/day)
+n=14.23304826 //Mean Motion(1/day)
+W0=113.5534 //Argument of perigee(deg)
+w0=251.5324 //Right ascension of the ascending node(deg)
+
+//Calculation
+PA=1/n //Period
+w=w0+w*PA //New value of rate of regression of nodes(deg)
+W=W0+W*PA //New Value of rate of rotation of line of apsides(deg)
+
+//Result
+printf("New value of rate of regression of nodes is: %.3f deg",w)
+printf("\nNew value of rate of rotation of line of apsides is : %.3f deg",W)
diff --git a/2409/CH2/EX2.7/Ex2_7.sce b/2409/CH2/EX2.7/Ex2_7.sce
new file mode 100755
index 000000000..2a1ed8d66
--- /dev/null
+++ b/2409/CH2/EX2.7/Ex2_7.sce
@@ -0,0 +1,10 @@
+
+//Calculation
+ndays=400*365 //Nominal number of days in 400years
+nleapyrs=400/4 //Nominal number of leap years
+gregoriandays=ndays+nleapyrs-3 //number of days in 400 years of Gregorian calendar
+gregavg=gregoriandays/400 //number of days in 400 years of Gregorian calendar
+
+//Result
+disp (gregoriandays)
+printf("The average length of the civil year in gregorian calender is : %.4f days",gregavg)
diff --git a/2409/CH2/EX2.8/Ex2_8.sce b/2409/CH2/EX2.8/Ex2_8.sce
new file mode 100755
index 000000000..be120c984
--- /dev/null
+++ b/2409/CH2/EX2.8/Ex2_8.sce
@@ -0,0 +1,28 @@
+
+//Calculation and Results
+
+
+if ( modulo(1987,4) == 0. ) then
+ disp("1987 is a leap year");
+else
+ disp("1987 is not a leap year");
+end
+
+
+if ( modulo(1988,4) == 0. ) then
+ disp("1988 is a leap year");
+else
+ disp("1988 is not a leap year");
+end
+
+if ( modulo(2000,400) == 0. ) then
+ disp("2000 is a leap year");
+else
+ disp("2000 is not a leap year");
+end
+
+if ( modulo(2100,400) == 0. ) then
+ disp("2100 is a leap year");
+else
+ disp("2100 is not a leap year");
+end
diff --git a/2409/CH2/EX2.9/Ex2_9.sce b/2409/CH2/EX2.9/Ex2_9.sce
new file mode 100755
index 000000000..427adbd7a
--- /dev/null
+++ b/2409/CH2/EX2.9/Ex2_9.sce
@@ -0,0 +1,15 @@
+
+
+//Calculation
+days=324 //Number of days
+hours=floor(24*0.95616765) // Number of hours
+decimalfraction1=24*0.95616765-hours
+minutes=floor(60*decimalfraction1) // Number of minutes
+decimalfraction2=60*decimalfraction1-minutes
+seconds=60*decimalfraction2 // Number of seconds
+
+//Result
+
+disp(decimalfraction1)
+disp(decimalfraction2)
+printf("An Epoch day has %.2f days %.2f hours %.2f minutes %.2f seconds",days,hours,minutes,seconds)