Lorenz system的数学表示形式如下:
分别取和 以及初值(5,5,5)进行迭代
1、
clear,clc
tspn = [0 1e2];
y0 = [5,5,5];
[t,x]=ode45(@myODE,tspn,y0);
plot3(x(:,1),x(:,2),x(:,3))
function dydt = myODE(t,y)
a = 10;b=8/3;r=13;
dxdt = a*(y(2)-y(1));
dydt = r*y(1)-y(2)-y(1)*y(3);
dzdt = -b*y(3)+y(1)*y(2);
dydt=[dxdt;dydt;dzdt];
end
结果
2、
clear,clc
tspn = [0 1e2];
y0 = [5,5,5];
[t1,x1]=ode45(@myODE1,tspn,y0);
plot3(x1(:,1),x1(:,2),x1(:,3))
function dydt = myODE1(t,y)
a = 10;b=8/3;r=14;
dxdt = a*(y(2)-y(1));
dydt = r*y(1)-y(2)-y(1)*y(3);
dzdt = -b*y(3)+y(1)*y(2);
dydt=[dxdt;dydt;dzdt];
end
结果