Hello, I've been trying to replicate a cusp catastrophe 3D plot I found in Strogatz's book, nonlinear dyamics and chaos (p. 79).
For reference, this is a nonlinear 1D ODE: dx/dt = r x (1 - x/k) - x^2/(1 + x^2)
I verified that the model undergoes saddle-node bifurcations by playing around with the value of the paremeters r and k.
Manipulate[
Plot[r x - (r x^2)/k - x^2/(1 + x^2), {x, 1, 10}], {k, 1,
10.}, {r, .01, 2}]
And I managed to replicate the bifurcation diagram by expressing r and k as parametric functions of x. This is achieved by differencing the ODE w.r.t. to x, substituting the values back to the ODE and solving for the parameters, to get 2 parametric equations (r and k) as functions of x.
The book does the same, so I'm surre there's no mistake in this:
r = (2 x^3)/(1 + x^2)^2 k=(2 x^3)/(x^2 - 1)
ParametricPlot[{ (2 x^3)/(x^2 - 1), (2 x^3)/(1 + x^2)^2}, {x, 1.01,
40}, AspectRatio -> 1.01/1, AxesLabel -> {"k", "r"},
AxesOrigin -> {0, 0}]
So far so good, I plotted r-k for different values of x and I think I plotted the bifurcation diagram correctly.
When I added x to the above plot as another dimension, I was expecting to get a 3D stability diagram in the x,r,k space (fig. 3.7.6 in book). However, what I get is the same 2D plot as above, only in a 3D space.
ParametricPlot3D[{(2 x^3)/(1 + x^2)^2, (2 x^3)/(x^2 - 1), x}, {x, 1,
10}, PlotRange -> {0, 12}]
So, with the parametricPlot3D what I think I get is a projection of the 3D space on r-k but the actual values of x are missing.
Then, following this demonstration, I tried to plot it using the ContourPlot3D, however what I get makes no sense to me.
G[r_, k_, x_] := r x (1 - x/k) - x^2/(1 + x^2)
ContourPlot3D[Evaluate[D[G[r, k, x], x]],
{r, 0.1, 1}, {k, 1, 70}, {x, 1.01, 40},
Axes -> True, ContourStyle -> {EdgeForm[]},
AxesLabel -> TraditionalForm /@ {r, k, x}]
I get three flat surfaces on the r-k-x space that I don't even know what they represent. It is not quite clear to me why I get these flat curves instead of something resembling at least the 3D counterpart of the 2D bifurcation diagram.