How to plot this phase portrait correctly?
32 views (last 30 days)
The following ODE describes a nonlinear mechanical system:
where are numerically given system parameters.
I have to plot the phase portrait of this ODE. I tried the following:
I tried the following code:
axis tight equal
The system has 3 equilibrium points: in (0;0) there is a saddle, in (0.08;0) there is a centre, and in (-0.08;0) there is also a centre. So the phase portrait should look like the following:
Yet, Matlab gives me the following:
This isn't look good. What could be the problem, and how should I fix my code, to get a better result?
Ameer Hamza on 26 Apr 2020
You wrote the equation for dy wrong. Also, the range of y-values is also small. Try this
dx = y;
dy = -(s/m)*x.*(1-l./sqrt(x.^2+a^2));
streamslice(x, y, dx, dy, 'filled');