function derivs = derivsms(x, par, dim)

% Moore-Spiegal

% Moore, D.W. and E. A. Spiegel, 1966, A thermally excited nonlinear
% oscillator, Journal of Astrophysics, 143, 3, 871-887.

% System equations:
% \dot{x}(1) =  x(2)
% \dot{x}(2) =  x(3)
% \dot{x}(3) = -x(3)-(a-b+b*x(1)*x(1))*x(2)-a*x(1);

derivs(1) =  x(2);
derivs(2) =  x(3);
derivs(3) = -x(3)-(par(1)-par(2)+par(2)*x(1)*x(1))*x(2)-par(1)*x(1);
