# Cusp Catastrophe plot using ParametricPlot3D

Posted 4 months ago
842 Views
|
4 Replies
|
9 Total Likes
|
 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. Answer
4 Replies
Sort By:
Posted 4 months ago
 Another way, highlighting the bifurcation: ParametricPlot3D[ Evaluate@{r /. First@Solve[r x (1 - x/k) - x^2/(1 + x^2) == 0, r], k, x}, {k, 0, 10}, {x, 0 + 2 $MachineEpsilon, k - 20$MachineEpsilon}, PlotPoints -> 75, MaxRecursion -> 3, Method -> {"BoundaryOffset" -> False}, BoxRatios -> {1, 1, 1}, PlotRange -> {{0, 1}, Automatic, Automatic}, MeshFunctions -> {Function[{r, k, x, u, v}, Last@Normalize@D[r x (1 - x/k) - x^2/(1 + x^2), {{r, k, x}}] // Evaluate]}, Mesh -> {{0}}, PlotStyle -> Opacity[0.7], MeshStyle -> Thick, AxesLabel -> {r, k, x}, ViewPoint -> Above]  Answer
Posted 4 months ago
 Hello, I believe I was working the same problem from Storgatz's class on the model of an insect outbreak. I plotted the cusp as follows: xprime[x_, r_, k_] := r x (1 - x/k) - x^2/(1 + x^2); ContourPlot3D[xprime[x, r, k] == 0, {r, 0, 1}, {k, 0, 10}, {x, 0, 10}] This resulted in the contour plot which matched the visualization from the book (may have to rotate it bit).  Answer
Posted 4 months ago
 The surface in either demo or Strogatz’s book is the contour for r-h-x space in terms of the fixed point equation, So you only need G[r,k,x] at zero.  Answer
Posted 4 months ago Answer