In [1]:
import numpy as np
# importamos bibliotecas para plotear
import matplotlib
import matplotlib.pyplot as plt
# para desplegar los plots en el notebook
%matplotlib inline
# para cómputo simbólico
from sympy import *
init_printing()
x, y = symbols('x y')
In [2]:
f = (1-x-y)*x
f
Out[2]:
In [3]:
g = (4-7*x-3*y)*y
g
Out[3]:
In [4]:
solve(f, x)
Out[4]:
In [5]:
solve(g, y)
Out[5]:
In [6]:
Y = solve(g, y)[1]
solve(f.subs(y, Y),x)
Out[6]:
In [7]:
solve(g.subs(x, -y + 1), y)
Out[7]:
In [11]:
J = symbols("J")
J = Matrix([[diff(f, x), diff(f, y)],
[diff(g, x), diff(g, y)]])
J
Out[11]:
In [15]:
J = J.subs({x: 1/4, y:3/4})
J
Out[15]:
In [16]:
J.det(), J.trace()
Out[16]: