Plot a bifurcation diagram for a 2 parameter family of 1D maps
Show older comments
Greetings,
I need to plot bifurcation diagrams for the following function: f = a + (bx)/(1+x^2) for a = [-5, 0] and b = [11, 12]. The code I have runs without errors and generates a figure, but there is no data on the plot. I'd appreciate any help you can provide.
if true
% Two parameter family of one-dimensional maps
% f = a + (b*x)/(1 + x^2)
a = [-5 0];
b = [11 12];
x = [0:4];
% Compute f(a) for a = -5 and a = 0
for b = [11 : 0.01 : 12];
f_a1 = a(1) + b*x / (1 + x.^2);
end
for b = [11 : 0.01 : 12];
f_a2 = a(2) + b*x / (1 + x.^2);
end
% Compute f(b) for b = 11 and b = 12
b = [11 12];
for a = [-5 : 0.01 : 0];
f_b1 = a + b(1)*x / (1 + x.^2);
end
for a = [-5 : 0.01 : 0];
f_b2 = a + b(2)*x / (1 + x.^2);
end
figure
subplot(4,1,1)
plot (f_a1, '-');
title('Bifurcation Diagram for a = -5')
xlabel('b = 11:12')
xlim([11 12])
ylabel('x = 0:4')
ylim([0 4])
subplot(4,1,2)
plot (f_a2, '-');
title('Bifurcation Diagram for a = 0')
xlabel('b = 11:12')
xlim([11 12])
ylabel('x = 0:4')
ylim([0 4])
subplot(4,1,3)
plot (f_b1, '-');
title('Bifurcation Diagram for b = 11')
xlabel('a = -5:0')
xlim([-5 0])
ylabel('x = 0:4')
ylim([0 4])
subplot(4,1,4)
plot (f_b2, '-');
title('Bifurcation Diagram for b = 12')
xlabel('a = -5:0')
xlim([-5 0])
ylabel('x = 0:4')
ylim([0 4])
end
Accepted Answer
More Answers (0)
Categories
Find more on Polygons in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!