Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Plotting bifurcation diagram
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Sanaa

Posts: 162
Registered: 3/20/12
Plotting bifurcation diagram
Posted: Jan 30, 2013 9:10 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

I am plotting the bifurcation diagram for the map
x_(n+1)= x_n + (t-n*r)+ rho* x_n*(1-x_(n-1)), n=0,1,2,...,
t is the time should be between n*r and (n+1)*r.
What's wrong in the code! I should have got a diagram not a point!!!

% define the vector of colors, to plot the dat aof reach value of r in
% different color
color_vec = ['b'];
r=0.5;
for rho = 0: 0.001:4
% define the number of deiscrete times in interval [k*r, (k+1)*r]
n = 10;
% define the nimber of iterations k = 1,.....,Nit
Nit = 50;
% define the initial vector which is a vector of size n
x0 = 0.3*ones(1,n);
% define vectors x_next and x_previous
x_next = zeros(1,n);
x_previous = zeros(1,n); %x_n
x_pp=zeros(1,n); %x_n-1
time = zeros(1,n);

% initialize x_previous
%x_previous = x0;
x_pp=0.2*ones(1,n); %x_n-1

hold on
for i = 1:Nit
time = linspace(i*r,(i+1)*r,Nit);
x_next = x_previous+(time(i)-i.*r)*rho*x_pp.*(1-x_pp);
%x_previous = x_next;
end
end
plot(rho,x_next(1),'b.')

I need your help if you please.
Thanks a lot in advance.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.