Help! Bifurcation diagram for difference equation
显示 更早的评论
Hello everyone! I need help figuring out how to plot a bifurcation diagram when dealing with difference equations. I tried following the indications on the page http://www.math.le.ac.uk/people/rld8/ma1251/lab3.html, but I cannot figure out what I'm doing wrong. This is what I wrote:
clear all;
close all;
Npre=100;
Nplot=200;
x = zeros(Nplot,1);
for lambda = 0:0.01:5
x(1) = 2.95;
x(2)=x(1)+0.2;
x(3)=x(1)-0.2;
for i = 3:Npre
% x(i+3) = x(i+2)+0.19*100*(0.5*0.3*(3-x(i+2))-0.5*0.5*(x(i+2)-3))./(1+exp(-lambda*(2.1*((1/3)-0.01)+15*((x(i+1)-x(i))./x(i)))));
x(3)=x(3)+0.19*100*(0.5*0.3*(3-x(3))-0.5*0.5*(x(3)-3))./(1+exp(-lambda*(2.1*((1/3)-0.01)+15*((x(2)-x(1))./x(1)))));
end
for i = 1:Nplot-3
x(i+3) = x(i+2)+0.19*100*(0.5*0.3*(3-x(i+2))-0.5*0.5*(x(i+2)-3))./(1+exp(-lambda*(2.1*((1/3)-0.01)+15*((x(i+1)-x(i))./x(i)))));
end
plot(lambda*ones(Nplot,1), x, '.', 'markersize', 2);
hold on;
end
title('Bifurcation diagram');
xlabel('lambda'); ylabel('x_i');
set(gca, 'xlim', [0 5], 'ylim', [1.5 4.5]);
hold off;
8 个评论
darova
2020-4-12
I don't understand the question. I run your code and got this:

Can you exaplain more? Maybe a simple sketch or simething?
Carolina Biliotti
2020-4-12
darova
2020-4-12
Can you attach your original eqaations?
I have somer problem with the link you gave

Carolina Biliotti
2020-4-12
Carolina Biliotti
2020-4-12
darova
2020-4-12
There is too much text! I understand this: you have diff equation and want to draw something
Where is the diff equation? Can you show? What needs to be done to draw bifurcation diagram?
Carolina Biliotti
2020-4-12
darova
2020-4-12
Try to change lambda value

Don't forget about limits
set(gca, 'xlim', [0 5], 'ylim', [1.5 4.5]);
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Assembly 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
