Cheat Sheet — Analyse Numérique (commenté)
SEL, Interpolation, Intégration, Équations non linéaires, Dérivation, EDO
1. Systèmes linéaires (SEL) Exemple 3 × 3 —Jacobi
10 2 1 7
A = 1 5 1 , b = −8 , x0 = 0. Formules : xk+1 1 =
Résumé 2 3 10 6
1
(7−2xk2 −xk3 ), xk+1 = 15 (−8−xk1 −xk3 ), xk+1 1
= 10 (6−2xk1 −3xk2 ).
P P
Normes matrices : ∥A∥1 = maxj i |aij |, ∥A∥∞ = maxi j |aij |, 10 2 3
Itérations : x = (0.7, −1.6, 0.6), x2 = (0.92, −1.84, 0.844), x3 ≈
1
p
∥A∥2 = λmax (A⊤ A). Conditionnement : cond(A) = ∥A∥∥A−1 ∥
(grand ⇒ solution sensible). Décomposition : P A = LU . Résolution (1.00, −1.96, 0.98).
par Ly = P b puis U x = y. Itératives : Jacobi, Gauss–Seidel. Conver-
gence si SDD ou ρ(B) < 1.
2. Interpolation et approximation
Algorithmes Résumé
Pn x − xj
Gauss pivot partiel : Pour k = 1..n − 1 : choisir p = arg maxi≥k |aik |
Q
Lagrange : Pn (x) = i=0 yi j̸=i . Newton : Pn (x) =
(échange k ↔ p), puis pour i = k + 1..n : mik = aik /akk , ligne i ← xi − x j
ligne i −mik ligne k. Fin : substitution arrière. a0 + a1 (x − x0 ) + · · · avec différences divisées. Erreur : f (x) −
1 f (n+1) (ξ) Qn
Jacobi xk+1 bi − j̸=i aij xkj .
i=0 (x − xi ). Moindres carrés linéaires :
P
i = Pn (x) =
aii P (n + 1)!
Gauss–Seidel idem mais on réutilise les valeurs mises à jour. Arrêt :
P
Pn P x2i β0 = P yi .
∥b − Axk ∥∞ < ε ou ∥xk+1 − xk ∥∞ < ε. xi xi β 1 xi yi
Exemple + graphe
(x − 1)(x − 2)
Erreurs & conseils Points (0, 1), (1, 2), (2, 0). P2 (x) = − 2 x(x − 2).
∥δx∥ ∥δb∥ 2
Perturbations : ≲ cond(A) . Toujours tester le résidu
∥x∥ ∥b∥
r = b − Ax. Pivot partiel par défaut.
Exemple
3 × 3 — Gauss
2 1 −1 8 Application capteur (régression)
A = −3 −1
2 , b = −11. Solution exacte x = (2, 3, −1)⊤ .
Données : (0, 2.1), (1, 2.6), (2, 3.0), (3, 3.6), (4, 4.2). β0 ≈ 2.04, β1 ≈
−2 1 2 −3 0.53. RMS ≈ 0.08.
3. Intégration numérique 4. Dérivation numérique
Formules & erreurs
f (x + h) − f (x)
Formules f ′ (x) ≈ (progressif, O(h)). f ′ (x) ≈
b−a (b−a)3 ′′ h
Trapèzes : I ≈ 2
[f (a) + f (b)], ET ≈ − 12
f (ξ). Simpson : f (x + h) − f (x − h)
b−a (b−a)5 (4) (centré, O(h2 )). f ′′ (x) ≈
I ≈ 6
+ 4f (m) + f (b)], ES ≈
[f (a) − 2880 f (ξ). Composites 2h
n−1 f (x + h) − 2f (x) + f (x − h)
X X (centré, O(h2 )). Choix h en double
(h = b−a
n
) : Tc = h2
f0 + 2 fi + fn , Sc = h
3
f0 + 4 fi + h2 √
i=1 imp précision : h ∼ ε pour la dérivée centrée.
′
X
2 fi + f n .
Exemple
pair
f (x) = sin x, x = π/4, h = 10−2 . Centrée ⇒ fb′ ≈ 0.70711 vs
cos(π/4) = 0.70711.
5. Équations non linéaires
Exemple détaillé + graphe
R 1 −x2
I = 0 e dx. Simpson composite n = 4, h = 0.25.
f = [1, 0.9394, 0.7788, 0.5698, 0.3679]. Sc ≈ 0.7468. Valeur réelle Algorithmes
0.746824 . . .. Erreur ≈ 2.4 × 10−4 . Bisection : [a, b] avec f (a)f (b) < 0, erreur ≤ b−a
2k
. Newton : xk+1 =
f (xk ) xk − xk−1
xk − ′ (ordre 2). Sécante : xk+1 = xk − f (xk )
f (xk ) f (xk ) − f (xk−1 )
(ordre ≈ 1.618). Point fixe x = g(x) : convergence si |g ′ (x∗ )| < 1.
Exemple + graphe
f (x) = cos x − x. Newton avec x0 = 0.5 : x1 = 0.7552, x2 = 0.7391,
x3 = 0.7391.
Techniques avancées
Romberg : extrapolation de Richardson sur T (h). Gauss–Legendre n
points : exact pour polynômes degré ≤ 2n − 1.
6. Équations différentielles ordinaires 8. Tableaux récapitulatifs
(EDO) Ordres globaux
Tâche Méthode Ordre
Résumé
Problème y ′ = f (t, y), y(t0 ) = y0 , pas h. Euler : yn+1 = yn + Intégration Trapèzes comp. O(h2 )
hf (tn , yn ) (ordre 1). Heun : k1 = f (tn , yn ), k2 = f (tn + h, yn + hk1 ), Intégration Simpson comp. O(h4 )
yn+1 = yn + h (k1 +k2 ) (ordre 2). RK4 : ordre 4 avec k1 ..k4 standard. Dérivation Diff. centrée O(h2 )
2 EDO Euler O(h)
Stabilité pour y ′ = λy : Euler stable si |1 + hλ| < 1.
EDO Heun O(h2 )
EDO RK4 O(h4 )
Exemple rigoureux + graphe Non-linéaire Bisection Linéaire
y ′ = −2y, y(0) = 1, h = 0.2. Exact y(t) = e−2t . Euler : yn+1 = 0.6yn Non-linéaire Newton Quadratique
⇒ 1, 0.6, 0.36, 0.216, 0.1296, 0.07776.
Convergence P itératives linéaires
SDD : |aii | > k+1 =
j̸=i |aij | ⇒ Jacobi/GS convergent. Affine x
Bxk + c : convergence si ρ(B) < 1.
Bonnes pratiques examen
Pivot partiel systématique ; ne pas inverser A. Toujours contrôler
r = b − Ax. Tracer f avant Newton, sinon bisection. Dérivation :
7. Applications numériques réelles choisir schéma centré, tester 2 valeurs de h, extrapoler.
7.1 Réseau électrique DC (SEL) Exemple
GS compact
3× 3
4 1 1 6
10 −2 0 5
Lois de Kirchhoff ⇒ Ax = b. A = −2 8 −1 , b = 0. LU A = 1 3 −1, b = 1, x0 = 0. GS : x1 = (1.25, −0.083, 0.35),
0 −1 5 3 2 1 5 4
⇒ x ≈ (0.543, 0.216, 0.643)⊤ . x2 = (1.183, −0.178, 0.327). Arrêt pour ε = 10−3 après ≈ 6 pas.
7.2 Calibrage capteur (régression)
Droite ŷ = 2.04 + 0.53x. Utiliser pour corriger les lectures brutes.
7.3 Refroidissement (EDO)
Modèle de Newton : y ′ = −k(y − T∞ ). Ex. : k = 0.7 h−1 , T∞ =
20◦ C, y(0) = 80◦ C. RK4 avec h = 0.25 h ⇒ décroissance monotone
vers 20◦ C.
9. Pseudo-code concis (B) Sécante
f (x) = x3 − 2x − 5, x0 = 2, x1 = 3 ⇒ x∗ ≈ 2.094.
Gauss pivot partiel
for k=1:n-1
(C) RK4 un pas
p = argmax_i=k..n|A[i,k]|; swap rows(k,p)
y ′ = y(1 − t), y(0) = 1, h = 0.1 ⇒ y1 ≈ 1.099.
for i=k+1:n
m=A[i,k]/A[k,k]
A[i,k:n]-=m*A[k,k:n]; b[i]-=m*b[k]
end
end; back-substitute
11. Formules-clés
Jacobi n−1 ′
repeat Tc = h
f0 + 2
X
fi + f n Sc = h
f0 + 4
X X
f i + 2 fi + f n
2 3
P
for i=1..n: x_new[i]=(b[i]- _j ̸= iA[i, j]x[j])/A[i, i]
i=1 imp pair
f (x + h) − f (x − h) f (xk )
Newton f ′ (x) ≈ xk+1 = xk −
2h f ′ (xk )
repeat: x1=x0 - f(x0)/f’(x0); if |x1-x0|<eps stop; x0=x1
xk+1 = D−1 (L + U )xk + b xk+1 = (D − L)−1 (U xk + b)
10. Exercices modèles (solutions
12. Check-list examen
courtes)
— Pivot partiel activé ; jamais d’inversion directe de A.
— Résidu ∥b − Ax∥∞ contrôlé.
(A) Simpson composite
R2 — Pour racines : intervalle à signes opposés ou bonne amorce ; tracer f .
0 ln(1 + x) dx, n = 4, h = 0.5 ⇒ Sc ≈ 1.3863. Exact (1 + x) ln(1 +
x) − x
2
≈ 1.3863. — Dérivation : schéma centré, test de 2 pas h.
0
— Intégration : Simpson si f ∈ C 4 , sinon trapèzes.