function dy=Chua(t,y)
% Chua's autonomous circuit
%              
%   dx/dt = alpha*(-x+y-H(x))
%   dy/dt = x-y+z
%   dz/dt = -beta*y
%           
% where H(x) = bx+0.5*(a-b)*(|x+1|-|x-1|)
% with alpha arbitrary, beta = 15, a = -1.3, b = -0.7
% y0=[1 0.2 0];

% Parameters
alpha=10;
beta=15;
a=-1.3;
b=-0.7;
dy=zeros(3,1);

% Nonlinearity
H=b*y(1)+0.5*(a-b)*(abs(y(1)+1)-abs(y(1)-1));

% System
dy(1)=-alpha*y(1)+alpha*y(2)-alpha*H;
dy(2)=y(1)-y(2)+y(3);
dy(3)=-beta*y(2);      
   

% "Complex and Chaotic Nonlinear Dynamics. 
% Advances in Economics and Finance, 
% Mathematics and Statistics" 
% T.Vialar, Springer 2009
% Copyright(c).