混沌系统分岔图程序一直有错,请大神帮忙看一下
matlab吧
全部回复
仅看楼主
level 2
恐芳樽浅 楼主
一楼忏悔,我真的不想做伸手党。。。
2014年04月21日 13点04分 1
level 2
恐芳樽浅 楼主
主程序
clc
b=3;c=12;d=7;e=-0.6;f=-1;
A=[1:0.01:37];
ym=[];
for counter=1:length(A)
a=A(counter)
tspan=1:0.1:500;
var=3;
y0=[1;1;1;1;1];
[t,y]=ode45('chenxt',tspan,y0,[],a,b,c,d,e,f);
j=1;
for i=3000:size(y,1)-1
if y(i-1,var)<y(i,var)&&y(i+1,var)<=y(i,var)
ym(counter,j)=y(i,var);
j=j+1;
end
end
end
plot(t,y)
调用子程序:
function fc=chenxt(t,y)
global a b c d e f
fc=[a*(y(2)-y(1))+y(4);d*y(1)-y(1)*y(3)+c*y(2);y(1)*y(2)-b*y(3)+y(5);y(2)*y(3)-e*y(4);y(3)*y(4)+f*y(5)];
2014年04月21日 13点04分 2
level 2
恐芳樽浅 楼主
主函数中最后一句改为plot(A,ym)
2014年04月21日 13点04分 3
1