Chua Oszillator in Matlab, Chaos
22 views (last 30 days)
Show older comments
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 Comment
Amit kumar yadav
on 29 Jul 2022
>> 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??
Answers (1)
David Goodmanson
on 1 Dec 2019
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].
0 Comments
See Also
Categories
Find more on Sensors and Transducers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!