bifurcation plot in Matlab
Show older comments
hello
i am trying to plot system to find bifuraction value of bifurection parameter
my system is as shown
bifurcation parameter is tau which is a time delay between x and v .
when tau =0 the sysytem is stable
i prove mathemtically that for some tau >0 we will have hopf bifurcation in system
but when i use matlab (which is i am new in ) gives me unstable system then is stable
we should have stable and then unstable with oscilation and hopf birfucation
what i did wrong my be my codes is not good
can you please help me in that
clc;
clear;
close all;
Paramppp;
% This is the value of tau
% You can have same or different for x and v
% In this below example tau for x is 1 and for v is 0.5
%
%
% time max
tf=500;
%
t=linspace(0,tf,1000);
%
% This is the tau values staring at 1 then increasing by 0.5 and end at 5.
% You can change the numbers if you want
tau_start=7.5;
tau_finish=12;
tau_step=0.5;
%
for tau=tau_start:tau_step:tau_finish
%
lags=[tau tau];
%
%plot_r=((tau_finish-tau_start)/tau_step)+1;
%plot_rc=round(plot_r/2);
%
splot_count=((tau-tau_start)/tau_step)+1;
%
plot_r=ceil(sqrt((tau_finish-tau_start)/tau_step+1));
plot_c=ceil((((tau_finish-tau_start)/tau_step+1)/plot_r));
%
disp("tau");
disp(tau)
%
sol=dde23(@ddefunc,lags,@yhist,t);
%
t=sol.x;
y=sol.y;
%
subplot(plot_r,plot_c,splot_count)
%
%plot(t,y(1,:))
xlabel("t")
ylabel("x")
%
%plot(t,y(2,:),"r")
%xlabel("t")
%ylabel("y")
%
%plot(t,y(3,:),"g")
%xlabel("t")
%ylabel("virus partical")
%plot(t,y(1,:),"b",t,y(2,:),"r",t,y(3,:),"g")
title('tau')
plot(t,y(1,:),"b",t,y(2,:),"r")
pause
end

1 Comment
Abhinav Gangwar
on 27 Feb 2022
Hi, did you find the solution to your problem?
I am kind of stuck on a similar one.
Answers (0)
Categories
Find more on Nonlinear Dynamics 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!