Practica 1 Ejercicio 5

Para cada uno de los siguientes sistemas encontrar todos los puntos de equilibrio y determinar el tipo de cada punto de equilibio aislado.

$$\left\{ \begin{array}{lcc} \dot{x}_{1}=a x_{1}-x_{1}x_{2} \\ \\ \dot{x}_{2}=bx_{1}^{2}-cx_{2} \end{array} \right.$$


In [1]:
import sympy as sym

In [2]:
#Con esto las salidas van a ser en LaTeX
sym.init_printing(use_latex=True)

In [5]:
x_1, x_2, a, b, c= sym.symbols('x_1 x_2 a b c')

In [7]:
sym.Symbol("a",positive=True)
sym.Symbol("b",positive=True)
sym.Symbol("c",positive=True)


Out[7]:
$$c$$

In [8]:
X = sym.Matrix([x_1, x_2])
X


Out[8]:
$$\left[\begin{matrix}x_{1}\\x_{2}\end{matrix}\right]$$

In [18]:
f_1 = a * x_1 - x_1 * x_2
f_1


  File "<ipython-input-18-a96337569c26>", line 1
    f_1(x_1,x_2) = a * x_1 - x_1 * x_2
SyntaxError: can't assign to function call

In [11]:
f_2 = b * x_1 ** 2 - c * x_2
f_2


Out[11]:
$$b x_{1}^{2} - c x_{2}$$

In [12]:
F = sym.Matrix([f_1,f_2])
F


Out[12]:
$$\left[\begin{matrix}a x_{1} - x_{1} x_{2}\\b x_{1}^{2} - c x_{2}\end{matrix}\right]$$

In [17]:
# puntos de equilibrio del sistema
pes = sym.solve([f_1,f_2],[x_1,x_2])
pes


Out[17]:
$$\begin{bmatrix}\begin{pmatrix}0, & 0\end{pmatrix}, & \begin{pmatrix}- \sqrt{\frac{a c}{b}}, & a\end{pmatrix}, & \begin{pmatrix}\sqrt{\frac{a c}{b}}, & a\end{pmatrix}\end{bmatrix}$$

In [15]:
A = F.jacobian(X)
A


Out[15]:
$$\left[\begin{matrix}a - x_{2} & - x_{1}\\2 b x_{1} & - c\end{matrix}\right]$$

In [23]:
A_1 = A.subs({x_1:pes[0][0],x_2:pes[0][0]})
A_1


Out[23]:
$$\left[\begin{matrix}a & 0\\0 & - c\end{matrix}\right]$$

In [25]:
A_2 = A.subs({x_1:pes[1][0],x_2:pes[1][1]})
A_2


Out[25]:
$$\left[\begin{matrix}0 & \sqrt{\frac{a c}{b}}\\- 2 b \sqrt{\frac{a c}{b}} & - c\end{matrix}\right]$$

In [28]:
A_2.eigenvals()


Out[28]:
$$\begin{Bmatrix}- \frac{c}{2} - \frac{1}{2} \sqrt{- c \left(8 a - c\right)} : 1, & - \frac{c}{2} + \frac{1}{2} \sqrt{- c \left(8 a - c\right)} : 1\end{Bmatrix}$$

In [30]:
A_3 = A.subs({x_1:pes[2][0],x_2:pes[2][1]})
A_3


Out[30]:
$$\left[\begin{matrix}0 & - \sqrt{\frac{a c}{b}}\\2 b \sqrt{\frac{a c}{b}} & - c\end{matrix}\right]$$

In [31]:
A_3.eigenvals()


Out[31]:
$$\begin{Bmatrix}- \frac{c}{2} - \frac{1}{2} \sqrt{- c \left(8 a - c\right)} : 1, & - \frac{c}{2} + \frac{1}{2} \sqrt{- c \left(8 a - c\right)} : 1\end{Bmatrix}$$

In [ ]: