logistic01.m

来自「非线性动力学中lyapunov、duffing等方程的求解」· M 代码 · 共 46 行

M
46
字号
clear all
pack

%this program is to verify the periodic doubling bifurcation by Logistic map

x0=0.9;

%p=2.5;
k3=0;

%If you want to obtain more precise bifurcation figure, you could make the step-length more small, eventually 0.001, 
% or make the more sample points, that is to say, more big N1.

for p=2.5:0.01:3.9
    

k3=k3+1;

pp(k3)=p;


N=2000;

for k1=1:N
    x1=p*x0*(1-x0);
    x0=x1;
end

N1=50;

for k2=1:N1
    x1=p*x0*(1-x0);
    xx(k3,k2)=x1;
    x0=x1;
end
end

N2=length(pp);

figure
hold on
for k4=1:N2
    plot(pp,xx(:,k4),'b.')
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?