5

I have the function $f(x)=x^3 + a x$ and I have to plot a bifurcation diagram for values of $a$ between 0 and 2. I have used the code below but it doesn't seem to work for me:

ListPlot[ParallelTable[
Thread[{a, Nest[x^3 + ax &, Range[0, 1, 0.01], 1000]}], {a, 0, 2}], 
PlotStyle -> PointSize[0]]

Was wondering if anything is wrong with the code?

corey979
  • 23,947
  • 7
  • 58
  • 101
user44631
  • 83
  • 5
  • 1
  • ax is not the same as a*x. 2) You need to use # instead of x in Nest. 3) Is this for the differential equation x'[t]==f[x[t]] or the difference equation x[t+1]==f[x[t]]?
  • – Chris K Nov 30 '16 at 00:37
  • 2
    You've got terrible overflows; see what's happening with NestList[#^3 + 0.1 # &, 0.5, 500]. Additionally, you should reference where you took the piece of code you're trying to adapt. – corey979 Nov 30 '16 at 00:43
  • Many thanks for your help! :) – user44631 Nov 30 '16 at 22:16