Institute of Scientific Computing Technische Universität Braunschweig Dr. Bojana Rosic Dr. Thilo Moshagen Winter Term 2015 December 3, 2015 Introduction to Scientific Computing: SOLUTIONS: BANACHS F IXED P OINT T HEOREM Exercise 1: Contractive domain Consider (4 points) 3 2 xn − x2n . xn+1 = T (xn ) = 4 2 2 2 Show that T is a contraction on the interval , 1 , while T on , 1 is no contraction. 5 5 SOLUTION 1: For showing that T is a contraction it is sufficient to show that DT < 1 for all x ∈ 25 , 1 . So examine the Lipshitz constant. Obviously, as DT (xn ) = 3 (1 − xn ) , 2 DT takes its highest absolute value at the left interval boundary, where it is 34 −2 · 25 + 2 = So T is contractive there. For showing that T 2 is not a contraction it is sufficient to show DT 2 > 1 for one x ∈ 25 , 1 . First, for simplification and for getting the idea, T̃ (x) = 2x − x2 = −x(x − 2) and thus 36 45 = 18 20 . T̃ 2 (x) = (x(x − 2))2 = x2 (x − 2)2 , so has double zeros at 0 and 2. The derivative is DT̃ 2 = 2x(x − 2)2 + 2x2 (x − 2) = 2x(x − 2)(x − 2 + x) = 4x(x − 2)(x − 1), so it has one more zero at 1, so DT has zeros at 0 and 1 and is positive between them, so also inside the interval of interest. Further, ⇒ D2 T̃ 2 =4 [(x − 2)(x − 1) + x(x − 1) + x(x − 2)] =4 x2 − 3x + 2 + x2 − x + x2 − 2x =4 3x2 − 6x + 2 2 4 = x2 − 2x + 3 3 r 1 x1,2 =1 ± . 3 (1) (2) (3) (4) (5) p It is 1 − 1/ (3) = 0.42265 > 0.4 = 2/5, so the maximum of DT 2 is inside the interval. At this point, derivativeDT̃ 2 evaluates to 1.5396 (matlab or calculator), which is bigger than 3/2. But already 33 9 2 4 2 = 4 > 1. So T is not contractive. Remark Mind that neither T 2 nor T map from 25 , 1 −→ 25 , 1 , so Fixed Point iteration cannot be applied. The question was only about contractivity. Exercise 2: Fixed Point Iteration and Error Estimates (12 points) A fixed-point iteration xn+1 = φ(xn ) is defined by φ(x) = e−x . (a) Verify that φ(x) meets the conditions of Banach’s fixed point theorem for the interval [0.5,0.69]. Determine the constant of contraction ρ. (4 points) (b) Given x0 = 0.55. Calculate x1 and x2 and determine the a priori and a posterior error bounds. How many iterations are necessary if you look at the a priori estimation to achieve an accuracy of 10−15 ? (4 points) (c) With the help of computer make first 100 iterations. In which iteration do you achieve accuracy of 10−15 ? Compare the a priori and a posterior error bounds. (4 points) SOLUTION 2: • First, we state (by evaluation of interval boundaries and by the monotony of φ) that the image of [0.5 0.69] under φ is [0.60653 0.50158] and so a subset of [0.5 0.69], so φ : [0.50.69] −→ [0.50.69]. Second, obviously Dφ(x) = −e−x = −φ(x), so kDφ(x)k = e−x which is < 1 for x < 0. Left interval boundary has lowest derivative, and it evaluates to 0.60653 (matlab), which is the Lipshitz constant valid on the given interval, so ρ = 0.60653. • x1 = ex0 = 5.7695e − 01, x2 = ex1 = 5.6161e − 01 (matlab). The a priori error bound for first iteration is kxn − x∗ k ≤ ρn (1 − ρ)−1 kx1 − x0 k = 4.1543e − 02 (6) The a posteriori error bound is kxn+1 − x∗ k ≤ ρ(1 − ρ)−1 kxn+1 − xn k = 4.1543e − 02 (7) too, the expressions are the same for n = 1. For n = 2, a priori bound is 2.5197e-02, a posteriori is 2.3648e-02. • One remarks that the a posteriori estimate is lower than the a priori estimate, so more exact. In iteration 58 the desired precision is achieved. The a priori estimation guarantees this precision only after iteration 65. The script 1 2 3 4 5 6 7 8 9 int = [0.5, 0.69] exp(-int) %contractivity constant: rho = ans(1) %%b.) x(1)=0.55; n= 3% for i= 2:n x(i) = exp(-x(i-1)); 10 11 end n=100 12 13 14 15 16 17 18 19 for i= 2:n e_a_priori(i) if e_a_priori< 1e-15 i break; end end = abs(rhoˆ(i-1)*(x(2)-x(1))/(1-rho)); 20 21 22 pause; 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 %weg damite_a_priori = abs(rhoˆn*(x(2)-x(1))/(1-rho)) %e_a_posteriori = abs(rho*(x(n)-x(n-1))/(1-rho)) %%c) for i= 2:n x(i) = exp(-x(i-1)); e_a_posteriori(i) = abs(rho*(x(i)-x(i-1))/(1-rho)); if e_a_posteriori< 1e-15 i break; end end %fuer b.) plot(e_a_priori(2:end), ’r’) hold on plot(e_a_posteriori(2:end)) figure plot(e_a_priori(20:end), ’r’) hold on plot(e_a_posteriori(20:end)) lists the needed commands. Exercise 3: (a) Can we obtain the solution of a following nonlinear system x1 = g1 (x1 , x2 ) = 1 [1 − x2 − sin(x1 + x2 )] 10 x2 = g2 (x1 , x2 ) = 1 [2 + x1 + cos(x1 − x2 )] 10 in R2 by using the fixed point iterations? (16 points) (10 points) (b) Make the Matlab program for the fixed point iteration (k+1) x∗ (k) = F (x∗ ) in which F = (g1 , g2 )T . Compute the solution x∗ = (x1∗ , x2∗ ) by starting from the initial point (0, 0)T . Plot obtained results. (6 points) SOLUTION 2: • As fixed point iteration on R2 is asked, one has to check if g(R2 ) = R2 , and prove the contractivity everywhere. The first condition is obviously fulfilled. Second, ! ! − cos(x1 + x2 ) 1 − cos(x1 + x2 ) ∇g1 1 . (8) = Dg = ∇g = 10 1 − sin(x1 − x2 ) sin(x1 − x2 ) ∇g2 According to Banachs fixed point theorem, it is sufficient to find one norm in which kDgk < 1. It P is k.k∞ = maxi j |aij |, and it is temptative to try this one, as cancellations can be expected: first line: |− cos(x1 + x2 )| + |1 − cos(x1 + x2 )| = cos(x1 + x2 ) + 1 − cos(x1 + x2 ) = 1 (9) second line: |1 − sin(x1 − x2 )| + |sin(x1 − x2 )| = 1 − sin(x1 − x2 ) + sin(x1 − x2 ) = 1, (10) so this matrix norm is 1/10, and the mapping is contractive. Banach fixed point iteration is applicable. • The script 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 function task3(maxIter) x(1,:)= [0 0 ]; for i=2:maxIter x(i,:)= F(x(i-1,:)); end plot(x(:,1));hold on plot(x(:,2)) %plot(x) figure plot([x(:,1) x(:,2)]) title(’x1 and x2 stepwise’) legend(’x1’, ’x2’) figure plot(x(:,1), x(:,2)) title(’Search path in \matbb R’) end 17 18 19 20 21 function out=F(x) out(1)=(1-x(2)-sin(x(1)+x(2)))/10; out(2)=2+x(1)+cos(x(1)-x(2)) end solves the task.
© Copyright 2026 Paperzz