后面附上代码:
clc
clear
close all
%% 洛伦兹吸引子
h=1e-3;
x0=0:h:40;
[y1,~]=ODE_RK4_hyh(x0,h,[1;4;20],{'Lorenz',[...y1(2,:);Lz=y1(3,:);
figure(4)
subplot(2,2,1)
plot3(Lx,Ly,Lz);view([51,30]);title('c=4 周期1')
[y1,~]=ODE_RK4...2,:);Lz=y1(3,:);
figure(4)
subplot(2,2,3)
plot3(Lx,Ly,Lz);view([51,30]);title('c=8.5 周期4')
[y1,~]=ODE_RK4...',[1.15,1,1]});
Lx=y1(1,:);Ly=y1(2,:);
figure(6)
subplot(1,3,1)
plot(Lx,Ly);title('d=1.15')
[y1,~]=ODE_RK4...',[1.35,1,1]});
Lx=y1(1,:);Ly=y1(2,:);
figure(6)
subplot(1,3,2)
plot(Lx,Ly);title('d=1.35')
[y1,~]=ODE_RK4