INFO-F-305 - TP 8¶

Equations aux différences I¶

Jacopo De Stefani - jdestefa@ulb.ac.be¶

Github: https://github.com/jdestefani/ulb-infof305¶

Slides: https://jdestefani.github.io/ulb-infof305¶

Rappels Théoriques - Equation aux différences¶

En forme normale - Ordre n¶

$x(k + n) = f(k, x(k + n − 1), \cdots , x(k))$

où:

  • $x^k = x(k) \in X$ l’état scalaire d’un système dynamique à l’instant $k \in \mathbb{N}$
  • $f : \mathbb{N} \times X^n \mapsto X$ une fonction connue.

Théorème 7.1¶

L’équation admet une et une solution une fois fixées $n$ valeurs initiales.

N.B Notons qu’aucune autre restriction sur la forme de $f$ est posée.

Rappels Théoriques - Equation aux différences¶

Lineaire - Ordre n¶

$a_n(k) x(k + n) + a_{n-1}(k) x(k + n - 1) + \cdots + a_0(k) x(k) = g(k)$

  • Invariante: $\forall i$ $a_i(k) = a_i$
  • Homogène: $\forall k$ $g(k) = 0$

Théorème 7.2 - Existence solution¶

Si

  • $a_n(k) x(k + n) + a_{n-1}(k) x(k + n - 1) + \cdots + a_0(k) x(k) = g(k)$ $\mapsto$ $x^{(p)}(k)$
  • $a_n(k) x(k + n) + a_{n-1}(k) x(k + n - 1) + \cdots + a_0(k) x(k) = 0$ $\mapsto$ $x^{(h)}(k)$

alors toutes les solutions de l'équation non homogène peuvent être exprimés sous forme:

$x(k) = x^{(p)}(k) + x^{(h)}(k)$

Rappels Théoriques - Equation aux différences¶

Lineaire - Ordre n¶

$a_n(k) x(k + n) + a_{n-1}(k) x(k + n - 1) + \cdots + a_0(k) x(k) = g(k)$

  • Invariante: $\forall i$ $ a_i(k) = a_i$
  • Homogène: $\forall k$ $g(k) = 0$

Théorème 7.3 - Combinaison des solutions homogènes¶

Soient $x^{(1)}(k),\cdots,x^{(m)}(k)$ $m$ solutions de l'équation homogène

alors $x(k) = \sum_{i}^{m} c_i x^{(i)}(k)$ est aussi un solution de l'équation homogène.

Rappels Théoriques - Equation aux différences¶

Lineaire à coefficients constants - Ordre n¶

$x(k + n) + a_{n-1} x(k + n - 1) + \cdots + a_0 x(k) = b$

Polynome caractèristique associé à l'équation homogène¶

$P(\lambda) = \lambda^n + a_{n-1}\lambda^{n-1} + \cdots + a_1\lambda + a_0 $

Théorème 7.6 - Solutions réelles de l'équation homogène¶

  • $\lambda_i \in \mathbb{R}$ avec multiplicité 1 $\Rightarrow$ $x^{(i)}(k) = \lambda^k$
  • $\lambda_i \in \mathbb{R}$ avec multiplicité $\mathbf{m}$ $\Rightarrow$ $m$ solutions :
    • $x^{(0)}(k) = \lambda^k$
    • $x^{(1)}(k) = k\lambda^k$
    • $\cdots$
    • $x^{(m-1)}(k) = k^{m-1}\lambda^k$

Rappels Théoriques - Equation aux différences¶

Lineaire à coefficients constants - Ordre n¶

$x(k + n) + a_{n-1} x(k + n - 1) + \cdots + a_0 x(k) = b$

Polynome caractèristique associé à l'équation homogène¶

$P(\lambda) = \lambda^n + a_{n-1}\lambda^{n-1} + \cdots + a_1\lambda + a_0 $

Théorème 7.7 - Solution complexes de l'équation homogène¶

  • $\lambda_i=a \pm ib \in \mathbb{C}$ avec multiplicité 1 $\Rightarrow$ $w^{(i)}(k) = \rho^k \cos(\vartheta k)$, $z^{(i)}(k) = \rho^k \sin(\vartheta k)$ solutions complexes et conjuguées.
  • $\lambda_i=a \pm ib \in \mathbb{C}$ avec multiplicité $\mathbf{m}$ $\Rightarrow$ $2m$ solutions :
    • $w^{(0)}(k) = \rho^k \cos(\vartheta k)$, $z^{(0)}(k) = \rho^k \sin(\vartheta k)$
    • $w^{(1)}(k) = k \rho^k \cos(\vartheta k)$, $z^{(1)}(k) = k \rho^k \sin(\vartheta k)$
    • $\cdots$
    • $w^{(m-1)}(k) = k^{m-1} \rho^k \cos(\vartheta k)$, $z^{(m-1)}(k) = k^{m-1} \rho^k \sin(\vartheta k)$

Exercices¶

Calculer les solutions des equations:

  1. $x(k+3)-4x(k+2)+5x(k+1)-2x(k)=0$ pour
    • $x(0) = 0$
    • $x(1) = 1$
    • $x(2) = 0$
  2. $x(k+1)=x(k)+x(k-1)$ pour
    • $x(0) = 0$
    • $x(1) = 1$
  3. $x(k+2)+x(k)=0$ pour
    • $x(0) = 0$
    • $x(1) = 1$

Exercice 1¶

$x(k+3)-4x(k+2)+5x(k+1)-2x(k)=0$ pour $x(0) = 0$, $x(1) = 1$, $x(2) = 0$

Equation caractèristique¶

$P(\lambda) = \lambda^3 -4 \lambda^2 + 5\lambda -2 = 0$

In [21]:
c = [1 -4 5 -2];
roots(c)
ans =

   2.00000 + 0.00000i
   1.00000 + 0.00000i
   1.00000 - 0.00000i

Théorème 7.6¶

$\lambda_1 = 2$ $\Rightarrow$ $x^{(1)}(k) = 2^k$

$\lambda_{2,3} = 1$ $\Rightarrow$ $x^{(2)}(k) = 1^k$ $x^{(3)}(k) = k 1^k$

Solution génerale¶

$x(k) = c_1 x^{(1)}(k) + c_2 x^{(2)}(k)+ c_3 x^{(3)}(k) = c_1 2^k + c_2 + c_3 k$

Détermination coefficients¶

$\begin{cases} x(0) &= 0 = c_1 2^0 + c_2 \\ x(1) &= 1 = c_1 2^1 + c_2 + c_3 \\ x(2) &= 0 = c_1 2^2 + c_2 + 2c_3 \end{cases} \Rightarrow \begin{cases} c_1 + c_2 &= 0 \\ 2 c_1 + c_2 + c_3 &= 1 \\ 4 c_1 + c_2 + 2c_3 &= 0 \\ \end{cases} $

In [22]:
C = [1 1 0; 2 1 1; 4 1 2];
x_0 = [0; 1; 0];
C \ x_0
ans =

  -2
   2
   3

Solution¶

$x(k) = c_1 2^k + c_2 + c_3 k = -2 \cdot 2^k + 2 + 3k$

Exercice 2¶

$x(k+1)=x(k)+x(k-1)$ pour $x(0) = 0$, $x(1) = 1$

$x(k+1)=x(k)+x(k-1)$ $\Rightarrow$ $x(k+2) - x(k+1) - x(k) = 0$

Equation caractèristique¶

$P(\lambda) = \lambda^2 - \lambda - 1 = 0$

In [23]:
c = [1 -1 -1];
roots(c)
ans =

  -0.61803
   1.61803

Théorème 7.6¶

$\lambda_1 = \frac{1-\sqrt{5}}{2}$ $\Rightarrow$ $x^{(1)}(k) = (\frac{1-\sqrt{5}}{2})^k$ $\lambda_2 = \frac{1+\sqrt{5}}{2}$ $\Rightarrow$ $x^{(2)}(k) = (\frac{1+\sqrt{5}}{2})^k$

Solution génerale¶

$x(k) = c_1 x^{(1)}(k) + c_2 x^{(2)}(k) = c_1 \left(\frac{1-\sqrt{5}}{2}\right)^k + c_2 \left(\frac{1+\sqrt{5}}{2}\right)^k $

Détermination coefficients¶

$\begin{cases} x(0) &= 0 = c_1 \left(\frac{1-\sqrt{5}}{2}\right)^0 + c_2 \left(\frac{1+\sqrt{5}}{2}\right)^0 \\ x(1) &= 1 = c_1 \left(\frac{1-\sqrt{5}}{2}\right)^1 + c_2 \left(\frac{1+\sqrt{5}}{2}\right)^1 \\ \end{cases} \Rightarrow \begin{cases} c_1 + c_2 &= 0 \\ \left(\frac{1-\sqrt{5}}{2}\right) c_1 + \left(\frac{1+\sqrt{5}}{2}\right) c_2 &= 1 \\ \end{cases} $

In [24]:
C = [1 1; (1-sqrt(5))/2 (1+sqrt(5))/2];
x_0 = [0; 1];
C \ x_0
ans =

  -0.44721
   0.44721

Solution¶

$ x(k) = c_1 \left( \frac{1-\sqrt{5}}{2} \right)^k + c_2 \left(\frac{1+\sqrt{5}}{2}\right)^k = -\frac{1}{\sqrt{5}} \left(\frac{1-\sqrt{5}}{2}\right)^k + \frac{1}{\sqrt{5}} \left(\frac{1+\sqrt{5}}{2}\right)^k $

Exercice 3¶

$x(k+2)+x(k)=0$ pour $x(0) = 0$, $x(1) = 1$

Equation caractèristique¶

$P(\lambda) = \lambda^2 + 1 = 0$

In [25]:
c = [1 0 1];
roots(c)
ans =

  -0 + 1i
   0 - 1i

Théorème 7.7¶

$\lambda_i=a \pm ib \in \mathbb{C}$ avec multiplicité 1 $\Rightarrow$ $w^{(i)}(k) = \rho^k \cos(\vartheta k)$, $z^{(i)}(k) = \rho^k \cos(\vartheta k)$

$ \begin{cases} a&=0 \\ b&=1 \\ \end{cases} \Rightarrow \begin{cases} \rho &=\sqrt{a^2+b^2}=1 \\ \theta &=\tan^{-1} \left( \frac{b}{a} \right) = \frac{\pi}{2} \\ \end{cases}$

$w^{(1)}(k) = \rho^k \cos(\vartheta k) = 1^k \cos \left(\frac{\pi}{2} k \right) $

$z^{(1)}(k) = \rho^k \sin(\vartheta k) = 1^k \sin \left(\frac{\pi}{2} k \right) $

Solution génerale¶

$x(k) = c_1 x^{(1)}(k) + c_2 x^{(2)}(k) = c_1 \cos \left(\frac{\pi}{2} k \right) + c_2 \sin \left(\frac{\pi}{2} k \right) $

Détermination coefficients¶

$\begin{cases} x(0) &= 0 = c_1 \cos \left(\frac{\pi}{2} 0 \right) + c_2 \sin \left(\frac{\pi}{2} 0 \right) \\ x(1) &= 1 = c_1 \cos \left(\frac{\pi}{2} 1 \right) + c_2 \sin \left(\frac{\pi}{2} 1 \right) \\ \end{cases} \Rightarrow \begin{cases} c_2 &= 0 \\ c_1 &= 1 \\ \end{cases} $

Solution génerale¶

$x(k) = c_1 x^{(1)}(k) + c_2 x^{(2)}(k) = \cos \left(\frac{\pi}{2} k \right)$

Rappels Théoriques - Equilibres¶

Equilibre d'une équation aux différences à $n$ pas à coefficients constants¶

$a_n x(k + n) + a_{n-1} x(k + n - 1) + \cdots + a_0 x(k) = b$

Un équilibre est un nombre $\bar{x}$ auquel il correspond une solution constante $x(k)=\bar{x}$

  • Si $\sum_{i=0}^{n} a_i \neq 0$ alors $\bar{x} = \frac{b}{\sum_{i=0}^{n} a_i}$

  • Si $\sum_{i=0}^{n} a_i = 0$ alors:

  • $b=0$ $\Rightarrow$ Chaque $\bar{x}$ est un point d'équilibre

  • $b \neq 0$ $\Rightarrow$ $\bar{x}$ = Aucun $\bar{x}$ est un point d'équilibre

Stabilité d'un équilibre¶

  • Stable : $\forall \varepsilon > 0$, il existe un $\delta > 0$ et un $k_0$ telles que $\sum_{j=0}^{n-1} \vert x(j) - \bar{x} \vert < \delta \Rightarrow \vert x(k) - \bar{x} \vert < \varepsilon$ $\forall k > k_0$ Autrement dit, des états initiaux proches de l'équilibre donnent origine à des trajectoires proches de l'équilibre.

  • Asymptotiquement stable : Si pour chaque $n$-tuple $\{x(0),\cdots,x(n-1)\}$ la solution correspondante satifait $\lim_{k \rightarrow \infty} x(k) = \bar{x}$

Théorème 7.8¶

Un équilibre $\bar{x}$ de l'équation linéaire est:

  • Stable: $\forall \lambda_i, i=1,\cdots, n$ soit $\vert \lambda_i \vert \leq 1$ soit $\vert \lambda_i \vert = 1$ avec multiplicité égale à 1.

  • Asymptotiquement stable: $\forall \lambda_i, i=1,\cdots, n$ soit $\vert \lambda_i \vert < 1$

N.B Tout équilibre asymptotiquement stable est aussi stable.

Exercice¶

Calculer l'équilibre et analyser la stabilité pour les systèmes suivantes:

  1. $6x(k+2)-5x(k+1)+x(k)=2$
  2. $x(k+2)-2x(k+1)+2x(k)=0$
  3. $x(k+3)+x(k)=2$

$6x(k+2)-5x(k+1)+x(k)=2$

Equation caractéristique¶

$P(\lambda) = 6\lambda^2 -5 \lambda + 1 = 0$

In [26]:
c = [6 -5 1];
b = 2;
x_eq = b / sum(c)
roots(c)
x_eq =  1
ans =

   0.50000
   0.33333

Théorème 7.8¶

$\lambda_1 = \frac{1}{3}$ et $\lambda_2 = \frac{1}{1}$

$ \vert \lambda_1 \vert < 1 \wedge \vert \lambda_2 \vert < 1$ $\Rightarrow$ Equilibre asymptotiquement stable.

$x(k+2)-2x(k+1)+2x(k)=0$

Equation caractéristique¶

$P(\lambda) = \lambda^2 -2 \lambda + 2 = 0$

In [27]:
c = [1 -2 2];
b = 0;
x_eq = b / sum(c)
roots(c)
x_eq = 0
ans =

   1.00000 + 1.00000i
   1.00000 - 1.00000i

Théorème 7.8¶

$\lambda_1 = 1+i$ et $\lambda_2 = 1+i$

$ \vert \lambda_1 \vert = \vert \lambda_2 \vert = \sqrt{\Re(\lambda_1)^2 + \Im(\lambda_1)^2} = \sqrt{2}$

$ \vert \lambda_1 \vert > 1 \wedge \vert \lambda_2 \vert > 1$ $\Rightarrow$ Equilibre instable.

$x(k+3)+x(k)=0$

Equation caractéristique¶

$P(\lambda) = \lambda^3 + 1 = 0$

In [1]:
c = [1 0 0 1];
b = 0;
x_eq = b / sum(c)
roots(c)
x_eq = 0
ans =

  -1.00000 + 0.00000i
   0.50000 + 0.86603i
   0.50000 - 0.86603i

Théorème 7.8¶

$\lambda_1 = -1$, $\lambda_2 = \frac{1+i\sqrt{3}}{2}$ et $\lambda_2 = \frac{1-i\sqrt{3}}{2}$

$ \vert \lambda_1 \vert = 1$

$ \vert \lambda_2 \vert = \vert \lambda_3 \vert = \sqrt{\Re(\lambda_1)^2 + \Im(\lambda_1)^2} = \sqrt{\frac{1}{4} + \frac{3}{4}} = 1$

$ \vert \lambda_1 \vert = 1 \wedge \vert \lambda_2 \vert = 1 \wedge \vert \lambda_3 \vert = 1$ $\Rightarrow$ Equilibre stable mais pas asymptotiquement stable

Exercice¶

Calculer les solutions des équations suivantes:

  1. $x(k+2)-4x(k+1)+3x(k)=2^k$
  2. $x(k+2)-4x(k+1)+3x(k)=b$ pour $b\neq 1$, $b\neq 3$

Exercice 1¶

$x(k+2)-4x(k+1)+3x(k)=2^k$

Equation homogène associé¶

$x(k+2)-4x(k+1)+3x(k)=0$

Equation caractéristique¶

$P(\lambda) = \lambda^2 - 4 \lambda + 3 = 0$

In [29]:
c = [1 -4 3]
roots(c)
c =

   1  -4   3

ans =

   3
   1

Théorème 7.6¶

$\lambda_1 = 1$ $\Rightarrow$ $x^{(1)}(k) = 1^k$

$\lambda_2 = 3$ $\Rightarrow$ $x^{(2)}(k) = 3^k$

Solution génerale homogène¶

$x^{(h)}(k) = c_1 x^{(1)}(k) + c_2 x^{(2)}(k) = c_1 + c_2 3^k $

Solution particulière¶

$x^{(p)}(k) = c 2^k$ vu le $2^k$ à droite de l'égalité

$x^{(p)}(k) = c 2^k$ et $x(k+2)-4x(k+1)+3x(k)=2^k$ $\Rightarrow$ $c2^{k+2}-4c2^{k+1}+3c2^k=2^k$

$c2^{k+2}-4c2^{k+1}+3c2^k=2^k$ $\Rightarrow$ $4c-8c+3c=1$ $\Rightarrow$ $c=-1$

$x^{(p)}(k) = -2^k$

Théorème 7.2¶

$x(k) = x^{(h)}(k) + x^{(p)}(k) = c_1 + c_2 3^k - 2^k$

Exercice 2¶

$x(k+2)-4x(k+1)+3x(k)=b^k$ pour $b\neq 1$, $b\neq 3$

Equation homogène associé¶

$x(k+2)-4x(k+1)+3x(k)=0$

Equation caractéristique¶

$P(\lambda) = \lambda^2 - 4 \lambda + 3 = 0$

In [30]:
c = [1 -4 3]
roots(c)
c =

   1  -4   3

ans =

   3
   1

Théorème 7.6¶

$\lambda_1 = 1$ $\Rightarrow$ $x^{(1)}(k) = 1^k$

$\lambda_2 = 3$ $\Rightarrow$ $x^{(2)}(k) = 3^k$

Solution génerale homogène¶

$x^{(h)}(k) = c_1 x^{(1)}(k) + c_2 x^{(2)}(k) = c_1 + c_2 3^k $

Solution particulière¶

$x^{(p)}(k) = c b^k$ vu le $b^k$ à droite de l'égalité

$x^{(p)}(k) = c b^k$ et $x(k+2)-4x(k+1)+3x(k)=b^k$ $\Rightarrow$ $cb^{k+2}-4cb^{k+1}+3cb^k=b^k$

$cb^{k+2}-4cb^{k+1}+3cb^k=b^k$ $\Rightarrow$ $cb^2-4bc+3c=1$ $\Rightarrow$ $c=\frac{1}{b^2-4b+3}$

$x^{(p)}(k) = \frac{b^k}{b^2-4b+3}$

Théorème 7.2¶

$x(k) = x^{(h)}(k) + x^{(p)}(k) = c_1 + c_2 3^k + \frac{b^k}{b^2-4b+3}$