26 views (last 30 days)

The dynamical system contains two ODES:

dxdt=(1-(x.^2+y.^2)).*x-3.*y.*(x.^2+y.^2);

dydt=(1-(x.^2+y.^2)).*y+3.*x.*(x.^2+y.^2);

where :

x(t)=cos(3*t);

y(t)=sin(3*t);

This system has a unstable solution: x(t)=y(t)=0.

I want to produce a phase portrait of this system which will look like this:

Please help me. I do not know what code to use in order to produce this plot. The aatachment is the question. Thank you for the help!!!!

Ameer Hamza
on 6 Jun 2020 at 8:35

Edited: Ameer Hamza
on 6 Jun 2020 at 8:36

try this

dx_dt = @(x,y) (1-(x.^2+y.^2)).*x-3.*y.*(x.^2+y.^2);

dy_dt = @(x,y) (1-(x.^2+y.^2)).*y+3.*x.*(x.^2+y.^2);

[x, y] = meshgrid(-2:0.02:2, -2:0.02:2);

dx = dx_dt(x, y);

dy = dy_dt(x, y);

streamslice(x, y, dx, dy);

axis tight

axis equal

hold on

fplot(@(t) cos(3*t), @(t) sin(3*t), [0, 2*pi/3], 'Color', 'r', 'LineWidth', 2)

Opportunities for recent engineering grads.

Apply Today
## 2 Comments

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/542990-phase-portrait-of-a-2-dimensional-system-that-converges-to-a-unit-circle#comment_885896

⋮## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/542990-phase-portrait-of-a-2-dimensional-system-that-converges-to-a-unit-circle#comment_885896

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/542990-phase-portrait-of-a-2-dimensional-system-that-converges-to-a-unit-circle#comment_885926

⋮## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/542990-phase-portrait-of-a-2-dimensional-system-that-converges-to-a-unit-circle#comment_885926

Sign in to comment.