Chua Oszillator in Matlab, Chaos

조회 수: 4 (최근 30일)
Albin Troglauer
Albin Troglauer 2019년 11월 30일
댓글: Amit kumar yadav 2022년 7월 29일
I have written a code to simulate the chua circuit.
the code is:
[t,y] = ode45(@chua_function,[0 150],[1 0 0]);
subplot(2,2,1)
plot3(y(:,1),y(:,2),y(:,3)) %3D Plot
title("Chua's circuit 3D")
xlabel('D^-^1 Region')
ylabel('D^0 Region')
zlabel('D^1 Region')
grid
..
subplot(2,2,4)
plot(y(:,1),y(:,3)) %2D Plot (D-1/D1 Bereich)
title("Chua's circuit 2D")
xlabel('D^-^1 Region')
ylabel('D^1 Region')
grid
function out = chua_function(t,p)
% t = Zeit, p = Position
a = 16; % a und B sind Werte der 3 Differentialgleichungen
B = 30;
m = -1.2; % m und n sind die Steigungen der Chua-Diode
n = -0.7;
x = p(1);
y = p(2);
z = p(3);
g = n*x+0.5*(m-n)*(abs(x+1)-abs(x-1)); %St�ckweise Lineare Gleichung der Diode
xdot = a*(y-x-g);
ydot = x - y+ z;
zdot = -B*y;
% Das sind die Werte, die dargestellt werden
out = [xdot ydot zdot]';
end
In the function out i have the three dimensionsless equations (alpha, beta) for the chua circuit.
But now i want to do the same with the equations with the Parameters R, C1,C2 and L:
[t,y] = ode45(@chua_function,[0 150],[1 0 0]);
subplot(2,2,1)
plot3(y(:,1),y(:,2),y(:,3)) %3D Plot
title("Chua's circuit 3D")
xlabel('D^-^1 Region')
ylabel('D^0 Region')
zlabel('D^1 Region')
grid
..
subplot(2,2,4)
plot(y(:,1),y(:,3)) %2D Plot (D-1/D1 Bereich)
title("Chua's circuit 2D")
xlabel('D^-^1 Region')
ylabel('D^1 Region')
grid
function out = chua_function(t,p)
% t = Zeit, p = Position
C1 = 10*10^(-9); %10nF
C2 = 100*10^(-9); %100nF
R = 1800; %1.8k Ohms
G = 1/R;
L = 18*10^(-3);
m = -1.2; % m und n sind die Steigungen der Chua-Diode
n = -0.7;
x = p(1);
y = p(2);
z = p(3);
g = n*x+0.5*(m-n)*(abs(x+1)-abs(x-1)); %St�ckweise Lineare Gleichung der Diode
xdot = (1/C1)*(G*(y-x)-g);
ydot = (1/C2)*(G*(x-y)+z);
zdot = -(1/L)*y;
% Das sind die Werte, die dargestellt werden
out = [xdot ydot zdot]';
end
But the simulation is false. in the first one, with the dimensionsless parameters alpha and beta the simullation is right, in the second one with the parameters R,C1,C2 and L the simulation is wrong ( just a stright)
anybody know whats wrong?
  댓글 수: 1
Amit kumar yadav
Amit kumar yadav 2022년 7월 29일
>> chua_function
Error: File: chua_function.m Line: 16 Column: 16
Local function name must be different from the script name.
how to resolve this error??

댓글을 달려면 로그인하십시오.

답변 (1개)

David Goodmanson
David Goodmanson 2019년 12월 1일
Hi Albin,
In your second version, the equation for xdot is dimensionally incorrect. Changing it to
xdot = (1/C1)*(G*(y-x-g));
gives a good result. And the time scale in the second version is much different, so the ode45 time limits need to be something like [0 3e-2].

카테고리

Help CenterFile Exchange에서 Electromechanical에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by