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.

  • 3
    $\begingroup$ 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. $\endgroup$ Commented Apr 27 at 11:49
  • 2
    $\begingroup$ What are initial data and range for a could be? $\endgroup$ Commented Apr 27 at 11:57

1 Answer 1


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]]} &) /@ 
      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];

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

Figure 1

  • $\begingroup$ 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. $\endgroup$
    – Chris K
    Commented Apr 27 at 16:19
  • $\begingroup$ @ChrisK This is exactly what M.S asking about. :) $\endgroup$ Commented Apr 27 at 17:32
  • $\begingroup$ 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. $\endgroup$
    – Chris K
    Commented Apr 27 at 17:39
  • $\begingroup$ @ChrisK Do you remember a fixed-point theorem? Iterations in NestList are just a method to reach fixed points of this system. $\endgroup$ Commented Apr 27 at 17:52
  • 1
    $\begingroup$ $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. $\endgroup$
    – Chris K
    Commented Apr 27 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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