Phase plot of a system of differential equations using Matlab

279 Views Asked by At

Assume the system: \begin{align} \begin{pmatrix} x \\ y \\ \end{pmatrix}' &= \begin{pmatrix} 7x+10y+3 \\ -5x-7y+1 \\ \end{pmatrix} \end{align}

By changing the variables so that $(0,0)$ is the equilibrium point, the system transforms to: \begin{align} \begin{pmatrix} x_1 \\ x_2 \\ \end{pmatrix}' &= \begin{pmatrix} 7x_1+10x_2\\ -5x_1-7x_2 \\ \end{pmatrix} = A \cdot \begin{pmatrix} x_1\\ x_2\\ \end{pmatrix} \end{align} After that, all we have to do in order to determine the equilibrium point's type and stability is to examine $A$'s eigenvalues.

Now, I would like to plot this system's solutions and its behavior near the equilibrium point using Matlab. Do I have to use the ode45 command to solve the system and then graph its solutions or is there a quicker way to obtain the phase plot?

Could someone provide me with the code which does that?

2

There are 2 best solutions below

0
On BEST ANSWER

You can use quiver for this

[x1, x2] = meshgrid(-1.0 : 0.2 : 1.0, -1.5 : 0.2 : 1.5);
u = 7 * x1 + 10 * x2;
v = -5 * x1 - 7 * x2;

figure
quiver(x1, y1, u, v)

From this representation you can see that solution will circle around $(x_1, x_2) = (0, 0)$, clockwise

enter image description here

0
On

One option is John Polking's pplane.