Mat Lab File

You might also like

Download as pdf
Download as pdf
You are on page 1of 5
Contents, = Input from Users = Value Assignment and Formulation = 2.0 Plot of Orbit = Code to get Right Ascension Of Ascending Node = When the Orbits Elliptical and itis inclined wrt Equatorial Plane = When the Orbit is Circular and itis inclined wrt Equatorial Plane = When the Orbits Elliptical and itis Parallel to Equatorial Plane = When the Orbit is Circular and itis Parallel to Equatorial Plane cles cle disp(‘Enter all the Units in ST Systen->") the Units stem->|->0rbit is not possible, the space-cbject will crash into the planet0 if n(1) > 0 66 n(2) > 0 fprint£(*\ncstrong>Tt is a Prograde = > Vector lies in First Quadrant\n') gons/strong ‘ nunste (ohn) ,! Degree") disp(t! else disp({! |—>RaaN) = ‘pnum2str (ohn) ," Degree']} end elseif a(t) <0 6@ (2) >0 fprint# (*\nrt 5 a Retrograde Elliptical orbit:\n |->a Vector lies in Second Quadzant\n'} LE ohm >190 ohm = 360 - ohm; diap((* |->RRAN *nundate (ohm) ,' Deqzee')) else disp((‘ |->RRAN is = ‘;nunste(ohn),' Degzee')} end elseif n(1) <0 @@ n(2) <0 fprint£("\ncstrong>It is a Retrograde Elliptical orbii ng> Vector lies in Third Quadrant\n'); trong>\n |->ns; if ohm < 180 ohm = 360 - ohm; disp({' |->RRAN is = ',numgste (ohn) ," Degree"]} else disp([* |->RAAN is = ‘,num2str (ohm), Degree']) end elseif a(t) > 0 66 ni2) <0 fprint£(*\ncstrong>it is a Prograde Elliptical orbit:\n |->n Vector lies in Fourth Quadrant\n") if ohm < 90 ohm = 360 - ohm; disp({* |->RRAN is = ‘,num2str (ohm), Degree']} else disp({‘ |->RRAN is = ‘,num2str (ohm) ," Degree']} end end disp({? |->Inclination of Orbit from Equatorial plane is = *;num2str(i), " Degrees Ystrong>'])4 Values = * |->Eccentricity of the Orbit is = 48.5£ \n |->Arguement of Perigee is = 48.5¢ Degree \n |->True Anaoly is = $8.5f Degree \n |->Semi-majo r Axis is = 48.5f Kn\n' fprinté (Values, e, omega, nu, a) ; When the Orbit is Circular and it is inclined wrt Equatorial Plane elseif i 0 11 180 see if n(l) > 0 66 n(2) > 0 fprint£(*\ncstrong>Tt is a Prograde Elliptical orbit:\n |->n Vector lies in First Quadrant\n’) if ohm >90 ohm = 360 - ohms disp({* |->RRAN is = ‘,numastr (ohm) ," Degree']} else disp({* |->RRAN is = ‘;num2str (ohm), Degree']} end elseif a(t) <0 6& n(2) >0 fprint£('\ncstrong>Tt is a Retrograde Elliptical orbit:\n |->n Vector lies in Second Quadzant\n"} 5 ohm >180 ohm = 360 - ohm; disp({' |->RRAN is = ‘,numdstr (ohm) ," Degree']} else disp({‘ |->RRAN is = ‘;numdstr (ohm), Degree']} end elseif n(1) <0 @& (2) <0 fprintf ("\ncstrong>It is a Retrograde Elliptical orbii ng> Vector lies in Third Quadrant\n") /strong>\n |->nRAAN is = ',numgstr (ohn) ," Degree"]} else disp({' |->RAAN is = ‘;num2str (ohn) ," Degree")} end elseif n(l) > 0 @& n(2) <0 fprinté("\nit is a Prograde Elliptical orbit:\n |->n Vector lies in Fourth Quadrant\n") if ohm < 90 ohm = 360 - ohm; disp({' |->RRAN is = ',mungste (ohn) ," Degree"]} else disp({' |->RRAN is = ',mungstx (ohn) ," Degree"]} end end Arg_of_lattitude_u = acosd(dot (n,R)/(norm(n)*z)) + disp({? |->Inclination of Orbit from Equatorial plane is = ',numastr(i)]," Degree"); Values = ‘Seni-major axis of the Orbit is = 38.5f n\n |->Eccentricity 0 £ the Orbit is = 38.5F |->Argument of Lattitude is = 88.5f Degree \n Orbital Elements like Argument of Perigee and True Anomaly cannot be defined \n"y fprint# (Values, a,e,Arg_of_lattitude_u); When the Orbit is Elliptical and it is Parallel to Equatorial Plane elseif i == 0 || 180 66 e >0 disp({‘Inclination of Orbit from Equatorial plane is = ',numastr(i)1)s mu = acosd ( (dot (B/R)}/(e*r))7 Long_of_peri_pi = acosd (dot (I,8)/(nozm(I) *e)) 7 Values = * |->Semi-najor Axis is = $8.5f Kn \n |->ccentricity of the Or bit is = 98.5£ \n |->Longitude of perigee is = 98.5f Degree \n |->True Anaro ly is = 38.5£ Degree \n Orbital Elements like RAAN and Argument of Perigee cannot be defined’; fprint# (Values, a,e,Long_of peri_piynu); When the Orbit is Circular and it is Parallel to Equatorial Plane elseif i ==0 || 180 cee disp({‘Inclination of Orbit from Equatorial plane is = ',numastr(i)])s tr long 1 = acosd (dot (Z,R) /(z*norm(I)}17 Values = ' |->Semi-major Axis is = 48.5£ Rn\n |->Eccentricity of the orb it is = 38.5£ \n |->True longitude is = %8.5£ Degree \n Orbital Elen ents like RAN, Argument of Perigee and True Anomaly cannot be defined '; fprint£ (Values, a,e,Tx_long_1); end Pushed with MATLABS R20t8—

You might also like