HW3Solutions - W, 11.2(a) Approximation and Actual fundion...

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: W, 11.2(a) Approximation and Actual fundion for y = 11x 1.1 ~ 0.9 0. B 0.7- (16*- 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 x 105 (Approximation-Error)2 Equation is -0.1086xp(x) + 0.0095in(x) + 1.287I'(x) — Approximation using sin(x), é‘, F(x) — Adual y=1 Ix 4 l I l l | I ‘l 3.5~ v 25 error is 0.000030761610143 l Approximate Equation = -0.10786x + 0.0094sin(x) + 1.2869F(x) RSS = 2|(approx—actual)2| = 3.0762*10'5 Fifi/M» Mex/mm 11.2 (b) Approximation and Actual fundion for y = 11x 100 — Approximation using sin(x), e", l"(x) 90 —-—Aaua| y=1lx 30 _ 70 — so _ > 50 — Equation is 0.628exp(x) -1.327sin(x) + 1.000I'(x) (Approximation-Error)2 . 0. 03 T I I I | T | I r 0.025 — 0.02 — > 0.015 — error is 0.340256272109758 0.01 0.005 Approximate Equation = 0.62826x - 1.8274sin(x) + 1.0000 F(X) RSS = 2|(appr0X-actual)2| = 0.3403 (1 . Marti M‘s 5'5 AN {waif T‘mfler a. ma «wjmm‘a awe. I (O) "” 30‘ “WIS, I Comrde (hi Mafia??? \ia.«l%€eg' CM“ viii-maps M [J l} 4m firm;er E3 4% Qimi ’0 Wm’h 17"“ new” o’FWhic/h £5. giamxm afiwfifi, M90, he woo»,le W H} 9\(0):I (“I‘M/h jCzQi/p mm)” W .n“ Coerwgcgmf emf ghwfigaum % Frank Coleman % Problem 11.2 clc; clear all; x = linspace(0.0001,1,100); Y = [1 -/X]'; A = [exp(X)', Si1£1(X)',ganflrlnflOKY]; [QJ] = qr(A,0); W = Q'*y; c = [1; c(3) = w(3)/r(3,3); 0(2) = (W(2)-C(3)*r(2,3))/r(2,2); c(l) = (w(1)-c(2)*r(1,2)-c(3)*r(l,3))/r(1,1); approx = c(1)*exp(x) + c(2)*sin(x) + c(3)*gamma(x); errorl = sum(abs(approx-y').’\2) captionl = sprintf('Equation is %0.3fexp(x) %0.3fsin(x) + %0.3f\\Gamma(x)', c(l),c(2),c(3)); caption2 = sprintf('RA2 error is %0.15f‘, errorl); figure(1) hold on plot(x,approx) P10t(XQY) axis([0 1 0 100]) title('Approximation and Actual function for y = l/x') x1abe1('x') ylabe1('y') legend('Approximation using sin(x), eAx, \Gamma(x)','Actual y=1/x') text(.4,50,captionl); hold off print -djpeg probl 12b.jpg figure(2) plot(x, (approx-y')."2) title('(Approximation-Error)"2') x1abe1('x') ylabel('y') text(0. 5 ,.01 5 ,caption2) print -djpeg probl 12berror.jpg 12.3 (a)Eigenvalues of a random matrix =8 m=16 ‘1 u The above are histograms for the eigenvalues of 100 matrices for each value of m above. The eigenvalues are very close to Q, magma; {1W ~§ i If you take 100 random matrices and supei‘impose all their eigenvalues in a single plot (for m=8,16,etc.), m=8 m=16 .1.5 -1.5 the eigenvalues begin to form an ellipse as m gets larger. If we look at the graph of the maximum, average, and minimum spectral radius over 100 matrices for each value of m=8,16,32,64,128,256, we see that the values are converging to a value close to 1. (b) Norms of a random matrix. Doing the same as above for the norm, we see that the max, average, and min are converging to a value close to 2. 2.6 2.4 2.2 1.8 1.6 1.4 Thus, the inequality does not appear to approach equality as m approaches infinity. (0) Condition numbers — or more simply, the smallest singular value — of a matrix. Repeating the same as above, we see that the max, average, and min are converging to a value close to 0. 0.25 0.2 0.15 0.1 0.05 The following table shows the number of matrices (out of 100) that achieve a minimum singular value of <= 1/2 , 1/1, etc. for each value of m. 100 100 100 100 100 100 100 100 E- 100 100 100 1/64 12 24 75 99 100 15 1/256 2 9 As m increases, the smallest singular values get smaller and smaller. (d) Repeating (aH c) for random triangular instead of full matrices (a)Eigenvalues of a random matrix m=8 m=1 6 1 a5 n . . . .1 5 .x 41.5 as The above are histograms for the eigenvalues of 100 matrices for each value of m above. The eigenvalues get closer to 0 as m increases. If you take 100 random matrices and superimpose all their eigenvalues in a single plot (for m=8, l 6,etc.), u25 mo the eigenvalues get larger and larger and form no apparent pattern. However, the imaginary part gets smaller and smaller, so it may be inferred that the eigenvalues converge to real numbers as m gets larger. If we look at the graph of the maximum, average, and minimum spectral radius over 100 matrices for each value of m=8,16,32,64,128,256,5 12,1024, we see that the values are converging to a value closer and closer to 0. {29.1 1.4- (b) Norms of a random matrix. Doing the same as above for the norm, we see that the max, average, and min are converging to a value close to 1.6. 1.9— 1.8:- 1.7- 1.6- 1.5 1.4 1.3- 1.2- 1.1 1- 09 _|____ I I | I ___|__ I I __|—_] Thus, the inequality does not appear to approach equality as m approaches infinity. (0) Condition numbers — or more simply, the smallest singular value — of a matrix. Repeating the same as above, we see that the max, average, and min are converging to 0. 0.06 0.05 0.04 0.03 0.02 0.01 The following table shows the number of matrices (out of 100) that achieve a minimum singular value of <= 1/2 , %, etc. for each value of m. - m=16 m=32 m=64 m=128 100 100 100 100 100 100 ' 100 100 100 1/8 100 100 100 100 1/16_ 100 100 100 100 1/32 98 100 100 100 1/64 93 100 100 100 100 100 1/128 89 100 As m increases, the smallest singular values get smaller and smaller. 100 l 100 L100 13.3 (a) x=1.920:.001:2.080; y=X.A9—18*X.A8+l44*x.A7*672*X.A6+2016*X.A5—4O32*X.A4+5376*X.A3— 4608*x.“2+2304*x—512; plot (x,y) ; -1.5 1.9 1.92 1.94 1.96 1.98 2 2.02 2.04 2.06 2.08 2.1 (b) x=1.920:.001:2.080; z=(x—2).A9; plot(x,z); x 1o"° .1_5 I I I l I l I 1 | 1.9 1.92 1.94 1.96 1.98 2 2.02 2.04 2.06 2.08 2.1 HP» »__MWM . Lg} X :r , Thai}? 3 C 6 “3+ {Maw “WV?!” X'f’: EM 5&3 “*3 80 Zxé ZCfim as Emu—a0, 2L emf/SQ QX:O(EW:}_:72Mgflzwghéj: i (7/ I 2’ x Thflegrfil X 7, Q S‘mw Kfi'OCirQBI. xix: News , ms, mm «3: {mm m, {waéawgé‘ééimimgfim 1+ 2mm) 5; “my 53% we 2: \+ ()vis) ’r =3 ‘4» 2.0(359? :L WM We \naw (HOMQ‘KE%-0<1£.n{§\} 2’: § §« {Mg kg? Q0) U + mm; :1 + mam} / -_._m.. __ K § ! a g; “a B3 m, w has/a (Mafiaw‘gm agaélm‘g; :: H M‘WM, Wading Min gm; ‘9} (momma HM mi N 5mm W Memwmiéér::‘§> : 539m: WBEEEWU w am"; momma; 0 cm) 93%}; “M! 3S eiuivaim 4:77 y/ CHOLEQfiCL-FCJfi/vfijim : \%’0"(,€m‘)' K “‘4'? ~~~~~~~~~~~~~~~~~~ " WW” a: , r/ 5.2;: mm {JéfiaaézmfiéwWm}; E5“ (:5va 71% £22 «£4 m $63-55; W? «1 3: ’ (CM 9‘ L HAL 3 WOCEM‘) 035‘); \{XenQiTjg wfi'éq Kiléim, st, QUX‘F‘XWQ U34) vxigéglafi Wat)“ gigggm Si. x@g—: bfi‘gYHQ) Hxxzm, my: mm film: €¥fi€x%§“iifgéfi§(‘*a/ WHM - : (“mg ma mung), iidéfwm mm + xmealwg :— x(g+g;) +xCH—22)/ chififlgfiaéa mm a; «Emwe :XUHI‘) : in? = H?) Mm:- «9m @/ gainfim: x2, Wig >< Hflsx -2<, EM) : Has} 6:3?) = (mm Wmfimfi (a 58m : (mm ( >4 (HEMUM‘); m em 2 (x(t+€c>m;??'x(kmm i m; éwm qwmj 22% >2“ 2 xéHEQ), 61=0+2Mfl~¥§>wi wmfimmmi =i+ an», § mm— :32 300: ><U+<a2§~xmm =r $2»? tea 349mb Mg?) @fiflflflmgfiw aw E EZEEM ‘5” WMYMM 6;) szY€-®\§9§, Sb‘ufingl (amgufifi gm +(x3—Jx-‘sx, Em: {'95X}@§M¥3fl2{a§ Hgmééwi éaséfim : ‘(x(x+m+><U+2méa+EZ m 4;th : HMS) w i ~%E1 W Hafiz @ifi‘fl' ‘ =3? 1% BM‘LWGVJ may} M M Li: Léfi’ x: e (NM, "and 5? saw; “2,153 3 mm. M ‘ X Tm \\R><3—~Hmli 2 “we- 11 .3 MM :3 Gena, Q W.Wfl.ewmmmflmwwww WW». mm“ \\ 1 u GU Dam Xe @, saiufia H), Cvmgufld cw $45.... M was x4, "Mm: «999%: H (x‘; m (fifzéfiwafi‘rgéfifii Hi}; :2 Z(X(H‘afi,“)€{§%%€;}{2M3; WEMM =1 x-{Hafgi Ha") m x a figiwaé : x6 Wig—xégiffiyi T“ g} “‘3 fl (HX‘E: 7% SBM‘me’fg’ 5+4M£i ififim g f; _V «r “5%, Eéfifai M WAM‘) m)”, wax 1M 5 Ham Mm =¥£H3ma w mm ~ H( 0):, 0 V “' ~ ' N: we ‘ \usgm W35, ywx -0 mama, x XU ) I“ (x) =- “fth 4&1) a 0 Te, ba kwc‘vfi Wabgé (.2) Z 1—: mama «- < Em ‘ $0 me $412? when, F»: SH f K® k® U‘kiz)(hL-Ji:)@ CH2:,:)U—rin)(b< 414:) @~~ (H EMU—x: 29)» (w 291;“)(wlifigém 1: (Riflflw (\123)[(HZL)EU+€\) (\+()+(t—+QH)U$.§:)3 . \ +UJ< aux” Q'WXH .li/"vgfl *" ‘f‘ UT imXH’ 252} m (HQ954)(\1111« J); . - 1 g " '9’ \i\\ Ekit‘ " ‘59‘ ‘ ‘szl‘ ‘9’)“ " \st‘. ‘2$2.\ «" \Esns-«I 3- Elm E [w 8.2% kULimL)T” «a oufigbfifiwwh {Htfliwaj M.) II S A, (ICE/m) >> 1: -‘~ ébfifmmede) = a [90 \U, i, g , S\ < 2% 7 6M» + 00L ‘LM | 6‘ Elm \Cé « an \\ 0+ 5‘2"“)(81’616) u < u (H 9« mxe film)“ W W “W V \._ A w \\ a n V lie u ' u e; z; “im‘vz‘g'im 62»? i1 11%“ : 2MC9*%)J(2J(%) gape ' as gm.) 0 TV“ (7 .HAT 9 o.\%bv‘i4( M m “i j; ho+ 9T‘mblé, 4WW (,6) . we Ron/é ZS; ~—-L 5 ‘ E C q k 1m Kl W‘c-LMMQ) @LH n) H‘ 22,0096 3%“; @W $3 {H €90LW-2s2) ” {High} {[{Jifi‘%£»m x%) :, (kfén)[flt‘(H‘iL)LVVCbti;)[Uw23.)(:¢%\_k-v, 1* (His) [CH 3.9"“)(VV2941) -— (\+€9r\, g4) (H.123; ~;~;<M x i) + [HisJUfisfiw mam) UX-‘in-§>¢~ x in} ] \9/|\" \is't ($141“ lgswnfl "‘V 5:" EM 2» ‘f 4. may») ~ 1+ Qx+agm in? k \\ + [WV WTD‘“ *“demllU’Li’ w t «w + [\‘Q’L‘zk~*\)/Zm~kk—to(2mi ‘yJ (ugh fig.) r I s : [arm—U353“? +U74-Evg-Eggw ,L._L..‘;)T (fix Zx-éx.» NH,W##_,fi.__uflwfiw.,,,__ A _. 2 {M W T 2H1Z‘5w-t’ 22W““ (543” 2 +[E—IDE g] gm g liexggw v» {fifiiek + 2. [w Wits w + (3%“) Em 5 CEf’iQ—r zeém "—1" e *‘(W‘tz‘ej 2m: ‘3 iii/fl : r (-24: 92m 2/ MAM) “a hag Thus '{r‘v'TFz Mt'jyfi4Wm “as shame. \Hm fix): smog® $74ch an) ssgxgq, :(Ely) = ( SMCX) Q9 fiv‘ (x+ 3w) ; ( Q‘Vb) $38464} x (Riv) gIv.(X-r in”) : 0+ 1m {CH a) sin in 2 01’ E») m (A: w: 2w] 2 Q+<Z,«)(,('t 5,»)(lfig) §TMCX) )4 3TH ficng Kid. \2»\ A95! 9: 2w. 2 WO<>><cruLx+ev~y 0(iw) ,. .J’ “ “wait TW, 1“”‘5 “*3 “"m ‘5 3% ...
View Full Document

This note was uploaded on 12/30/2011 for the course MATH 6643 taught by Professor Staff during the Fall '08 term at Georgia Institute of Technology.

Page1 / 15

HW3Solutions - W, 11.2(a) Approximation and Actual fundion...

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