今天畫個蝶,一個Lorenz彩蝶|混沌系統(tǒng)的初始參數(shù)敏感性


clc
close all
clear
syms x(t)
fun = @(t, x)[-10*x(1)+10*x(2); 28*x(1)-x(2)-x(1)*x(3); x(1)*x(2)-8/3*x(3)];
tspan = [0 20];
[t1, x1] = ode45(fun, tspan, [10, -10, -10]);
plot3(x1(:, 1), x1(:, 2), x1(:, 3), 'LineWidth', 1.5);
hold on;
[t2, x2] = ode45(fun, tspan, [10.001, -10, -10]);
plot3(x2(:, 1), x2(:, 2), x2(:, 3), 'LineWidth', 1.5);
[t3, x3] = ode45(fun, tspan, [10.002, -10, -10]);
plot3(x3(:, 1), x3(:, 2), x3(:, 3), 'LineWidth', 1.5);
legend('\sigma = 10', '\sigma = 10.001', '\sigma = 10.002')
grid on;
hold off;
caz = -60;
cel = 0;
view(caz, cel);
xlim([-30, 30]);
ylim([-30, 40]);
zlim([-20, 60]);
for n = 1:70
??caz = caz + 1;
??view(caz,cel);
??drawnow
end
plot(t1, x1(:, 1), t2, x2(:, 1), t3, x3(:, 1))
legend('x11', 'x21', 'x31')
標簽: