clc;
clear all;
d0=1e-8;
Z=[];
r=rand();
for u=linspace(0,4,500)
le=0;
lsum=0;
x=[r;u];
x1=[r+d0;u];
for k=1:800
x=sine_f(x);
x1=sine_f(x1);
d1=sqrt((x(1)-x1(1))^2);
x1=x+(d0/d1)*(x1-x);
if k>100
lsum=lsum+log(d1/d0);
end
end
le=lsum/(k-100);
Z=[Z,u+le*1i];
end
plot(Z,'-')
xlabel('k','fontsize',16,'FontAngle','italic');
ylabel('Lyapunov exponent','fontsize',16,'FontAngle','italic');
grid off;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function newx=sine_f(x);
newx(1,1)=x(2)*x(1)*(1-x(1));
newx(2,1)=x(2);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
X(2):混沌控制参数
x(1):时间序列值