Dear bosses, I want to draw the Hopf bifurcation image. Please help me, thank you. There are specific instructions below.

조회 수: 38 (최근 30일)
Dear bosses, in the ordinary differential equations, how to draw a parameter change to cause the value change, that is, Hopf bifurcation problem about ODE. For example, in the figure below, A = 0.5, \mu= 0.2, v = 0.3. \ beta is a variable. Now I want to draw the images of \beta and S and \ beta and R. Please help me. Please give me the MATLAB code. Thank you!
  댓글 수: 4
jianzhong gao
jianzhong gao 2020년 5월 21일
편집: jianzhong gao 2020년 5월 21일
Thank you for your reply. According to your instructions, I modified the code, and the result was wrong. The result of running showed that the index must be a positive integer or a logical value. I think in ode45, the range of abscissa is [0.01, 4], not [0,400]. Is there a problem with the use rules of ode45? Please give me suggestions.Thank you!I look forward to your reply.
%%%a command file %%%
clear
i=1;
for j=0.01:0.02:4
\beta=j;
sol=ode45(@bifupic_eq,[0,400],[0.4 0.5],[],\beta);
p=sol.y(1,:);q=sol.y(2,:);t1=sol.x;
L=length(t1);
for k=L-200:L
x(i)=p(k);y(i)=q(k);t(i)=\beta;
i=i+1;
end
end
figure
plot(t,y,'.');
%plot(t,x,'.');
xlabel('\beta');
ylabel('Density of juvenile prey, x_0(t)');
%%%%%%%%%%%create a function file named bifupic_eq. m.%%%%%%
function dydt=bifupic_eq(t,y,\beta); %%% differential equation
dydt=[0.5-\beta*y(1)*y(2)-0.2*y(1)
\beta*y(1)*y(2)-0.3*y(2)];

댓글을 달려면 로그인하십시오.

답변 (1개)

darova
darova 2020년 5월 21일
What about this solution?
clc,clear
cla
for j = 0:4
beta = j;
F=@(t,y) [0.5-beta*y(1)*y(2)-0.2*y(1)
beta*y(1)*y(2)-0.3*y(2)];
[t,y] = ode45(F,[0 3],[0.4 0.5]);
line(t,y,'color',rand(1,3))
end
xlabel('beta');
ylabel('Density of juvenile prey, x_0(t)');
  댓글 수: 3

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by