$$\def \N {\mathbb N} \def \R {\mathbb R}$$
$$\left\{ \begin{array}{l} \dot f = - \alpha g f \\ \dot g = \alpha g f - \beta g \\ \dot h = \beta g \end{array}\right.$$
$$2\pi=6.28318530718\cdots$$
$$\sqrt 2=1.41421356237\cdots$$
$$\sum_{n=0}^\infty \frac 1 {n}=+\infty$$
$$1+\frac 1 2 + \frac 1 4 + \frac 1 8 + \cdots = 2$$
$$e^{i\pi}=-1$$
$$\ln(1-x)=-x-\frac{x^2} 2-\frac{x^3}3 - \cdots$$
$$\sin(x)=x-\frac{x^3} 6+\frac{x^5}{120} + \cdots$$
$$\lim_{n\rightarrow \infty}(1+x/n)^n=e^x$$
$$\frac{\pi^2} 6=\sum_n \frac 1 {n^2}$$
$$\lim_{x\rightarrow 0} \frac{f(x)}{g(x)}=\frac{f'(x)}{g'(x)}$$
$$x_{n+1}=x_n-h \nabla J(x_n)$$
$$e^{x+y}=e^xe^y$$
$$f'(x)=\lim_{h\rightarrow 0}\frac{f(x+h)-f(x)} h$$
Analyse et méthodes numériques
Approximation des EDO
IUT Nice Sophia-Antipolis

## Trois types d'EDO

### Dynamique des populations

$$\dot x = a x$$

### Épidémie

$$\left\{ \begin{array}{l} \dot f(t) = - \alpha g(t) f(t) \\ \dot g(t) = \alpha g(t) f(t) - \beta g(t) \\ \dot h(t) = \beta g\\ \end{array}\right.$$

### Circuit RLC

$$\ddot I+\frac R L \dot I +\frac 1 {LC} I=0$$

## One EDO to rule them all

$$\dot X = F(t,X)$$
$$\ddot I+\frac R L \dot I +\frac 1 {LC} I=0$$ $$\dot I=J$$ $$\dot J = -\frac R L \dot I -\frac 1 {LC} I$$
$$\frac d {dt} \left( \begin{array}{c} I \\ J \end{array} \right) = \left( \begin{array}{c} J\\ -\frac R L J -\frac 1 {LC} I \end{array} \right)$$
$$t_n=n \Delta t$$ $$x_n\simeq x(t_n)$$

## Shéma d'Euler

$$\begin{eqnarray*} \frac{dx}{dt}(t_n)&=&f(t_n,x(t_n))\\ \class{eq1}{\frac{x(t_n+\Delta t)-x(t_n)}{\Delta t}}&\class{eq1}{\simeq}&\class{eq1}{f(t_n,x(t_n))}\\ \class{eq2}{\frac{x(t_{n+1})-x(t_n)}{\Delta t}}&\class{eq2}{\simeq}&\class{eq2}{f(t_n,x(t_n))}\\ \class{eq3}{\frac{x_{n+1}-x_n}{\Delta t}}&\class{eq3}{=}&\class{eq3}{f(t_n,x_n)}\\ \class{eq4}{x_{n+1}}&\class{eq4}{=}&\class{eq4}{x_n+\Delta t f(t_n,x_n)} \end{eqnarray*}$$

## Schéma d'Euler implicite

$$\begin{eqnarray*} \frac{dx}{dt}(t_{n+1})&=&f(t_{n+1},x(t_{n+1}))\\ \class{eq1}{\frac{x(t_{n+1})-x(t_{n+1}-\Delta t)}{\Delta t}}&\class{eq1}{\simeq}&\class{eq1}{f(t_{n+1},x(t_{n+1}))}\\ \class{eq2}{\frac{x(t_{n+1})-x(t_{n})}{\Delta t}}&\class{eq2}{\simeq}&\class{eq2}{f(t_{n+1},x(t_{n+1}))}\\ \class{eq3}{\frac{x_{n+1}-x_n}{\Delta t}}&\class{eq3}{=}&\class{eq3}{f(t_{n+1},x_{n+1})}\\ \class{eq4}{x_{n+1}}&\class{eq4}{=}&\class{eq4}{x_n+\Delta t f(t_{n+1},x_{n+1})} \end{eqnarray*}$$

## Schéma de Runge Kutta RK2

$$\begin{eqnarray*} \frac{dx}{dt}(t_{n+1/2})&=&f(t_{n+1/2},x(t_{n+1/2}))\\ \class{eq1}{\frac{x(t_{n+1/2}+\Delta t/2)-x(t_{n+1/2}-\Delta t/2)}{\Delta t}}&\class{eq1}{\simeq} &\class{eq1}{f(t_{n+1/2},x(t_{n+1/2}))}\\ \class{eq2}{\frac{x(t_{n+1})-x(t_{n})}{\Delta t}}&\class{eq2}{\simeq} &\class{eq2}{f(t_{n+1/2},x(t_{n+1/2}))}\\ \class{eq3}{\frac{x_{n+1}-x_n}{\Delta t}}&\class{eq3}{=}&\class{eq3}{f(t_{n+1/2},x_{n+1/2})}\\ \class{eq4}{x_{n+1}}&\class{eq4}{=}&\class{eq4}{x_n+\Delta t f(t_{n+1/2},x_{n+1/2})}\\ \class{eq5}{x_{n+1}}&\class{eq5}{=}&\class{eq5}{x_n+\Delta t f(t_{n}+\Delta t/2,x_{n+1/2})} \end{eqnarray*}$$

## Schéma de Crank-Nicholoson

$$\begin{eqnarray*} \frac{dx}{dt}(t_{n+1/2})&=&f(t_{n+1/2},x(t_{n+1/2}))\\ \class{eq1}{\frac{x(t_{n+1/2}+\Delta t/2)-x(t_{n+1/2}-\Delta t/2)}{\Delta t}}&\class{eq1}{\simeq} &\class{eq1}{f(t_{n+1/2},x(t_{n+1/2}))}\\ \class{eq2}{\frac{x(t_{n+1})-x(t_{n})}{\Delta t}}&\class{eq2}{\simeq} &\class{eq2}{f(t_{n+1/2},x(t_{n+1/2}))}\\ \class{eq3}{\frac{x_{n+1}-x_n}{\Delta t}}&\class{eq3}{=}&\class{eq3}{f(t_{n+1/2},x_{n+1/2})}\\ \class{eq4}{x_{n+1}}&\class{eq4}{=}&\class{eq4}{x_n+\Delta t f(t_{n+1/2},x_{n+1/2})} \end{eqnarray*}$$ $$x_{n+1}=x_n+\frac{\Delta t}2 \left(f(t_{n},x_{n})+f(t_{n+1},x_{n+1})\right)$$

# Application Système Terre-Soleil

## Terre-Soleil

$$\left\{ \begin{array}{rcl} \dot v &=& -\frac{MG}{R^3}x \\ \dot x&=&v\\ v(0)&=&v_0\\ x(0)&=&x_0 \end{array} \right.$$

# Convergence

## Définition

Le schéma est dit converent si $$\lim_{\Delta t\rightarrow 0} \sup_{n} \|x_n-x(t_n)\|=0$$
Schéma Générique $$x_{n+1}=x_n+\Delta t F(t_n,x_n,\Delta t)$$

# Stabilité

$$x_{n+1}=x_n+\Delta t F(t_n,x_n,\Delta t)$$ $$y_{n+1}=y_n+\Delta t F(t_n,y_n,\Delta t)+\eta_{n+1}$$

## Stabilité

$$\max_{0\leq n \leq N} \|x_n-y_n\|\leq C \sum_{n=0}^N \|\eta_n\|$$

## Condition de stabilité

Si $F$ est continûment dérivable,
alors le schéma est stable.

# Consistance

## Erreur de consistance

$$\varepsilon_n=x(t_{n+1})-x(t_n)-\Delta t F(t_n,x(t_n),\Delta t)$$
Le schéma est consistant si $$\lim_{\Delta t\rightarrow 0} \varepsilon_n/\Delta t=0$$

## Convergence

Un schéma consistant et stable est convergent.

# Ordre d'un schéma

Schéma d'ordre $p$ si
$$\|\varepsilon_n\|\leq C \Delta t^{p+1}$$

## Vitesse de convergence

Si le schéma est stable et d'ordre $p$, alors $$\max_n \|x(t_n)-x_n\|\leq C(\Delta t)^p$$

## Euler vs RK2

Schéma d'Euler = ordre 1

Schéma Runge Kutta d'ordre 2 = ordre 2