Logistic Map Bifurication Diagram
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Trying to plot the logistic map bifurication diagram, but keep getting errors... can someone take a look at this and tell me where I am going wrong.
c=0;
y=0.0;
hold on
while c < 1
for i=1:100;
y = -c*y.^2 +c*y.; %converge the iteration
end
for i=1:20
y = -c*y.^2 +c*y.;
plot(c,y,'.', 'MarkerSize',1); % plot the converged points
end
c=c+0.002;
end
0 comentarios
Respuestas (1)
David Young
el 4 de Mzo. de 2011
There are various problems:
There's a syntax error due to the dot at the end of
y = -c*y.^2 +c*y.;
Since y is a scalar, you can just omit the dot, and use
y = -c*y.^2 +c*y;
c in the range 0 to 1 produces uninteresting behaviour - to see bifurcation you could scan c through the range 2.8 to 4.
y needs to be initialised inside the outer loop (after the while) otherwise it just starts from whatever the previous value was. However, initialising to 0 (or to 1) will produce uninteresting behaviour. Try initialising y to 0.5.
With these changes, you can get a bifurcation plot.
0 comentarios
Ver también
Categorías
Más información sobre Nonlinear Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!