function dx = hr( t,x,params )
%Hindmarsch-Rose egyenlet megoldó:
if length(params) == 0
    params = [2.96 2.99 0.01 4];
end

a = params(1);
I = params(2);
mu = params(3);
s = params(4);
xr=-1.6;
b=5;

dx = zeros(3,1);

dx(1) = x(2) - x(1)^3 + a*x(1)^2 + I - x(3); %dx/dt=y-x^3+a*x^2+I-z
dx(2) = 1 - b*x(1)^2 - x(2); %dy/dt=1-b*x^2-y
dx(3) = mu*(s*(x(1) -xr) - x(3)); %mu*[s*(x-xr)-z]
%mu = 0.002;
%dx(3) = mu*(s*(x(1)+1.4)-x(3)-0.0083/((x(3)-0.9)^2+0.03));

end

