• Aucun résultat trouvé

ASI 3 Méthodes numériques pour l’ingénieur

N/A
N/A
Protected

Academic year: 2021

Partager "ASI 3 Méthodes numériques pour l’ingénieur"

Copied!
18
0
0

Texte intégral

(1)

ASI 3

Méthodes numériques pour l’ingénieur

Introduction :

vecteurs, matrices

et applications linéaires

(2)

Circuit électrique et loi de Kirchhoff

• •

• •

A B C

D

E G F

V volts

3 4

2 3

5 2

1

2

i1 i3

i1 i3

i2 i4 i5

i5

5 i1+5 i2 = V i3- i4- i5 = 0 2 i4-3 i5 = 0 i1- i2- i3 = 0

5 i2 - 7i3- 2 i4= 0 V Algo i1, i2,i3, i4, i5

Exemple : V = 10

(5 inconnues => 5 équations)

(3)

Circuit électrique et loi de Kirchhoff

• •

• •

A B C

D

E G F

V volts

3 4

2 3

5 2

1

2

i1 i3

i1 i3

i2 i4 i5

i5

5 i1+5 i2 = V i3- i4- i5 = 0 2 i4-3 i5 = 0 i1- i2- i3 = 0

5 i2 - 7i3- 2 i4= 0 V Algo i1, i2,i3, i4, i5

Exemple : V = 10

(5 inconnues => 5 équations)

(4)

Solution...

5 i1+5 i2 = V i3- i4- i5 = 0 2 i4- 3 i5 = 0 i1 - i2 - i3 = 0 5 i2 - 7i3 - 2 i4 = 0

5 i1+5 i2 + 0 i3+ 0 i4+0 i5 = V 0 i1+0 i2 + i3- i4- i5 = 0 0 i1+0 i2 + 0 i3+ 2 i4- 3 i5 = 0 i1 - i2 - i3 + 0 i4+0 i5 = 0 0 i1+5 i2 - 7 i3 - 2 i4 +0 i5 = 0

5 5 0 0 0 V 0 0 1 -1 -1 0 0 0 0 2 -3 = 0 1 -1 -1 0 0 0 0 5 -7 -2 0 0

i1 i2 i3 i4 i5

A x = b x = A

-1

b

b x

A   

A est une matrice,

x et b sont des vecteurs

(5)

Equation de la chaleur

 





0 )

1 (

0 )

0 (

1 , 0

), ( )

2 (

2

u u

x x

f dx x

u

d x : position sur une barre de taille 1 u(x) : température à la position x

f(x) : flux de chaleur à la position x

Discrétisation

 





0 )

(

0 )

(

1 ,

1

), (

) (

0 2 2

N

k k

x u

x u

N k

x f dx x

u d

0 h (N-1)h 1 x0 x1 … xk xk+1 … xN-1 xN

h





 

0 )

(

0 )

(

) ) (

( )

( 2 ) (

0

2 1

1

N k k k

k

x u

x u

x h f

x u x

u x

u

(6)

Solution

0

0

) (

posons

0 )

(

0 )

(

) ) (

( )

( 2 ) (

0 0

2 1

1





 

N

k k

N k k k

k

v v

x u v

x u

x u

x h f

x u x

u x

u





































) (

) (

) (

) (

2 1

1 2

1 1 2

1

0 1

2 1

1 2 2 1

1 2 2 1

2

N N N

N

x f

x f

x f

x f

v v

v v

h     

Solution approchée : système linéaire de taille N-1 (matrice tridiagonale)

A x = b

(7)

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 -4

-3 -2 -1 0 1 2

Approximation/interpollation:

moindres carrés

 

 

carrés moindres

des

équationset inconnues( ) approximation au sens )

( min

)

(

ion approximat

tion interpolla

)

(

, : données

1

2 1

1 1

1 , 1

k

n

i i i

i k

j

ij j i

i

k j

j j

n i i

i

n n

y x

f y

x y

x f

n k

n x k

x f

y x

 

f(x)

xi yi

(8)

Approximation au sens des moindres carrés

 

 

 

 

 

 

 

 

 

 

 

 

 



 

 

n i

ij i

k n

i

ij i

n i

ij i k

i j

j

n

i i

k j

ij j n

i i i

x y x

x x

y J x

k J j

J

y x

J J

y x

f

1

1

1 1

1 1

1

1 1

1

1

2

1

1 1

2

0 2

,..., 1

; 0

*) (

) ( argmin

* : principe

) ( avec

) ( min )

( min

 

 

Système linéaire de k équations et k inconnues

(9)

Posons le problème matriciellement

 

 

 

 









k n n j k

n j n

k i i j k

i j i

k k j j

k k j j

x f x

x x

x f x

x x

x f x

x x

x f x

x x

) 1 ( )

1 ( )

1 2 ( 1

) 1 ( )

1 ( )

1 2 ( 1

) 2 1 2( )

1 2( )

1 2( 2 1

) 1 1 1( )

1 1( )

1 1( 2 1

...

...

...

...

...

...

...

...

i i

i n

k j

j x j x y

x

f 1,

1

1 pour , )

(

 

(10)

Posons le problème matriciellement

 

 

 

 









k n n j k

n j n

k i i j k

i j i

k k j j

k k j j

x f x

x x

x f x

x x

x f x

x x

x f x

x x

) 1 ( )

1 ( )

1 2 ( 1

) 1 ( )

1 ( )

1 2 ( 1

) 2 1 2( )

1 2( )

1 2( 2 1

) 1 1 1( )

1 1( )

1 1( 2 1

...

...

...

...

...

...

...

...

   

 

 









k n j n

n n

k i j i

i i

k j

k j

x f x

x x

x f x

x x

x f x

x x

x f x

x x

...

...

1

...

...

1

...

...

1

...

...

1

) 1 ( )

1 ( )

1 (

) 1 ( )

1 ( )

1 (

) 2 1 2( )

1 2( )

1 2(

) 1 1 1( )

1 1( )

1 1(

 =

i i

i n

k j

j j

y x

x x

f

, 1 1

1

, pour

)

(

  Xa = f

(11)

Posons le problème matriciellement

i i

i n

k j

j x j x y

x

f 1,

1

1 pour , )

(

 

=

(12)

Approximation : version matricielle

 

X y

J

X X

X y

X J

y X

e J

y y y

x x

x x

x x

e e e

y X

e

y x

y x

f e

y x

J J

y x

f

n i

k j ik

i

ik i

k

n i

i k

j

ij j i

i i

n

i i

k j

ij j n

i i i

' '

0 )

( ' '

2 )

( '

) (

1 1 1

) (

) ( avec

) ( min )

( min

2 2

1 1

1 1 1 1 1 1

0

1

2

0 1

2















































 

 

 

 

Système linéaire de k équations et k inconnues Erreur

d’approximation

(13)

Approximation : version matricielle

 

X y

J

X X

X y

X J

y X

e J

y y y

x x

x x

x x

e e e

y X

e

y x

y x

f e

y x

J J

y x

f

n i

k j ik

i

ik i

k

n i

i k

j

ij j i

i i

n

i i

k j

ij j n

i i i

' '

0 )

( ' '

) ( '

) (

1 1 1

) (

) ( avec

) ( min )

( min

2 2

1 1

1 1 1 1 1 1

0

1

2

0 1

2















































 

 

 

 

Système linéaire de k équations et k inconnues Erreur

d’approximation Matrice de Vandermonde

(1735-1796)

(14)

Un problème de base









m n n j m

n j n

m i i j m

i j i

m m j j

m m j j

y x

a x

a x

a a

y x

a x

a x

a a

y x

a x

a x

a a

y x

a x

a x

a a

) ( )

( )

1 1 ( 0

) ( )

( )

1 1 ( 0

) 2 2( )

2( )

1 2( 1 0

) 1 1( )

1( )

1 1( 1 0

...

...

...

...

...

...

...

...

n équations et m+1 inconnues

Xa=y

Une nouvelle expérience

(individu)

Une nouvelle variable explicative

(15)

Que se passe t’il si… ?

• On dispose d’un nouvel individu

• on dispose d’une nouvelle variable

m=n

m<n

m>m

• on recopie deux individus

• on duplique une variable

X y

a

=

(16)

x1

x 2

solution unique

x1

x 2

pas de solution

Illustration : système de 2 équations à 2 inconnues



2 2

22 1

21

1 2

12 1

11

b x

a x

a

b x

a x

a – une solution unique

– pas de solution

– une infinité de solution

– solution « triviale » : x1= x2 = 0

Les différents cas

(17)

Matrices













nk nj

n

ik ij

i

k j

a a

a

a a

a

a a

a A

1 1

1 1

11

Tableau de n lignes et k colonnes

Remarque fondamentale :

on ne peu rien démontrer sans faire référence à l’application linéaire que la matrice représente

Ay Ax

y x

A

Ax y

x R

R

A k n

   

 

) (

: linéaire

:

(18)

Applications linéaires

 

 

1, une base de

soit

de base une

, 1 soit

W n

i V f

V k

i V e

i i

) ( )

( )

( : linéaire

) (

:

y u x

u y

x u

x u y

xV W u

   

 

Noyau : u(x) = 0

image : s.e.v engendré par u(ei) rang = dim(Im(u))

propriétés injective (ker(u) = 0) surjective Im(u) = V

Par identification, on donne une signification aux colonnes de la matrice

Références

Documents relatifs

la méthode des moindres carrés Le point de vue numérique.

• voir les méthodes semi directes pour les problèmes de grande taille (cf les méthodes «

alors T et A sont équivalentes (elles ont les même valeurs propres) et T est une matrice triangulaire. Comment construire

Résolution de systèmes d’équation non linéaires. f ( x )=0.. Gauss-Siedel pour les

f(x)=0.. Gauss-Siedel pour les systèmes linéaires). –

– on prend des polynômes de degré faible (3) pour éviter les

le minimum est sur la frontière minimisation sous

Cette opération peut avantageusement être mise à prot pour améliorer la rapidité et la précision du calcul du produit scalaire de deux vecteurs de taille n (on ne commet alors que