Ask Your Question

Andrew F's profile - activity

2015-03-20 10:10:31 +0100 received badge  Teacher (source)
2015-03-20 10:10:31 +0100 received badge  Necromancer (source)
2013-12-06 19:35:25 +0100 answered a question Phase portraits of 2-dimensional systems

One thing you can do is just make sure your vector function always returns the same length, that is, to wrap it in a call to a function that unitizes it (that's a word, right?)

def unit(v):
    mag = sqrt(v[0]*v[0]+v[1]*v[1])
    return (v[0]/mag, v[1]/mag)
VF = plot_vector_field(unit([-y,-x]),[x,-2,2],[y,-2,2])

That's about what I did, anyway.