Bifurcation Diagram will not graph
조회 수: 4 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
Star Strider
2021년 5월 27일
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)]
Not what appears to me to be a bifurcation plot, however it is a plot!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!