Use Ode 45 in Chua's system with non linear function need to be solved but I don't know how iterate the non linear function in loop?
5 次查看(过去 30 天)
显示 更早的评论
[t,x] = ode45(@chua_function,[0 150],[0.1 0.1 0]);
plot3(x(:,1),x(:,2),x(:,3),'r')
title(" Chua's circuit")
xlabel('x')
ylabel('y')
zlabel('zr')
grid
function out = chua_function(~,p)
a = 9;
B = 14.28;
m0 = 0.128;
m1= -0.42;
m2= 2;
m3= - 0.38;
m4= 0.57;
m5= -0.342;
e1 = 1;
e2 = 2.15;
e3 = 3.6;
e4 = 6.2;
e5 = 9;
x = p(1);
y = p(2);
z = p(3);
g = (m5)*x+0.5*((m0 - m1)*(abs(x+e1)-abs(x-e1))) +(0.5)*((m1- m2)*(abs(x+e2)-abs(x-e2)))
+(0.5)*((m2 - m3)*(abs(x+e3)-abs(x-e3)))+(0.5)*((m3 - m4)*(abs(x+e4)-abs(x-e4)))
+(0.5)*((m4 - m5)*(abs(x+e5)-abs(x-e5)));
%g = (m5)*x+0.5*((m0 - m1)*(abs(x+e1)-abs(x-e1)))
xdot = a*(y-g);
ydot = x - y+ z;
zdot = -B*y;
out = [xdot ydot zdot]';
end
0 个评论
采纳的回答
Torsten
2022-12-5
[t,x] = ode45(@chua_function,[0 150],[0.1 0.1 0]);
plot3(x(:,1),x(:,2),x(:,3),'r')
title(" Chua's circuit")
xlabel('x')
ylabel('y')
zlabel('zr')
grid
function xdot = chua_function(~,x)
eta = 9;
zeta = -14.28;
m = [0.9,-3,3.5,-2.7,4,-2.4]/7;
E = [1,2.15,3.6,6.2,9];
phix1 = m(end)*x(1) + 0.5*sum((m(1:end-1)-m(2:end)).*(abs(x(1)+E(1:end))-abs(x(1)-E(1:end))));
xdot = zeros(3,1);
xdot(1) = eta*(x(2)-phix1);
xdot(2) = x(1) - x(2) + x(3);
xdot(3) = zeta*x(2);
end
6 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!