|
楼主 |
发表于 2009-3-22 01:48
|
显示全部楼层
最大值法和Poincare法画的分岔图为何不对呢
Poincare法程序:
function hr_fc_poincaremethod
Z=[];
a=1;b=3;c=1;d=5;r=0.006;s=4;xo=-1.6;k=3;xxmax=1.2;
for xmin=linspace(-1.2,-0.5,20);
% 舍弃前面迭带的结果,用后面的结果画图
[T,Y]=ode45('hrfunyasuo',[0,1],[0.2,0.5,0.4],[],a,b,c,d,r,s,xo,k,xxmax,xmin);
length(Y)
[T,Y]=ode45('hrfunyasuo',[0,100],Y(length(Y),:),[],a,b,c,d,r,s,xo,k,xxmax,xmin);
Y(:,1)=Y(:,2)-Y(:,1);
% 对计算结果进行判断,如果点满足x=y,则取点
for k=2:length(Y)
f=k-1;
if Y(k,1)<0
if Y(f,1)>0
y=Y(k,2)-Y(k,1)*(Y(f,2)-Y(k,2))/(Y(f,1)-Y(k,1));
Z=[Z r+abs(y)*i];
end
else
if Y(f,1)<0
y=Y(k,2)-Y(k,1)*(Y(f,2)-Y(k,2))/(Y(f,1)-Y(k,1));
Z=[Z r+abs(y)*i];
end
end
end
end
plot(Z,'.','markersize',1)
title('hr映射分岔图')
xlabel('xmin'),ylabel('|y| where x=y')
两个程序都能通,但是结果很奇怪!望高人指点、指正。谢谢! |
|