# Bifurcation Diagram for Wang-Chen System

I am trying to construct a bifurcation diagram of the system $$dx/dt=yz+a,\quad dy/dt=x^2-y, \quad dz/dt=1-4x.$$ I've scoured the internet for pre-made bifurcation diagrams and found many (mostly of the logistic map). However, as the code is quite complicated I am not sure how to edit the code so that it deals with my function instead of the logistic one. Would anyone have a general template for the code to create a bifurcation diagram of the system? Ideally, I would like to have a on the x-axis and x-values on the y-axis.

• Have a look at StreamPlot3D. For instance, defining v[{x_, y_, z_}, a_] := {y z + a, x^2 - y, 1 - 4 x} then evaluating StreamPlot3D[v[{x, y, z}, 1], {x, -3, 3}, {y, -3, 3}, {z, -3, 3}] would be a useful starting point. Commented Apr 27 at 11:49
• What are initial data and range for a could be? Commented Apr 27 at 11:57

## 1 Answer

To solve this problem we can use code from my answer here, we have after small modification

bifur = Compile[{{a, _Real}, {x0, _Real}, {y0, _Real}, {z0, _Real}}, \
({a, #[[1]]} &) /@
Union[Drop[
NestList[{#[[2]] #[[3]] + a, #[[1]]^2 - #[[2]],
1 - 4 #[[1]]} &, {x0, y0, z0}, 300], 100]]];

list = Module[{x0 = .5, y0 = .5, z0 = .5},
lst = Flatten[Table[bifur[a, x0, y0, z0], {a, -0.04, .04, .0001}],
1]; lst];

ListPlot[list,
PlotStyle -> AbsolutePointSize[.001],
FrameLabel -> { "a", "x"},
ImageSize -> Automatic, PlotRange -> All, Frame -> True]


• Perhaps I misunderstand your code, but it looks like you're solving the difference equations $x_{t+1}=y_tz_t+a$, $y_{t+1}=x_t^2-y_t$, $z_{t+1}=1-4x_t$, not the differential equations in the question. Commented Apr 27 at 16:19
• @ChrisK This is exactly what M.S asking about. :) Commented Apr 27 at 17:32
• The question isn't 100% clear, but $dx/dt$ is not the same as $x_{t+1}$. Maybe the @M.S. can weigh in on what they're looking for: the differential equations in their question or a related, discrete-time map. Commented Apr 27 at 17:39
• @ChrisK Do you remember a fixed-point theorem? Iterations in NestList are just a method to reach fixed points of this system. Commented Apr 27 at 17:52
• $dx$ should be approximated by $x_{t+1}-x_t$, not $x_t$, so you need an additional $x_t$ on the right hand side. Also, the dynamics of difference equations can be more complex than differential equations, so the stability will not necessarily correspond. Commented Apr 27 at 17:59