• Non ci sono risultati.

Zeros of functions with Matlab: Accelerating convergence

N/A
N/A
Protected

Academic year: 2021

Condividi "Zeros of functions with Matlab: Accelerating convergence"

Copied!
8
0
0

Testo completo

(1)

Zeros of functions with Matlab: Accelerating convergence

Zeros of functions with Matlab: Accelerating convergence

Emma Perracchione

Corso di Calcolo Numerico per Ingegneria Meccanica - Matr. PARI (Univ. PD)

Gli esercizi sono presi dal libro: S. De Marchi, D. Poggiali, Exercices of numerical calculus with solutions in Matlab/Octave.

A.A. 2018/2019

(2)

Materiale

Materiale

TUTTO IL MATERIALE SI TROVA AL SEGUENTE LINK E VERRA’

AGGIORNATO AD OGNI LEZIONE.

https://www.math.unipd.it/~emma/CN1819.html OPUURE VEDASI

https://elearning.unipd.it/dii/course/view.php?id=1720

(3)

Zeros of functions with Matlab: Accelerating convergence Remarks

Introduction

Finding the zeros of a function means finding:

¯

x : f (¯ x ) = 0.

We already know three approaches to solve such problem:

1

bisection method,

2

fixed-point iteration,

3

Newton’s method.

In this lecture we will see the Aitken’s method.

It is used to accelerate the convergence of iterative methods.

(4)

Exercises

Exercise 1

Exercise

Take the function

f (x ) = x 2 − c,

c ≥ 0, and the following two fixed point iteration functions:

1

g 1 (x ) = x − x 2 − c 2x .

2

g 2 (x ) = x − x 2 − c 2x −



x − x 2 − c 2x

 2

− c

2



x − x 2 − c 2x

 .

Study the convergence of these two iterative methods. In particular take

c = 2 or c = 3 and write a Matlab script called Esercizio1 for testing

the claims.

(5)

Zeros of functions with Matlab: Accelerating convergence Remarks

Aitken

Given x = g (x ), from the fixed point iteration theorem, we know that lim

k→∞

x k − ¯ x

x k−1 − ¯ x = g

0

(¯ x ), (1) and we also know that

λ k = x k − x k−1

x k−1 − x k−2 ≈ g

0

(¯ x ),

Then, by (1) we have

x k − x k+1

x k−1 − x k+1 ≈ λ k .

By solving such equation for x k+1 , we have:

(6)

Remarks

Aitken

x k+1 = x k − λ k x k−1

1 − λ k = x k − λ k x k + λ k x k − λ k x k−1

1 − λ k =

= x k + λ k (x k − x k−1 ) 1 − λ k .

Then, by replacing the value of λ k , we obtain the Aitken’s iteration:

x k+1 = x k − (x k − x k−1 ) 2 x k − 2x k−1 + x k−2 .

Property

Let x k+1 = g (x k ) an iterative fixed point method of order p ≥ 1. If p = 1

Aitken converges to the simple root ¯ x with order 2, if p ≥ 2 then its

convergence order is 2p − 1.

(7)

Zeros of functions with Matlab: Accelerating convergence Exercises

Exercise 2

Exercise

Take the function f (x ) = x 2 − log(x 2 + 2) of which we want to compute the positive zero. For that use bisection, Newton, Aikten (alredy in your folder!) and fixed point with the iteration function g (x ) = plog(x 2 + 2).

Are the convergence hypothesis for the fixed point and Newton methods satisfied? On a script called Esercizio2 do the following

plot (semilogy) the absolute errors showing the different

convergence orders of the methods (fix the tolerance as 1.e − 10).

Hint

It is reasonable to think that the slower one is bisection. Let us say that it

needs n iteration. Then, for nmax = 1, . . . , n evaluate the errors of the

different methods using as reference solution the one given by fzero.

(8)

Exercises

Exercise 3

Exercise

Write a script called Esercizio3. Take the function f (x ) = tan(x ) − log(x 2 + 2),

x ∈ [0, 1], which has a zero ¯ x ≈ 0.76. Consider the fixed point iteration with

g (x ) = arctan(log(x 2 + 2)).

Compare the behavior of this iterative scheme and the Aitken’s one for the computation of ¯ x .

Hint

Study the convergence order at “each” iteration as in the previous exercise.

Riferimenti

Documenti correlati

Analisi numerica dello stimatore Band-inverse e confronto con lo stimatore FP .... Processo autoregressivo non stazionario di ordine m:

The main drawback is that with Newton’s method we need to start with an initial condition sufficiently close to the zeros of

Write a Matlab function called fixedpoint for computing the zeros of functions with the fixed point

The graphs [20] can be explained by the presence of a significant stray thermal flux (Fig. 3) in the studied TFPC, which heats the measuring junction of the TC while melting

Being f () < , the origin is a source and the existence of a limit cycle is granted by the Poincaré-Bendixson theorem, while the uniqueness is given by monotonicity properties.

(2015), Aspetti pastorali e giuridici della gestione degli immobili ecclesiastici, Convegno nazionale degli economi e direttori degli uffici amministrativi delle

punti che si attraggono o si respingono tra loro. Planar central configurations as fixed points. Fixed Point Theory Appl. Finiteness of relative equilibria of the four-body problem.

[…] Not only can entire IL competencies be fossilized in individual learners performing in their own interlingual situation, but also in whole groups of