0
$\begingroup$

Try a simple example about bifurcarion. The codes in MM are as follows:

Block[{x = 0.2}, For[u = 2.9, u < 3, u = u + 0.05,  For[i = 0, i < 30, i++,   {x1 = u x (1 - x);    x = x1;    if[i > 10, ListPlot[{u, x}]]    }]]]

enter image description here

I find it does'not work. The objective is to draw a gragh like this: enter image description here

The code is fine in the matlab:

enter image description here

But I don't know what's the problem in Mathmatica. Hope someone genius could help me. Thanks!

$\endgroup$
1
$\begingroup$

Use the standard method and compare with what you want. Standard code

X = Compile[{{u, _Real}}, ({u, #} &) /@
                Union[Drop[NestList[u # (1 - #) &, .2, 300], 100]]];

ListPlot[Flatten[Table[X[u], {u, 2.6, 4, .0001}], 1], 
 PlotStyle -> AbsolutePointSize[.0005], Frame -> True, 
 AspectRatio -> Automatic]

Your code

X1 = Compile[{{u, _Real}}, ({u, #} &) /@
                Union[Drop[NestList[u # (1 - #) &, .2, 18], 9]]];

ListPlot[Flatten[Table[X1[u], {u, 2.6, 4, .0001}], 1], 
 PlotStyle -> AbsolutePointSize[.0005], Frame -> True, 
 AspectRatio -> Automatic]

Standard (left) and your code (right) Figure 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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