Lösning v Tentmen i Numerisk Anlys V3, FMN2, 312 Crmen Arévlo Denn tentmen börjr kl 14: och slutr kl 17:. För godkänt krävs minst 5 poäng v 1: 5 66 poäng = betyg 3, 67 83 poäng = betyg 4, 84 1 poäng = betyg 5 (prelilminär siffror). Du får nvänd miniräknre på skrivningen, men läroboken, overhedbilder från föreläsningrn och nnt skriftlilgt mteril är inte tillåtn hjälpmedel. This exm strts t 14: nd ends t 17:. In order to pss, minimum of 5 points out of the totl 1 is required: 5 66 points = grde 3, 67 83 points = grde 4, 84 1 points = grde 5 (preliminry figures). You re llowed to use pocket clcultor during the exm, but no textbook, lecture notes or other written mteril is permitted. 1. (13p) Låt f(x) vr en gltt (oändligt mång gånger kontinuerligt deriverbr) funktion och låt h vr ett kort steg. Vis med Tylorutuveckling tt uttrycket nedn är en pproximtion till f (x). 4f(x + h) 3f(x) f(x + 2h) 2h Vd är pproximtionens trunktionsfel? Suppose tht f(x) is smooth (infinitely mny times continuously differentible) function nd tht h is smll step. Use Tylor expnsions to show tht the expression below is n pproximtion to f (x). 4f(x + h) 3f(x) f(x + 2h) 2h Wht is the trunction error in this pproximtion? 4f(x + h) = 4f(x) + 4hf (x) + 2h 2 f (x) + 2 3 h3 f (x) + O(h 4 ) 3f(x) = 3f(x) f(x + 2h) = f(x) 2hf (x) 2h 2 f (x) 4 3 h3 f (x) + O(h 4 ) = 4f(x + h) 3f(x) f(x + 2h) = 2hf (x) 2 3 h3 f (x) + O(h 4 ) 4f(x + h) 3f(x) f(x + 2h) 2h Trunction error: 1 3 h2 f (ξ) 1 + 1 3 h2 f (x) + O(h 3 ) = f (x)
2. Snt eller flskt (True or flse): () (2p) Om en mtris är ickesingulär, så beror ntlet lösningr till det linjär systemet Ax = b på vlet v vektorn i högerledet, b. If mtrix is nonsingulr, then the number of solutions to the liner system Ax = b depends on the prticulr choice of the right-hnd side vector b. Flse. (b) (2p) När mn löser ett linjärt ekvtionssystem med LU fktorisering och tringulär återsubstitution, så är fktoriseringsrbetet ungfär lik stort som rbetet med frm- och bkåtsubstitutionen. In solving system of liner equtions by LU fctoriztion nd tringulr substitutions, the mount of work due to fctoriztion is roughly equl to tht due to forwrd nd bckwrd substitution. Flse. Fctoriztion tkes more work thn substitution. (c) (2p) Om A är en n n mtris, så är komplexiteten v bkåtsubstitution O(n 2 ). If A is n n n mtrix, the complexity of bckwrd substitution is O(n 2 ). True. (d) (2p) A 1 = A T. (No trnsltion) True. (e) (2p) Om A är en n n ickesingulär mtris, så är cond(a)=cond(a 1 ). If A is ny n n nonsingulr mtrix, then cond(a)=cond(a 1 ). True. 3. (13p) Vi önskr beräkn vståndet med bil melln städern Helsingborg, Trelleborg och Kivik. Vi hr mätt vstå nden från Lund till Helsingbirg och fått 49 km; Trelleborg Lund 29 km; Helsingborg Lund Kivik 131 km; slutligen vr sträckn Kivik Lund Trelleborg 112 km. Felet vr ungefär detsmm i ll mätningr. Ställ upp det överbestämd system som tr hänsyn till dess fyr mätdt, med tre obeknt som skll representer vstånden melln Lund och vr och en v de tre ndr städern. Bestäm den lösning som minimerr residulen. We wnt to clculte the distnce by cr between Lund nd the cities of Helsingborg, Trelleborg nd Kivik. We mesured the distnce from Lund to Helsingborg to be 49 km, Trelleborg Lund ws 29 km; Helsingborg Lund Kivik ws 131 km; nd Kivik Lund Trelleborg ws 112 km. The error ws roughly the sme for ll mesurements. Write the overdetermined system tht tkes these four mesurements into ccount, for the 2
three unknowns tht represent the distnces between Lund nd ech of the other three cities. Find the solution tht minimizes the residul. The equtions re: x = d(l, H) y = d(l, T ) z = d(l, K) x = 49 y = 29 x + z = 131 y + z = 112 So the overdetermined system to solve is: 1 1 x 1 1 y = z 1 1 And the norml equtions re: 2 1 2 1 1 1 2 x y z = 49 29 131 112 18 141 243 with solution: x = 48.75, y = 29.25 nd z = 82.5. 4. (13p) Om Newtons metod nvänds för tt finn nollstället x = 1 till ett polynom (som lltså hr p(1) = ), så erhålles följnde sekvens v pproximtioner: x = 2., x 1 = 1.5, x 2 = 1.25, x 3 = 1.125, x 4 = 1.625, x 5 = 1.3125. Vd är kovergenshstigheten? Är x = 1 en enkel eller multipel-rot till p(x) =? If the Newton method is pplied to find the zero, x = 1, of polynomil (i.e., p(1) = ), the following sequence of pproximtions is obtined: x = 2., x 1 = 1.5, x 2 = 1.25, x 3 = 1.125, x 4 = 1.625, x 5 = 1.3125. Wht is the rte of convergence? Is x = 1 simple or multiple root of p(x) =? The sequence of errors is 1.,.5,.25,.125,.625,.3125. This shows tht e k+1 e k =.5 so the rte of convergence is liner nd x = 1 must be multiple root (otherwise the convergence rte would hve been 2.) 3
5. (13p) Konstruer en tbell med dividerde differenser för funktionen f(x) = 3 sin 2 (πx/6), från tbelldt givn nedn. Konstruer Newtoninterpoltionspolynom v grd 1, 2 och 3. Construct the tble of divided differences for the function f(x) = 3 sin 2 (πx/6), tbulted below. Construct Newton interpoltion polynomils of degrees 1, 2 nd 3. k 1 2 3 x k. 1. 2. 3. f(x k )..75 2.25 3. 1.75.75 2 2.25 1.5.375 3 3..75 -.375 -.25 p 1 (x) =.75x p 2 (x) =.75x +.375x(x 1) p 3 (x) =.75x +.375x(x 1).25x(x 1)(x 2) 6. (13p) Konstruer en kvdrturformel v typen f(x)dx w 1 f( 1 3 ) + w 2f( 2 3 ) som är exkt för polynom v så högt grdtl som möjligt. formelns grd? Construct the qudrture formul of the form Vd är f(x)dx w 1 f( 1 3 ) + w 2f( 2 3 ) tht is exct for polynomils of the highest degree possible. Wht is the degree of the formul? 1dx = 1 = w 1 + w 2 xdx = 1 2 = 1 3 w 1 + 2 3 w 2 4
Then w 1 = w 2 = 1/2, but x 2 dx = 1 3 1 9 w 1 + 4 9 w 2 therefore the degree of the formul is 1. 7. (12p) Ange för vr och en v nednstående metoder för lösning v begynnelsevärdesproblem nmn, typ (flerstegs- eller Runge Kutt, smt explicit eller implicit), stbilitetsegenskp (ovillkorligt stbil eller inte) och om metoden är lämplig för styv problem eller ej. For ech of the following methods for solving initil vlue problems, fill in its nme, type (multistep or Runge-Kutt, nd explicit or implicit), stbility property (unconditionlly stble or not) nd whether it is pproprite for stiff problems. () y k+1 = y k + hf(t k, y k ) (b) y k+1 = y k + hf(t k+1, y k+1 ) (c) y k+1 = y k + h( 1 2 k 1 + 1 2 k 2) k 1 = f(t k, y k ) k 2 = f(t k + h, y k + hk 1 ) (d) 1 1/2 1/2 1/2 1/2 () y k+1 = y k + hf(t k, y k ) Explicit Euler, multistep nd one-step, explicit, not unconditionlly stble, not pproprite for stiff problems. (b) y k+1 = y k +hf(t k+1, y k+1 ) Implicit Euler, multistep nd one-step, implicit, unconditionlly stble, pproprite for stiff problems. (c) y k+1 = y k + h( 1 2 k 1 + 1 2 k 2) k 1 = f(t k, y k ) k 2 = f(t k + h, y k + hk 1 ) Heun s method, Runge-Kutt, explicit, not unconditionlly stble, not pproprite for stiff problems. (d) 1 1/2 1/2 Crnk-Nicholson, Runge-Kutt, implicit, unconditionlly 1/2 1/2 stble, pproprite for stiff problems. 8. (13p) Betrkt rndvärdesproblemet y 2t 3 =, y() = 1, y(1) = 1. 5
Använd Glerkins metod för tt pproximer lösningen med ett styckvis linjärt polynom, och nvänd tre nätpunkter. Skiss den pproximtiv lösningen. Kom ihåg tt Glerkins ortogonlitetsvillkor är n ( j=1 Φ j(t)φ i(t)dt)x j = Consider the boundry vlue problem f(t)φ i (t)dt. y 2t 3 =, y() = 1, y(1) = 1 Apply the Glerkin method to pproximte the solution by piecewise liner polynomil using three mesh points. Grph the pproximte solution. Recll tht the Glerkin orthogonlity condition is n ( j=1 Φ j(t)φ i(t)dt)x j = f(t)φ i (t)dt. where y(t) v(t, x) = x 1 Φ 1 (t) + x 2 Φ 2 (t) + x 3 Φ 3 (t) Φ 1 (t) = Φ 2 (t) = Φ 3 (t) = { 2t + 1, (,1/2);, (1/2,1). { 2t, (,1/2); 2t + 2, (1/2,1). {, (,1/2); 2t 1, (1/2,1). Boundry conditions: v(, x) = x 1 = 1, v(1, x) = x 3 = 1. Orthogonlity condition for Φ 2 (t): /2 4dt x 2 3 ( j=1 Φ j(t)φ 2(t)dt)x j = 4dt 4dt = 1/2 /2 2t 3 Φ 2 (t)dt 4t 4 dt+ ( 4t 4 +4t 3 )dt x 2 = 3/64 1/2 6
1.8.6.4.2.2.4.6.8 1.1.2.3.4.5.6.7.8.9 1 7