How to plot a phase portrait for this system of differential equations?

30.8k Views Asked by At

I beg your help.. I'd like the phase portrait for this system: \begin{aligned} \frac{dx}{dt} &= x (7-x-2y) \\ \frac{dy}{dt} &= y (5-y-x) \end{aligned} I don't know how to use Mathematica/Matlab ... :( If anyone can make this portrait and post a print screen here, I would thank you very much..

1

There are 1 best solutions below

0
On

The function you want in matlab is the quiver function.

The following will produce the required phase portrait, as I understand them.

% no domain is given, so I will use [-5,5] x [-5,5] 
%    with 50 subintervals in each direction
xdom = linspace(-5,5,51);
ydom = linspace(-5,5,51);

[X,Y] = meshgrid(xdom,ydom); % generate mesh of domain

U = X.*(7 - X - 2*Y); % dx/dt
V = Y.*(5 - X - Y);   % dy/dt

quiver(X,Y,U,V)