代码如下:
clear;clc;
[T,Y] = ode45(@Chua,[0 500],[0.1;0.1;0.1]);
hold on
plot3(Y(:,3),Y(:,1),Y(:,2),'b','LineWidth',0.5);
view(-30,40);
xlabel('z(t)','FontName','Times New Roman','FontSize',15);
ylabel('x(t)','FontName','Times New Roman','FontSize',15);
zlabel('y(t)','FontName','Times New Roman','FontSize',15);
hold off
function dy = Chua(~,y)
p = 10;
q = 14.87;
m0 = -0.68;
m1 = -1.27;
dy = zeros(3,1);
dy(1) = p*(-y(1)+y(2)-(m0*y(1)+0.5*(m1-m0)*(abs(y(1)+1)-abs(y(1)-1))));
dy(2) = y(1)-y(2)+y(3);
dy(3) = -q*y(2);
end
|