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 *
import sympy
init_printing()
x, y = symbols('x y')
    
In [2]:
    
f = 2*x - y
f
    
    Out[2]:
In [57]:
    
g = x + y
g
plt.arrow?
    
In [56]:
    
F = lambdify((x,y), f)
G = lambdify((x,y), g)
    
    
In [55]:
    
def step(x, y, dt, f, g):
    return (x + dt * f(x, y),
             y + dt * g(x, y))
def trayectoria(x0, y0, f, g, dt=0.01, steps=100):
    x = x0
    y = y0
    t = list()
    for n in range(steps):
        t.append((x, y))
        x, y = step(x, y, dt, f, g)
    return t
plt.plot([y[0] for y in trayectoria(5, 3, F, G, 0.1, 10)],
         [y[1] for y in trayectoria(5, 3, F, G, 0.1, 10)])
    
    Out[55]: