Professional Documents
Culture Documents
Exercise Session Nonlinear Equation
Exercise Session Nonlinear Equation
Exercise 1
Apply function bisection on the interval [−2, 1] with a tolerance tol = 10−12 . Which of the
two zeros of the function is obtained? How many iterations are necessary?
Compute α1 and α2 with function newton, using a tolerance tol = 10−12 and choosing
graphically the initial guess. For both the approximations of α1 and α2 , compare the number
of iterations necessary to achieve the absolute error tolerance tol with the stopping criterion
based on the absolute error. Which zero is approximated faster by the Newton method?
Why?
Exercise 2
Consider the function f (x) = e−x − a, whose only solution is x∗ = − ln(a). Using function
newton, approximate x∗ with n = 8 iterations with the stopping criterion based on the
absolute error in the following cases
1
Analyse the results obtained, recalling that if x is sufficiently close to x∗ then
|f (x)|
|x − x∗ | ' .
|f 0 (x∗ )|
In which cases among (a), (b), and (c) would you trust the stopping criterion based on the
residual?
Exercise 3
Consider the nonlinear equation
π π 3
f (x) = arctan 7 x − + sin x− = 0 x ∈ [−1, 6]
2 2
2. Compute the zero with the newton method, se the tolerance equal to 10−10 and an
initial guess equal to x(0) = 1.5. Then try to use an initial guess x(0) = 4. Compute the
absolute error (the zero x∗ is equal to π/2). Motivate the obtained results.
3. Check if it is possible to use the bisection method. Use the Matlab function bisection
with a tolerance equal to 10−6 .
Exercise 4
Consider the nonlinear equation ex − 2x2 = 0, x ∈ [−2, 4]. Compute graphically the
number of solutions of the equation and using the MATLAB command fsolve. Compute all
the solutions of the equation using the following methods, with the appropriate values of the
input arguments
iteration function will converge to, and select an appropriate initial value.)
Set the tolerance equal to 10−6 and the maximum number of iterations equal to 100.
Compare the number of iterations needed by the methods to reduce the error under the
selected tolerance.
2
Exercise 5
3x2 − 5x x
φ1 = φ2 = x − 2 + .
x−1 x−1
Which iteration function could be used to compute the positive solution x∗ of the equation
f (x∗ ) = 0 with the fixed point method?
(c) Approximate x∗ with the fixed point method with a tolerance equal to 10−9 , initial guess
x(0) = 1.2, and maximum number of iterations nmax = 1000.
(d) Compute x∗ with Newton method, by using a tolerance equal to 10−9 , initial guess x(0) =
1.2, and maximum number of iterations nmax = 1000.