Vous êtes sur la page 1sur 8

Dpartement de mathmatiques et de gnie industriel

cole Polytechnique de Montral


CALCUL SCIENTIFIQUE POUR INGNIEURS
AIDE MMOIRE
Automne 2013
Dnitions, dveloppement de Taylor et erreur de troncature
Erreur absolue : x = x x

Erreur relative : e
r
(x) =
x
x
Chires signicatifs :
Le chire de x

associ la puissance de m et les chires associs aux puissances


suprieures tels que x 0,5 10
m
.
f(x
0
+h) = P
n
(h) +R
n
(h) :
_
_
_
P
n
(h) = f(x
0
) +f

(x
0
)h +
1
2!
f

(x
0
)h
2
+
1
3!
f

(x
0
)h
3
+ +
1
n!
f
(n)
(x
0
)h
n
R
n
(h) =
1
(n+1)!
f
(n+1)
((h))h
n+1
pour (h) entre x
0
et x
0
+h
f(x) = P
n
(x) +R
n
(x) :
_
_
_
P
n
(x) = f(x
0
) +f

(x
0
)(x x
0
) +
1
2!
f

(x
0
)(x x
0
)
2
+ +
1
n!
f
(n)
(x
0
)(x x
0
)
n
R
n
(x) =
1
(n+1)!
f
(n+1)
((x))(x x
0
)
n+1
pour (x) entre x
0
et x
f(h) = O(h
n
) :
Il existe une constante C > 0 t.q.

f(h)
h
n

C pour h prs de 0.
Dveloppement de Taylor pour les fonctions de plusieurs variables f(x, y) :
f(x
0
+h, y
0
+k) = f(x
0
, y
0
) +
f(x
0
, y
0
)
x
h +
f(x
0
, y
0
)
y
k+
+
1
2!
_

2
f(x
0
, y
0
)
x
2
h
2
+2

2
f(x
0
, y
0
)
xy
hk +

2
f(x
0
, y
0
)
y
2
k
2
_
+
Norme IEEE et erreur de reprsentation
Reprsentation IEEE en simple prcision :
(d
1
d
2
d
3
d
31
d
32
) = (1)
d
1
2
(d
2
d
3
d
9
)
2
2
127
(1,d
10
d
11
d
32
)
2
Reprsentation IEEE en double prcision :
(d
1
d
2
d
3
d
63
d
64
) = (1)
d
1
2
(d
2
d
3
d
12
)
2
2
1023
(1,d
13
d
14
d
64
)
2
Reprsentation par excs (selon la norme IEEE) :
Lexcs : d = 2
k1
1 o k est le nombre de bits utiliss pour lexposant.
Prcision machine :
=
t
, o t est le nombre de bits utiliss pour la mantisse si le premier bit de la
mantisse normalise nest pas mis en mmoire et est la base.
Interpolation polynomiale
Forme gnrale : trouver les a
j
t.q.
f(x) = f
h
(x) =
n
_
j=0
a
j

j
(x)
o f(x
i
) = f
h
(x
i
) pour i = 0, 1, , n et o les (n+1) points
_
x
i
, f(x
i
)
_
sont donns.
Technique de la matrice de Vandermonde :

j
(x) = x
j
et les a
j
sont t.q.
_
_
_
_
_
_
_
1 x
0
x
2
0
x
n
0
1 x
1
x
2
1
x
n
1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1 x
n
x
2
n
x
n
n
_
_
_
_
_
_
_
_
_
_
_
_
_
_
a
0
a
1
.
.
.
a
n
_
_
_
_
_
_
_
=
_
_
_
_
_
_
_
f(x
0
)
f(x
1
)
.
.
.
f(x
n
)
_
_
_
_
_
_
_
Interpolation de Lagrange :

j
(x) =
(x x
0
)(x x
1
) (x x
j1
)(x x
j+1
) (x x
n
)
(x
j
x
0
)(x
j
x
1
) (x
j
x
j1
)(x
j
x
j+1
) (x
j
x
n
)
et a
j
= f(x
j
)
Erreur dinterpolation :
e
h
(x) = f(x) f
h
(x) =
f
(n+1)
_
(x)
_
(n+1)!
(x x
0
)(x x
1
) (x x
n
) pour (x) ]x
0
, x
n
[
Borne de lerreur dinterpolation :
e
n
(x) max
(x) ]x
0
,x
n
[

f
(n+1)
_
(x)
_

h
n+1
4(n+1)
pour h = x
i
x
i1
o i = 1, 2, . . . , n
Interpolation par splines cubiques sur lintervalle [x
i1
, x
i
] :
f
h
i
(x) =
f

i1
6h
i
(x
i
x)
3
+
f

i
6h
i
(x x
i1
)
3
+
+
_
f(x
i1
)
h
i

i1
h
i
6
_
(x
i
x) +
_
f(x
i
)
h
i

i
h
i
6
_
(x x
i1
)
o
h
i
6
f

i1
+
1
3
(h
i
+h
i+1
)f

i
+
h
i+1
6
f

i+1
=
_
f(x
i+1
) f(x
i
)
h
i+1
_

_
f(x
i
) f(x
i1
)
h
i
_
pour i = 1, 2, . . . , n1 et o h
i
= x
i
x
i1
Page 2
Direntiation et intgration numriques
Direntiation numrique :
formule de dirence nie terme derreur
f

(x) =
f(x+h)f(x)
h

f

()
2
h
f

(x) =
f(x)f(xh)
h
f

()
2
h
f

(x) =
f(x+2h)+4f(x+h)3f(x)
2h
f

()
3
h
2
f

(x) =
f(x+h)f(xh)
2h

f

()
6
h
2
f

(x) =
3f(x)4f(xh)+f(x2h)
2h
f

()
3
h
2
f

(x) =
f(x+2h)2f(x+h)+f(x)
h
2
f

()h
f

(x) =
f(x+h)2f(x)+f(xh)
h
2

f

()
12
h
2
f

(x) =
f(x2h)2f(xh)+f(x)
h
2
f

()h
f

(x) =
f(x+2h)+16f(x+h)30f(x)+16f(xh)f(x2h)
12h
2
1
90
f
(6)
()h
4
Quadratures de Newton-Cotes :
mthode formule de quadrature
terme
derreur
nombre
de points
trapze
h
2
(f(x
0
) +f(x
1
))
f

()
12
h
3
2
trapze
h
2
(f(x
0
) +2[f(x
1
) +

(ba)
12
f

()h
2
n+1
composs +f(x
n1
)] +f(x
n
))
Simpson
1
3
h
3
(f(x
0
) +4f(x
1
) +f(x
2
))
f
(4)
()
90
h
5
3
Simpson
1
3
h
3
(f(x
0
) +4f(x
1
) +2f(x
2
) +

(ba)
180
f
(4)
()h
4
2n+1
compose +2f(x
2n2
) +4f(x
2n1
) +f(x
2n
))
Simpson
3
8
3h
8
(f(x
0
) +3f(x
1
) +3f(x
2
) +f(x
3
))
3f
(4)
()
80
h
5
4
Simpson
3
8
3h
8
(f(x
0
) +3f(x
1
) +3f(x
2
) +2f(x
3
) +3f(x
4
) +

(ba)
80
f
(4)
()h
4
3n+1
compose +2f(x
3n3
) +3f(x
3n2
) +3f(x
3n1
) +f(x
3n
))
Boole
2h
45
(7f(x
0
) +32f(x
1
) +12f(x
2
) +32f(x
3
) +7f(x
4
))
8f
(6)
()
945
h
7
5
Boole
2h
45
(7f(x
0
) +32f(x
1
) +12f(x
2
) +32f(x
3
)+
compose +14f(x
4
) + +32f(x
4n5
) +14f(x
4n4
)+
2(ba)
945
f
(6)
()h
6
4n+1
+32f(x
4n3
) +12f(x
4n2
) +32f(x
4n1
) +7f(x
4n
))
Page 3
Intgration de Gauss :
_
b
a
f(x) dx =
(b a)
2
_
1
1
f
_
(b a)t +(a +b)
2
_
dt =
(b a)
2
_
1
1
g(t) dt =
(b a)
2
n
_
i=1

i
g(t
i
)
nb de pts (n)
points de Gauss poids de Gauss
degr de prcision (2n1)
t
i

i
1 +0,000000000 2,000000000 1
2
0,577350269 1,000000000
3
+0,577350269 1,000000000
0,774596669 0,555555556
3 +0,000000000 0,888888889 5
+0,774596669 0,555555556
4
0,861136312 0,347854845
7
0,339981044 0,652145155
+0,339981044 0,652145155
+0,861136312 0,347854845
0,906179846 0,236926885
0,538469310 0,478628670
5 +0,000000000 0,568888889 9
+0,538469310 0,478628670
+0,906179846 0,236926885
Page 4
quations direntielles ordinaires
Pour le problme avec condition initiale y

(t) = f(t, y(t)) o y(t


0
) = y
0
:
- pour (t
0
, y
0
) et h donns et pour n = 0, 1, 2, . . . :
mthode algorithme
_
t
i
+h
t
i
f
_
s, y(s)
_
ds
stabilit numrique
_
y

= y, y(t
0
) = y
0
o < 0
_
Euler explicite y
n+1
=y
n
+hf(t
n
,y
n
)
Wednesday, August 5, 2009
y
n+1
=(1+h)
n+1
y
0
(O(h)) t
n+1
=t
n
+h
Euler implicite y
n+1
=y
n
+hf(t
n+1
,y
n+1
)
Wednesday, August 5, 2009
y
n+1
=
(
1
1h
)
n+1
y
0
(O(h)) t
n+1
=t
n
+h
Crank-Nicolson y
n+1
=y
n
+
h
2
(f(t
n
,y
n
)+f(t
n+1
,y
n+1
))
Wednesday, August 5, 2009
y
n+1
=
_
1+
h
2
1
h
2
_
n+1
y
0
(O(h
2
)) t
n+1
=t
n
+h
Euler modi ` y=y
n
+hf(t
n
,y
n
)
Wednesday, August 5, 2009
y
n+1
=
(
1+h+
1
2
(h)
2
)
n+1
y
0
Runge-Kutta O(h
2
) y
n+1
=y
n
+
h
2
(f(t
n
,y
n
)+f(t
n+1
, ` y))
t
n+1
=t
n
+h
Point milieu k
1
=hf(t
n
,y
n
)
Wednesday, August 5, 2009
y
n+1
=
(
1+h+
1
2
(h)
2
)
n+1
y
0
Runge-Kutta O(h
2
) y
n+1
=y
n
+hf(t
n
+
h
2
,y
n
+
k
1
2
)
t
n+1
=t
n
+h
Runge-Kutta O(h
2
) k
1
=f(t
n
,y
n
)
(forme gnrale) k
2
=f(t
n
+h,y
n
+hk
1
)
y
n+1
=y
n
+h(
1
k
1
+
2
k
2)
t
n+1
=t
n
+h
Runge-Kutta O(h
4
) k
1
=f(t
n
,y
n
)
y
n+1
=
(
1+h+
1
2
(h)
2
+
1
6
(h)
3
+
1
24
(h)
4
)
n+1
y
0
k
2
=f(t
n
+
h
2
,y
n
+
h
2
k
1
)
Wednesday, August 5, 2009
k
3
=f(t
n
+
h
2
,y
n
+
h
2
k
2
)
k
4
=f(t
n
+h,y
n
+hk
3
)
y
n+1
=y
n
+
h
6
(k
1
+2k
2
+2k
3
+k
4
)
t
n+1
=t
n
+h
Erreur de troncature pour la mthode dEuler :
- Erreur locale :
h
2
2
y

() pour ]t
n
, t
n+1
[
- Erreur globale : e
n+1
=
_
1 +h
f(t
n
,y
n
)
y
_
e
n
+
h
2
2
y

()
1
2
(t
n
t
0
) hy

()
Page 5
quations algbriques non linaires
Critre darrt pour la mthode de la bissection : e
r
=
xx

x
=
x
k
r
x
k


ba
2
k
x
k

<
Problme de racine : chercher r t.q. f(r) = 0
Problme de point xe : chercher r t.q. r = g(r)
Algorithme de point xe : pour x
0
donn, x
n+1
= g(x
n
) pour n = 0, 1, 2, . . .
Dveloppement pour lanalyse de la mthode des points xes :
e
n+1
:= x
n+1
r = g(r) +g

(r)e
n
+
1
2
g

(r)e
2
n
+
1
6
g

(r)e
3
n
+ g(r)
Mthode de Newton : pour x
0
donn, x
n+1
= x
n

f(x
n
)
f

(x
n
)
pour n = 0, 1, 2, . . .
Une racine r de f(x) est de multiplicit m si on peut crire f(x) = (x r)
m
h(x) pour
h(x) t.q. h(r) }= 0 ou encore si :
f(r) = f

(r) = f

(r) = = f
(m1)
(r) = 0 et f
(m)
(r) }= 0
Taux de convergence de la mthode de Newton dans le cas dune racine multiple : 1
1
m
Mthode de la scante : pour x
0
et x
1
donns,
x
n+1
= g(x
n
, x
n1
) = x
n

f(x
n
) (x
n
x
n1
)
(f(x
n
) f(x
n1
))
pour n = 1, 2, 3, . . .
Mthode de linterpolation quadratique inverse : pour x
0
et x
1
et x
2
donns,
x
n+1
= g(x
n
, x
n1
, x
n2
) =
x
n2
f(x
n1
) f(x
n
)
(f(x
n2
) f(x
n1
)) (f(x
n2
) f(x
n
))
+
x
n1
f(x
n2
) f(x
n
)
(f(x
n1
) f(x
n2
)) (f(x
n1
) f(x
n
))
+
x
n
f(x
n2
) f(x
n1
)
(f(x
n
) f(x
n2
)) (f(x
n
) f(x
n1
))
pour n = 2, 3, . . .
Analyse de convergence pour les mthodes k points, x
n+1
= g(x
n
, x
n1
, . . . , x
nk+1
) :
e
n+1
= K(r)e
n
e
n1
e
nk+1
o f(r) = 0
et
e
n+1
= Ce
p
n
o
_

_
p
2
p 1 = 0 pour k = 2 (p = 1,61)
p
3
p
2
p 1 = 0 pour k = 3 (p = 1,84)
p
k
p
k1
p 1 = 0 dans le cas gnral
Page 6
Systmes dquations algbriques
La factorisation matricielle de Doolittle (sans permutations) :
A = LU =
_
_
_
_
_
_
_
_
_
_
_
1 0 0 0

21
1 0
.
.
.
.
.
.

31
l
32
1
.
.
. 0
.
.
.
.
.
.
.
.
.
.
.
. 0

n1

n2

nn1
1
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
u
11
u
12
u
13
u
1n
0 u
22
u
23
u
2n
0 0 u
33
u
3n
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
0 0 0 u
nn
_
_
_
_
_
_
_
_
_
_
_
_
La rsolution des systmes linaires (avec permutations) :
A x =

b LU x = P

b
_
_
_
1

) L y = P

b;
2

) U x = y.
Note : On peut utiliser le vecteur de permutation

O plutt que la matrice de permutation P.
La mthode de Thomas pour la factorisation des matrices tridiagonales :
A =
_
_
_
_
_
_
_
_
_
_
_
a
1
c
1
0 0
b
1
a
2
c
2
.
.
.
.
.
.
0 b
2
a
3
.
.
. 0
.
.
.
.
.
.
.
.
.
.
.
. c
n1
0 0 b
n1
a
n
_
_
_
_
_
_
_
_
_
_
_
=
_
_
_
_
_
_
_
_
_
_
_
1 0 0 0

1
1 0
.
.
.
.
.
.
0
2
1
.
.
. 0
.
.
.
.
.
.
.
.
.
.
.
. 0
0 0
n1
1
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_

1
c
1
0 0
0
2
c
2
.
.
.
.
.
.
0 0
3
.
.
. 0
.
.
.
.
.
.
.
.
.
.
.
. c
n1
0 0 0
n
_
_
_
_
_
_
_
_
_
_
_
Normes vectorielles :
| x|
2
=
_
x
2
1
+x
2
2
+ +x
2
n
| x|
1
=
n
_
i=1
x
i
| x|

= max
i=1,2,...,n
x
i

Normes matricielles :
|A|
1
= max
j=1,2,...,n
n
_
i=1
a
ij
|A|

= max
i=1,2,...,n
n
_
j=1
a
ij
|A|
F
=

_
n
_
i,j=1
a
2
ij
Conditionnement matriciel : condA = |A||A
1
|
Bornes de lerreur : pour r =

b A x

,
1
condA
| r|
|

b|

| x x

|
| x|
condA
| r|
|

b|
et
| x x

|
| x

|
condA
|E|
|A|
Problme de points xes pour les systmes dquations algbriques :
x =

G( x)
_

_
x
1
= g
1
(x
1
, x
2
, . . . , x
n
)
x
2
= g
2
(x
1
, x
2
, . . . , x
n
)
.
.
.
x
n
= g
n
(x
1
, x
2
, . . . , x
n
)
Page 7
La matrice jacobienne associe

G( x) :
J( x) =
_
_
_
_
_
g
1
x
1
( x)
g
1
x
n
( x)
.
.
.
.
.
.
g
n
x
1
( x)
g
n
x
n
( x)
_
_
_
_
_
Critre pour la convergence de lalgorithme des points xes : soit r tel que r =

G( r), alors

_
J( r)
_
< 1 o
_
J( r)
_
= max
i=1,2,...,n

Proprit du rayon spectral : (A) |A|


Matrice diagonale strictement dominante : a
ii
>
n
_
j=1
j}=i
a
ij
pour i = 1, 2, . . . , n
La mthode de Jacobi : soit A x = (D +T
I
+T
S
) x =

b et pour x
0
donn,
x
k+1
=

G( x
k
) = T
J
x
k
+ c
J
= D
1
(T
I
+T
S
) x
k
+D
1

x
k+1
i
=
1
a
ii
_
b
i

n
_
j=1
j}=i
a
ij
x
k
j
_
pour
_
_
_
i = 1, 2, . . . , n;
k = 0, 1, 2, . . .
La mthode de Gauss-Seidel : soit A x = (D +T
I
+T
S
) x =

b et pour x
0
donn,
x
k+1
=

G( x
k
) = T
GS
x
k
+ c
GS
= (T
I
+D)
1
T
S
x
k
+(T
I
+D)
1

x
k+1
i
=
1
a
ii
_
b
i

i1
_
j=1
a
ij
x
k+1
j

n
_
j=i+1
a
ij
x
k
j
_
pour
_
_
_
i = 1, 2, . . . , n;
k = 0, 1, 2, . . .
La mthode de Newton pour rsoudre

F( x) =

0 : pour x
0
donn, rsoudre
J( x
k
)

x =

R( x
k
)
_
_
_
_
_
_
_
f
1
x
1
( x
k
)
f
1
x
2
( x
k
)
f
1
x
n
( x
k
)
f
2
x
1
( x
k
)
f
2
x
2
( x
k
)
f
2
x
n
( x
k
)
.
.
.
.
.
.
.
.
.
.
.
.
f
n
x
1
( x
k
)
f
n
x
2
( x
k
)
f
n
x
n
( x
k
)
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
x
1
x
2
.
.
.
x
n
_
_
_
_
_
_
_
_
=
_
_
_
_
_
_
_
_
f
1
( x
k
)
f
2
( x
k
)
.
.
.
f
n
( x
k
)
_
_
_
_
_
_
_
_
puis x
k+1
= x
k
+

x pour k = 0, 1, 2, . . .
Steven Dufour

Vous aimerez peut-être aussi