找的一个 试试吧
function bBifurcation(T0,T1,Tmid,T,x0,y0,z0,a,c,b0,b1,n)
% for the Rossler attractor with varying b
%requirement: bBifurcation(0,600,200,30,1,1,1,0.2,5.7,0.2,2,0.05)
% initial conditions% [T0,T1] time interva
l% (a,b,c) parameters of Rossler system
% [x0;y0;z0] initial starting point
% Tmid∈[T0,T1]
% ===================================================================
% Bifurcation
%===================================================================
function Runingode45(T0,T1,Tmid,T,x0,y0,z0,a,b,c)
% ===================================================================
% Rossler system
% ===================================================================
function dy = Rossler(t,y)
dy(1,1) = - y(2) - y(3); %dx/dt
dy(2,1) = y(1) + a * y(2); %dy/dt
dy(3,1) = b + y(3) * (y(1) - c); %dz/dt
end
% ===================================================================
% Calculate maximum of x(t) over T
% ===================================================================
% ===================================================================
% Step 1
% ===================================================================
if Tmid > 0[t y] = ode45(@Rossler,[T0 T1],[x0;y0;z0]);
end
% ===================================================================
% Step 2
% ===================================================================
maxnew=[];
while Tmid + T < T1
[t y] = ode45(@Rossler,[Tmid Tmid+T],y(end,:));
for i = 2:length(y)-1 if y(i,1) > y(i-1,1) & y(i,1) > y(i+1,1)
max = y(i,1); end end Tmid = Tmid + T;
max;
maxnew = [maxnew;max];
end
% ===================================================================
% Plot
% ================================ |