$$\left\{ \begin{array}{lcc} \dot{x}_{1}=x_{1}-x_{2}-(x_{1}^{2}+\frac{3}{2}x_{2}^{2})x_{1} \\ \\ \dot{x}_{2}=x_{1}+x_{2}-(x_{1}^{2}+\frac{1}{2}x_{2}^{2})x_{2} \end{array} \right.$$
In [2]:
import sympy as sym
In [3]:
#Con esto las salidas van a ser en LaTeX
sym.init_printing(use_latex=True)
In [4]:
x_1, x_2 ,theta = sym.symbols('x_1 x_2 theta')
In [5]:
X = sym.Matrix([x_1, x_2])
X
Out[5]:
In [6]:
f_1 = x_1 - x_2 - (x_1**2 + sym.Rational(3,2)* x_2**2)*x_1
f_1
Out[6]:
In [7]:
f_2 = x_1 + x_2 - (x_1**2 + sym.Rational(1,2)* x_2**2)*x_2
In [8]:
F = sym.Matrix([f_1,f_2])
F
Out[8]:
In [9]:
A = F.jacobian(X)
A
Out[9]:
In [10]:
A_1 = A.subs({x_1:0,x_2:0})
A_1
Out[10]:
In [11]:
A_1.eigenvals()
Out[11]:
In [12]:
sym.latex(A_1)
Out[12]:
In [13]:
#sym.plot_implicit((f_1 )&(f_2))
In [14]:
ine = (f_1 <= 0)&(f_2 <= 0)
In [15]:
campo = 2*x_1*F[0] + 2*x_2*F[1]
campo = campo.simplify()
In [ ]:
sym.plot_implicit(campo < 0,xlabel=r'$x_1$',ylabel=r'$x_2$',title='Zona de existencia de ciclo limite')
In [17]:
sym.exp(x_2)
Out[17]:
In [ ]:
F.subs({x_1:2,x_2:-2})
In [18]:
#sym.solve(F)
In [19]:
expr = sym.cos(theta)**4 + sym.sin(theta)**4 - 5*sym.cos(theta)**2 * sym.sin(theta)**2
expr
Out[19]:
In [24]:
sym.plot(expr)
In [23]:
expr = sym.diff(F[0],x_1) + sym.diff(F[1],x_2)
expr
Out[23]:
In [ ]: