Monday, April 23, 2012

Using Matlab to draw phase portraits


This is a quick notes to help you
draw phase portraits using the quiver command in Matlab. It is best to draw
the phase portrait in small pieces. The system we shall consider is


[x1, x2] = meshgrid(-.5:0.05:0.5, -.5:.05:.5);
x1dot = -x1 - 2 *x2 .*x1.^2+x2; %Note the use of .* and .^
x2dot = -x1-x2;
quiver(x1,x2,x1dot, x2dot)

No comments:

Post a Comment