Adv Math Lab10

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Advanced Mathematical Methods for Energy Engineering A.A. 2012/2013 Lecturer: M. Verani TA: I. Mazzieri Lab.

. 8: Rootfinding for nonlinear system of equations: Newton method.

The description and the analysis of the Newtons Method for the solution of systems of nonlinear equations can be found in to [1, Chapter 7].

Exercise 1 - Nonlinear Equations


We want to solve the problem of nding the roots of the nonlinear equation F (x) = 0, where F is dened by: F (x) = x3 (2 + e)x2 + (2e + 1)x + (1 e) cosh(x 1), x [0.5, 6.5] (1)

1. Plot the functions F and F in the interval [0.5, 6.5] highlighting the roots of the functions. (Hint: use the command grid on). 2. Observe the graphics of F and F and discuss the property of convergence of the Newtons Method (NM) for all the roots of F . Given that one of the exact values of the roots is 1 = 1 compute its multiplicity. 3. Solve the problem of nding the roots of F using the NM, with the function newton.m, xing the tolerance tol = 1e-6. Starting from the considerations made at the previous points compute the value of each root selecting a suitable starting point x0. In the case of 1 = 1 plot in a semilogarithmic scale the error as a function of the number of iterations made by the standard NM. 4. Estimate the order of convergence of the method (employed for the approximation of the root 1 = 1) using the function estimate_order.m. 5. Consider the function f (x) = cos(2x)2 x2 , x [0, 1.5] .

Plot the graphic of F , x the tolerance tol = 1e-10 and nd the roots of the equation. How much is convenient to choose the starting point x0 such that the NM converges to the root 0.5149? Justify the answer.

Exercise 2 - System of nonlinear equations


Consider the system of nonlinear equations ex1 +x2 1 = 0 2 2 ex1 x2 1 = 0, which admits the unique solution x = 0. In this case, F(x) = [ex1 +x2 1, ex1 x2 1] . 1
2 2 2 2 2 2

(2)

1. Starting from the initial vector x0 = [0.1; 0.1], set the tolerance tol = 1e-10, the maximum number of iterations nmax = 500 and solve the problem F(x) = 0 using the Matlab function newtonsys.m. 2. Using the same set of parameters at the previous point, solve the system (2) using the quasi-newton method implemented in the Matlab function broyden.m. 3. Repeat point 1. choosing the initial guess x0 = [10; 10] and x0 = [20; 20], respectively. Comment on the results.

Exercise 3 - System of nonlinear equations


Consider the system of nonlinear equations in the form: nd x R2 such that F(x ) = 0, where
2 F1 (x1 , x2 ) = x2 1 + x2 1 = 0, F2 (x1 , x2 ) = sin(x1 /2) + x3 2 = 0.

1. Starting from the initial vector x0 = [1; 1], set the tolerance tol = 1e-5, the maximum number of iterations nmax = 10 and solve the problem F(x) = 0 using the Matlab function newtonsys.m.

References
[1] A. Quarteroni, R. Sacco, F. Saleri, Numerical mathematics. Springer-Verlag (Berlin 2007)

You might also like