4
$\begingroup$

My question is in the title. For example, the system could be:

$$\begin{align*}\frac{dx}{dt}&=-y+x[\alpha-(x^2+y^2)]\\\frac{dy}{dt}&=x+y[\alpha-(x^2+y^2)]\end{align*}$$

And I want to plot this :

plot

For example with {t, 0, 10} and {α, -10, 10, 2}.

I begin to try some experiments, but it seems to be too much difficult for the beginner I am. So, thank you for your educational help.

Pascal77

$\endgroup$
3
  • 4
    $\begingroup$ Please post your code instead of picture. $\endgroup$ – cvgmt Feb 24 at 12:42
  • $\begingroup$ My code is not available. Sorry. $\endgroup$ – Pascal77 Feb 24 at 12:52
  • $\begingroup$ By $f(x)$ do you mean $x(t)$, or is there another function $f$? The image looks like you wish to plot $(x(t), y(t))$. $\endgroup$ – Michael E2 Feb 24 at 16:48
5
$\begingroup$
sol = ParametricNDSolve[{D[x[t], t] == -y[t] + 
      x[t] (α - (x[t]^2 + y[t]^2)), 
    D[y[t], t] == x[t] + y[t] (α - (x[t]^2 + y[t]^2)), 
    x[0] == a, y[0] == b}, {x, y}, {t, 0, 10}, {a, b, α}];
{x0, y0} = {1, 1};
ParametricPlot3D[
 Table[{x[x0, y0, α][t], α, y[x0, y0, α][t]} /. 
   sol, {α, -10, 10, 2}], {t, 0, 10}, 
 AxesLabel -> {x, α, y}, PlotStyle -> Red, 
 LabelStyle -> Directive[Blue, Bold]]

enter image description here

$\endgroup$
3
  • $\begingroup$ Wonderfull! I tried on my own side with ParametricPlot3D but unsuccessfully. I was lost with the Table used in your solution. Thank you. $\endgroup$ – Pascal77 Feb 24 at 15:52
  • $\begingroup$ I just modified 2 little things : I added : "PlotRange-> All" I replaced "LabelStyle -> Directive[Blue, Bold]" by "LabelStyle -> Directive[Blue, Large]" $\endgroup$ – Pascal77 Feb 24 at 16:04
  • $\begingroup$ I just want to say that this help website is amazing! I snoop in on it very often, and I always discover some astounding solutions, very original ones, with a big touch of class. So congratulations to all specialists which, cvgmt, you belong. Many thanks! $\endgroup$ – Pascal77 Feb 24 at 16:28
3
$\begingroup$

Here's an approach that is a little non-precise mathematically but maybe more aesthetic:

sol = NDSolve[{
  x'[t] == -y[t] + x[t] (α[t] - (x[t]^2 + y[t]^2)), 
  y'[t] == x[t] + y[t] (α[t] - (x[t]^2 + y[t]^2)),
  α'[t] == -0.1,
  x[-50] == 1, y[-50] == 1, α[-50] == 25}, {x, y, α}, {t, 0, 400}][[1]];
ParametricPlot3D[{α[t], x[t], y[t]} /. sol, {t, 0, 400}, AxesLabel -> {α, x, y}, ImageSize -> Large]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks for your answer. Indeed, it is very smooth. It is another approach with alpha considered as a variable, in fact. Interesting. $\endgroup$ – Pascal77 Feb 24 at 17:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.