Azzera filtri
Azzera filtri

Bifurcation Diagram will not graph

4 visualizzazioni (ultimi 30 giorni)
Emily Tabb
Emily Tabb il 27 Mag 2021
Risposto: Star Strider il 27 Mag 2021
My code below will run but does not graph a bifurcation diagram it just results in an empty figure with axis, can anyone see what I have done wrong?
Thankyou
figure;
ax(1) = axes;
hold on
xlabel ('k');
ylabel ('C');
xlim([-2 2]);
ylim([0 40]);
x=1;
for k = [-0.5:0.1:1.6]
syms c
eqn = (1/10)*((c-23)*(25-c)*(c-29))-k ==0;
Solution = vpasolve(eqn, c);
x=x+1;
Solution
plot(ax(1), k, Solution)
end

Risposte (1)

Star Strider
Star Strider il 27 Mag 2021
Plot the points —
figure;
ax(1) = axes;
hold on
xlabel ('k');
ylabel ('C');
xlim([-2 2]);
ylim([0 40]);
x=1;
k = [-0.5:0.1:1.6];
Solution = cell(size(k)); % Preallocate
for k1 = 1:numel(k)
syms c
eqn = (1/10)*((c-23)*(25-c)*(c-29))-k(k1) ==0;
Solution{:,k1} = double(vpasolve(eqn, c));
% x=x+1
plot(ax(1), k(k1), Solution{k1}, '.')
end
hold off
grid
Out = [k; cell2mat(Solution)]
Out = 4×22
-0.5000 -0.4000 -0.3000 -0.2000 -0.1000 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1.0000 1.1000 1.2000 1.3000 1.4000 1.5000 1.6000 23.8074 23.4746 23.3126 23.1902 23.0885 23.0000 22.9209 22.8489 22.7824 22.7205 22.6625 22.6077 22.5556 22.5060 22.4586 22.4131 22.3694 22.3272 22.2864 22.2470 22.2087 22.1716 24.0000 24.3691 24.5684 24.7292 24.8705 25.0000 25.1215 25.2376 25.3498 25.4594 25.5674 25.6746 25.7819 25.8901 26.0000 26.1127 26.2294 26.3519 26.4829 26.6265 26.7913 27.0000 29.1926 29.1563 29.1190 29.0806 29.0410 29.0000 28.9576 28.9136 28.8678 28.8201 28.7702 28.7177 28.6625 28.6039 28.5414 28.4742 28.4012 28.3209 28.2307 28.1266 28.0000 27.8284
Not what appears to me to be a bifurcation plot, however it is a plot!

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by