HW1_solution

HW1_solution - g? 9‘ f £4; 3?ng in)“ g {Mfg Q, ~66 {a...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 10
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 12
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 14
Background image of page 15
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: g? 9‘ f £4; 3?ng in)“ g {Mfg Q, ~66 {a m 56/ 2% g; &m& g: 6%,, <2} 5? g 3% ié‘ffigg gag j i 352325695}; £213 m w gééxég a @dmgmfifi 9? g» a 3% a {if égéifig 1 £5? figfij EMQL @5513? fig gig" 7 g g ugfiggg figfi gig; 5&xw" ffifim ajffiakfkg Mfg M Q ‘wggizagfié g; Qfigfiwf M gwfi, {35% gwaé fig.“ W 5% w ggmmgg w gfigégfla fig {Q “2’ m} “5‘4”?! flaw” 5W {3? {:1} 5 $é?®§£ gfiéafiéf 5%;2 {f gfwgfigf {kfiflgi'wgw’ 1;? Ni; {:3 a? fig, ii 3% @fiq’ Q I} f {3 <3 5 Law 52:. g 1!, I ‘, g awfi w§w$§s§§§ m5; [/9'3f‘35? §°§§g§£§ gggggfg g a “W?” $55552? ; fig ; %@J%3é§ $335535; {faggégg gig @aégg, {if Wiggwfia; {fig 2:“; g? 1/18/08 6:00 PM MATLAB Command Window 1 of 2 3/? < M A T L A B > Copyright 1984—2006 The MathWorks, Inc. Version 7.2.0.283 (R2006a) January 27, 2006 To get started, select MATLAB Help or Demos from the Help menu. >> A = [~0.8557 ~0.3778 "0.3536; 0.4039 '0.9l48 0.0; -0.3234 ~0.1428 0.9354] A: —O.8557 —0.3778 ~0.3536 0.4039 —0.9148 0 —0.3234 «0.1428 0.9354 >> det(A) ans = 1.0000 >> A*A’ ans = 1.0000 -'0.0000 -0.0001 ~0.0000 1.0000 0.0000 —0.0001 0.0000 1.0000 >> A’*A ans = 0.9999 —0.0000 0.0001 -0.0000 1.0000 0.0000 0.0001 0.0000 1.0000 >> B = [10.888 1.361 8.166; 4.083 6.805 9.527; 5.444 12.249 2.722] 8: 10.8880 1.3610 8.1660 4.0830 6.8050 9.5270 5.4440 12.2490 2.7220 >> det(B) ans = ~907.5632 >> C = [0.4658 0.7818 -0.4145; -0.5840 0.6235 0.5197; 0.6648 0.0 0.747} C a 0.4658 0.7818 -0.4145 *0.5840 0.6235 0.5197 1/18/08 6:00 PM 0.6648 >> det(C) ans = 0.9999 >> C*C’ ans = 1.0000 0.0000 0.0000 >> C’*C ans = 1.0000 0.0000 0.0000 >> D = [-1 D: ~l.0309 0.6163 “0.5622 >> det(D) ans = 1.0000 >> D*D’ ans = 3.1462 —0.4856 1.7496 >> 0 O .0000 0.9999 -0.0000 0.0000 1.0000 -0.0000 .0309 -0.6371 ~l.2952; -0.6371 -0.3283 -1.2651 ~0.4856 0.4897 0.0559 MATLAB Command Window 0.7470 0.0000 -0.0000 1.0000 0.0000 ~0.0000 0.9999 —1.2952 0.0459 -0.2811 1.7496 0.0559 1.9956 0.6163 "0.3283 0.0459; -0.5622 *1.2651 -0.2811] Wg 555 w fiffimféfi iggéigw 3%} 6.3/9 A 6: 30(3) . g gamma. “A m-r- I l 516 flflr: :I 4'41 Nd!“ (/9.’)M“5/§ flak, f0. "glut/0 (A a): Ah, 09'). (4'92, (4)1 Mr)” (. ‘ a = (/9371) ” r. I - I -. r d - J‘ (A )= I , 5‘41"ng W ’9 ’6’ for; GM» fluflz F (A, 45/21 GIL» «155/77 (Ga/$5, m‘Qag). ALF (Atfla) :: = [x] .2] (AA,). AA; r_ (I ) ~ Mfl9.(a,’fl,r) : 19,.{19 3.. .1 : (“MW “’9': at»? M; (Mm (4,92) 3 J— mg 52%? ” figmwwg # 5, @égfifl 5%; mermamwmwdmm "www/vmwm,w%ww*u. «A AW,» Efyif 6%, fgéfifiés’z‘ maggé‘g fig}; {/gfigéaéréfefi! i; a”; mggéfééjggf iii“: @«mfi? ififiw 5g » V525} {é’géfiw‘s £3? 3 { {kggfa if? 353% 5 Q??? :5; 5;? is; 2% 7 Eégfi fig @ffg ggwfngfiag figmfiw flag? ég {(53%th 5’; mmfeg 5,55%; ggfimfiwa Egg; £3 «fig/£5; Q X If zf/y Egg} g {g} if fimgfifiw 5%; % mi; (ffiéw‘éaj {’ng fian Qfié @fig 3%: 6:3? gal: : f? MW gr Mi jaw/:3») Me. 13:44 1% frail-$2... gwféhvza h” a gall gawk—«r A; fit. thy/,‘é/ le’amgg . (.4 [4“; 4W [5 e I R“; a 7% éi‘a/ cWJAw/Z , // Mfg: 1;? £éfléfl® g; W/ gj M 36;!“ §n [figrfaw {aw 4 x10 Orbit of the spacecrafts in the local frame: 30 view 1.4 X spacecrafti spacecraft 2 1.2 ' 1 2 (km) 0.8 0.6 X10 ; 0.8 "3‘4- y(km) 0-5 33635 who? 4 Orbit of the spacecrafts in the local frame: (x,y) projection x<km> x104 Orbit of the spacecrafts in the local frame: (or, 5) plot 8 (deg) 53% Orbit of the spacecrafts in the inertia! frame: SD View "‘ " spacecraft 1 spacecraft 2 Orbit of the spacecrafts in the inertial frame: (a, 6) plot 80- . . A A . _ _ A . . _ A . ‘ . , V . . . e V , V . A _ . A ‘ . _ _ _ . . . . ‘ V , . . . V V y y y . y y . . . . . . . . . . . . . A _ _ . . A . A A _ . . V V . . . . . . . . . e . e . ‘ . . 60.. , . , . . . , . . , , . . , , . . . . . , . . . y . . y y . y y , , V . , . . . . . . . . V . . . . , . . . . . . . . . . . _ . e . . V . V . V , . y y . . . . . ‘ . ‘ . . . . ‘ . , A ‘ . A 40.. . , ‘ . , _ . . . . . V V , , , . . , V . . . . , , , . e V e . . . . . . . , , . ‘ . , . . . , , . . . . . . . . . . . . . . . . _ . . . . . . . . . , . , . . . . . . . . . . ‘ . ‘ e ‘ 6(deg) I 1/18/08 6:19 PM /home/Benjamin/Teaching/MAE146/Winter07/H.../Pb3_solutionflW08.m 1 of 3 % Solution to Homework #1, Pb 3: Re = 6378; % radius of the Earth in kilometers. d2r = pl/180.0; % conversion factor from degrees to radians. r2d = 180.0/pi; % conversion factor from radians to degrees. %% — w =~~ ‘ — ~ % Local frame of reference t = 0:24; % Spacecraft 1 spherical coordinates (km, deg) W1 = [ 40052.4; ; 17.829; 14.98 ]; % spacecraft 2 coordinates (1m, deg) W2 = [ 40367 40510 40631 40717 40760 40753 40693 40581 40429 40247K 40052 39862 39692 39557 39463 39416 39414 39453 39527 39630! 39756 39899 40052 40211 40367; 22.213 23.917 25.14 25.818 25.935 25.515 24.616 23.313 21.690 19.8342 17.829 15.770 13.763 11.936 10.430 9.386 8.919 9.098 9.929 11.353“ 13.254 15.473 17.829 20.134 22.213; 11.97 10.616 9.487 8.679 8.278 8.346 8.908 9.942 11.379 13.107K 14.980 16.835 18.511 19.870 20.815 21.296 21.318 20.920 20.167 19.1322 17.881 16.477 14.980 13.453 11.97]; % Spherical to cartesian coordinate transformation Y1 = W1(1 Y2 = W1(1 Y3 = W1(1 Y = {Y1; 2; Z1 = W2(1,:). 22 = W2(l,:). Z3 : W2(l,:). Z = [21; ZZ; *(cos(W2(2,:)*d2r *(sin(W2(2,:)*d2r *sin(W2(3,:)*d2r); Z3]; ). ). % Plots in the local frame figure(1) subplot(311) )*(cos(W1(2)*d2r)*cos(W1(3)*d2r)); )*(sin(W1(2)*d2r)*cos(Wl(3)*d2r)); )*sin(W1(3)*d2r); Y Y3]; *cos(W2(3,:)*d2r)); *cos(W2(3,:)*d2r)); plot3(Y1,Y2,Y3,’xr',Zl,22,Z3,’-b’); %Labeling grid on; title(’0rbit of the spacecrafts in the local frame: xlabe1(’x ylabe1(’y zlabel(’z axis equal; axis tight; legend(’spacecraft 1’, subplot(312) (km)'); (km)’); (km)’); plot(Yl,Y2,'Xr’,Zl,Z2,’—b’); %Labeling grid on; ’spacecraft 2’); tit1e('0rbit of the spacecrafts in the loca1 frame: x1abe1(’x (km)’); ylabel(’y (km)’); 30 view'); (x,y) projection'); 1/18/08 6:19 PM /home/Benjamin/Teaching/MAE146/Winter07/H.../Pb3_solution~W08.m tag” 2 of 3 axis equal; subplot<3l3) plot(Wl(2,:),Wl{3,:),’xr’,W2(2,:),W2(3,:>,’—b'); %Labeling title(’0rbit of the spacecrafts in the local frame: (\alpha, xlabel(’\alpha (deg)'); ylabel('\delta (deg)’); grid on; axis equal; %% — % Transformation to inertial frame longO = l49.l*d2r; latO = ~35.3*d2r; alto = 0.6668; R0 = Re+alt0; for j = 1:25, % Position of the observing station in inertial frame long = longO + 2.0*pi*(t(j)/24); S = R0*[cos(lat0)*cos(long); cos(lat0)*sin(long); end; % Pl figu le; subp % Rotation Rot_long = [ cos(—long) sin(—long) 0.0 ; ~sin(~long) cos(-long) 0.0 ; 0.0 0.0 1.0 ]; Rot_lat = [ cos(lat0) 0.0 —sin(lat0) ; 0.0 1.0 0.0 ; sin<lat0) 0.0 cos(lat0) ]; Rot_flip = [ 0 O l; l O 0; O l O]; Rot = Rot_long * Rot_lat * Rot_flip; % Transformations of the coordinates of the lat S/C Ul(:,j) = Rot*(Y) + S; dlp = norm(Ul(l:2,j)); dlf = norm(Ul(:,j)); Vl(:,j) = [ dlf; r2d*sign(Ul(2,j))*acos(Ul(l,j)/dlp); Transformations of the coordinates of the 2nd S/C :,j) = Rot*(Z(:,j)) + S; norm(U2(l:2,j)); = norm(U2(:,j)); :,j) = [ d2f; r2d*sign(U2(2,j))*aCOS(U2(lrj)/d2p); ots in the inertial frame of reference re(2) lot(211) \delta) plot’); sin(lat0)]; transfrom the local frame into the inertial one. r2d*asin(Ul(3,j)/dlf)] r2d*asin(UZ(3,j)/d2f)] plot3(Ul(l,:),Ul(2,:),Ul(3,:),’--r’,U2(l,:),U2(2,:),UZ(3,:),’-b'); % Pl hold [Ex, Eart ot the Earth on; Ey,Ez]=sphere(lOO,100); h = imread('ear0xuu2.jpg’); (just for fun!) 1/18/08 6:19 PM /home/Benjamin/Teaching/MAE146/WinterO7/H.../Pb3_solutionWW08.m 3 of 3 warp<Re*Ex,Re*Ey,~Re*Ez,Earth); set<gca,’XDir',’norma1’,’YDIR’,’normal’,‘ZDir’,’norma1’); % warp tend to flip theK axis... hold off; % Labeling grid on; tit1e(’0rbit of the spacecrafts in the inertial frame: 3D view'); xlabel('x (km)‘); ylabel(’y (km)‘); zlabel(’z (km)’); legend(’spacecraft 1’, 'spacecraft 2’); axis equal; subplot<212) V1_modl = [—180 V1(2,1:23)]; o necessary for a nicer looking plot V1_mod2 = [O V1(3,1:23)]; )1 )1 \o V2_mod1 = [—180 V2(2,l:23 V2~mod2 = [ O V2(3,1:23 ; p10t<Vlumod1,V1_mod2,’ewr',V2_mod1,V2_mod2,’-b’); % Labeling grid on; tit1e(’0rbit of the spacecrafts in the inertial frame: (\alpha, \delta) plot'); xlabel('\a1pha (deg)’); ylabe1(’\delta (deg)’); axis equal; I M 3%: ' 2; if ’ £7 Eéééfm ; géfijiéff? 6% Jigfg j g 57:!” g} 53m 52m ggwyéééf if 3% gwfwfggé%fa #13:? fig gag“? is; figfiéf’gfl gvmrdikafiam g? @gfié§:fi?§.&f if} gig £2 £4?» fig a; fig; ‘ f r g e . 5% @gfié} w? fiw jfw Mfg 7 fl “M 57%;} @fiwfié a??? M55? 554; aégwwééf a g; 3%, gwg wingwg flmvg fig}; Jigif’ 51%;; 3 7E3 sank/“i. i‘gfi» sisal €345? wcwéfién m1 aéazbaif‘éva a! 1% 3%? M fiaafifi'gé 4%.. fiat—If" scam/m}: cwfa/anéafié éfi 52% ggfli’gy f} ii; 46%! gwé. , E!¢a§fy (a; E: g; 52?; £2; 3 3% a: % g f‘ a [I Qgggafi pg 2 g Q ! gig, j?! 5% $45} % @443“ §f§£iégi? a a {:3 ’7 f , é,’§;ng i as: ' if}? sis-3%? ii” fikg‘; Ligflyg a? m fatzkms R} m4 72‘ (. (6/ an iv“, «4 C953" M6, 6) Coff o 5341f 72,3 55»); in?“ 625:9“ 6 . R2640: O I o O 0 I / . \ 44’ o as? Mag/I Me gfiwL fair???» 5.4% KW f9 [/1 5"“ flaw/‘4’ gamma” '3’ gal?“ a“ X z r. Gag, cm 6f ( (swat. ), /$ t f’ ,9"? ‘2’ ca; J View r 2)] Z: r 5%,; £112 $414k {41; madam 0’; fig ffé'r’“ I»; AL flame. a/ fail/7'4: « x % X9 ngf g f v A 7 4 v fl g,» éa‘§;?§; i 21 id iii“? @fif 625%; {9? 53%! 29 W {3&5} {1%}? $7829 a. #99 E £69? 5% {figégg fifgfi gggfifii x» :ggzfié? 632%??? §§§g§;j§m§§i,5:fiyfimw féég igééém é 5,353? mm W M. 774, [£64] /}‘ fa168hfi$m I £3912. F,” f. 7‘ M m; gt?§;¢g F;&§Téf.‘ér V K J r. Pma/ @i 5;»; :7"? gw m}? a ’ i M ‘a a if / give: ;§Q, fig 5}- gf £555?! é(’ v j q f i; / 3:. f gift! if: §M£ ; w M gm; W 5 [cmgfiggg wmfl 5a» {sma’f@,§g):fi gégafifié, % $53 i I 23a} 14; m iffg 3,; Jwiéw” my gw‘éw 5% «afif X Wa, ggzéésé: f gw§.§m§ 3 gm; {fing «3 m§~i§§§§ % ‘2 é; 5 Ga Z§§{ $5M.“ ggé‘fzgye: gay; mfi‘fgfi flaw Mg fixf” J a g? f :: Q36: {ficfggé/jz: 9%} rigggfl mfg/335%? :2 3"“; fig Egagégé; a; 2;: fl fit 1%” ;a§xmm;fi :1 § ‘8 mafia" gefww 554 mug/:76? game wax f A 5W!» &# Maééfiél M a??? 5%; FAM git ifi ifiéégfiz GL3} é@m@1: 59a}?ng “@5326?” afghgzw J :: vgfiffig 53;! J «*Qafgfi? ' 7 é; : $5? QM 3:? fix? , fig» fiéfi’gxygfi @f: 5:53;": W ...
View Full Document

This homework help was uploaded on 04/07/2008 for the course MAE 146 taught by Professor Villac during the Winter '08 term at UC Irvine.

Page1 / 15

HW1_solution - g? 9‘ f £4; 3?ng in)“ g {Mfg Q, ~66 {a...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online