function dwxyzdt = autocatalytic_deriv ( t, wxyz )

%*****************************************************************************80
%
%% autocatalytic_deriv() evaluates the right hand side of autocatalytic_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 September 2021
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Peter Gray, Stephen Scott,
%    Chemical oscillations and instabilities,
%    Interational Series of Monographs on Chemistry,
%    Volume 21, Oxford University Press, 1990.
%
%    Stephen Lucas, Evelyn Sander, Laura Taalman,
%    Modeling dynamical systems for 3D printing,
%    Notices of the American Mathematical Society,
%    Volume 67, Number 11, December 2020, pages 1692-1705.
%
%  Input:
%
%    real t: the value of the independent variable.
%
%    real wxyz: the values of the dependent variables at time T.
%
%  Output:
%
%    real dwxyzdt: the right hand side of the ODE.
%
  [ alpha, beta, t0, wxyz0, tstop ] = autocatalytic_parameters ( );

  w = wxyz(1)
  x = wxyz(2);
  y = wxyz(3);
  z = wxyz(4);

  dwdt = - alpha * w;
  dxdt =   alpha * w - beta * x - x * y^2;
  dydt =               beta * x + x * y^2 - y;
  dzdt =                                    y;

  dwxyzdt = [ dwdt; dxdt; dydt; dzdt ];

  return
end

