I find some weird results confusing me in the phase-space plot of Lotka-Volterra equations. My equation is
$$\frac{d\vec{y}}{dt} = \begin{bmatrix} \frac{2}{3}y_1 - \frac{4}{3}y_1y_2\\ -y_2+y_1y_2\\ \end{bmatrix}, \mbox{while}\ \ \vec{y}(t) = \begin{bmatrix} y_1(t)\\ y_2(t)\\ \end{bmatrix}\ \ \mbox{and}\ \ \vec{y}(0) = \begin{bmatrix} 1\\ 1\\ \end{bmatrix}$$ From this I get its phase-space plot, which is the curve of the equation $$y_1 - \mbox{ln}(y_1) + \frac{4}{3}y_2-\frac{2}{3}\mbox{ln}(y_2)=7/3$$ and this is a closed curve which should not expand or shrink.the curve of $y_1 - \mbox{ln}(y_1) + \frac{4}{3}y_2-\frac{2}{3}\mbox{ln}(y_2)=7/3$ And it is easy to imagine the 3D curve is like a coil spring.
But while I use ode45 in matlab to modify it, I find this curve is not like a closed curve but a spiral growing chaotically. $y_1,y_2$curve with ode45 in matlab and the 3D plot is also growing chaotically 3D plot of Lotka-Volterra equation
It sometimes expands and sometimes shrinks. But in my thought it should grow in a cylinder, like a spring.
From the equation $y_1 - \mbox{ln}(y_1) + \frac{4}{3}y_2-\frac{2}{3}\mbox{ln}(y_2)=7/3$ it's totally a closed curve. So is there something wrong with this equation, or the chaos is just the system error of ode45?
Your image is the result of drawing many large secants inside the convex closed solution curve. To see it happening, I ran the integation on some smaller time intervals, still using the time step 1
If you go further to
T=4000as you did, the shift of the secant positions will have covered the full solution curve and result in an image just as you got.Letting the solver return the internally generated sampling nodes and values instead of prescribing a step size 1 results in the image
This was produced with python's
scipy.integrate.solve_ivpUsing matlab withwill do essentially the same, but insert 3 interpolated points in each segment, so that the plot will follow the curve much more closely.
Another measure is to reduce the step size to
0.1or smaller. Adding some secants for time steps 1,2,4 to add some content gives