• Aucun résultat trouvé

2 Iterative methods for linear systems

N/A
N/A
Protected

Academic year: 2022

Partager "2 Iterative methods for linear systems"

Copied!
3
0
0

Texte intégral

(1)

EFREI – M1 IFM Numerical analysis applied to financial issues

Practical Work #2

1 Root of a function

Let f be the function

f(x)=x2e−x−1.

There exists a uniqueα∈Rsuch thatf(α)=0. Moreover, it is straightforward thatα∈(−1, 0). We assess in this section several methods to provide a “good” approximation ofα.

1.1 Bisection

The bisection method relies on the intermediate value theorem which states that as f is continuous, if f(x)<0 andf(y)>0, thenαlies betweenxandy. The sequenceanwhich is expected to converge towards αis thus constructed like this:

Algorithm 1Bisection method

Data:a,bsuch thatf(a)<0 andf(b)>0 a1a,b1b,ca+2b

n←1

whilef(c)6=0do iff(an)f(c)<0then

an+1an

bn+1c else

an+1c bn+1bn end if can+1+2bn+1 nn+1 end while

The key point is the stopping criterion. We may never obtain f(c)=0 due to round off errors. Here are some possibilities depending on a user-tuned thresholdM>0:

• Relative error:while|an+1an| >M

• Absolute error:while|anα| >M(requires the exact solutionα. . . )

• Residual:while|f(c)| >M

In any case, there must be a cautious criterion including a maximal number of iterations for the case where the method may not converge and thus to prevent infinite loops.

1.2 Newton’s method This method reads

an+1=anf(an) f0(an).

For the method to be well-posed, f0must not vanish in the neighbourhood ofα. As a consequence, the first terma0which is chosen by the user must be close enough to the very solution of the equation.

13/03/2013 1 M. Girardin – B. Meltz

(2)

EFREI – M1 IFM Numerical analysis applied to financial issues

1.3 Secant method

The Newton’s method can be modified in order to avoid evaluating the derivative function. It results in the secant method

an+1=anf(an) anan−1

f(an)−f(an−1).

The restriction is the same as the original method,i.e.thata0anda1must be different and close toα. 1.4 Directions

1. Implement the resolution off(x)=0 by means of the three methods.

2. Set the accuracy thresholdεas well as the maximal number of iterations. Take relevant values for a0,b0(and potentiallya1). Compare the number of iterations for each method to reach the required accuracy.

3. Compute for each method the incrementen= |an+1an|. The method is said to be of orderpif en+1C enp

for some constantC>0. Determine the order of each method.

2 Iterative methods for linear systems

LetA∈Mn(R) be an invertible matrix. We introduce the following notations

D=

a11 0 · · · 0 0 a22 . .. ... ... . .. ... 0 0 · · · 0 ann

, U=

0 −a12 · · · −a1n

... . .. . .. ... ... . .. −an−1,n

0 · · · 0

, L=

0 · · · 0

−a21 . .. ...

... . .. . .. ...

an,1 · · · −an,n1 0

 ,

such thatA=DLU. 2.1 Settings

To solve the linear systemAx=bfor a givenb∈Rn, we investigate two iterative strategies of the form xk+1=M−1(N xk+b)

with

• for theJacobi method:M=D,N=L+U;

• for theSOR method:M=ω1DL,N=1−ωω D+U. 2.2 Directions

We take

A=

2 −1 0 · · · 0

−1 . .. ... ... ... 0 . .. ... ... 0 ... . .. ... ... −1 0 · · · 0 −1 2

 .

13/03/2013 2 M. Girardin – B. Meltz

(3)

EFREI – M1 IFM Numerical analysis applied to financial issues

1. Choose a vector ¯x. Computeb=Ax.¯

2. Implement the two previous iterative methods with some relevant stopping criteria.

3. Is the SOR method convergent for any value ofω?

4. In the case of convergence, plot the errorsekJ = kxkJx¯kandekSOR= kxkSORx¯k.

13/03/2013 3 M. Girardin – B. Meltz

Références

Documents relatifs

Some simple precautions in daily life will reduce the risk of falls and therefore of injuries, just as driving carefully in a well-maintained car and wearing a seatbelt

Abstract — The modifiée équation is a powerful tooi for the error analysis of the numencal solution of partial differential équations We present here a method which

In the case of discrete linear systems with the main operator a contraction, the fact that the maximal function Θ 1 (λ) of the main operator is the null function, gives some

This paper offers the modified method of exact reachable set computation for discrete-time dynamical system, which is based on the general recurrent algebraic method described in

Woo, G., Namm, R.V., Sachkoff, S.A.: An iterative method based on a modified La- grangian functional for finding a saddle point in the semicoercive Signorini

Les nombres super ` 0 -champions sont définis en remplaçant dans la défi- nition des nombres super `-champions la fonction ` par ` 0 , notamment dans (1.7).. Au paragraphe 2,

To prove these two theorems, we construct a subset G of g(N) analogous to the set of superior highly composite numbers introduced by Ramanujan in his study of the

In this contribution we use methods of optimal control theory to compute the optimal step length of the Newton method on the class of self-concordant functions, as a function of