function dydt = brusselator_deriv ( t, y )

%*****************************************************************************80
%
%% brusselator_deriv() defines brusselator_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 April 2021
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    John D Cook,
%    Behold! The Brusselator!,
%    https://www.johndcook.com/blog/
%    Posted 07 February 2020.
%
%    Rene Lefever, Gregoire Nicholis,
%    Chemical instabilities and sustained oscillations,
%    Journal of Theoretical Biology,
%    Volume 30, Issue 2, February 1971, Pages 267-284.
%
%  Input:
%
%    real T, the current time.
%
%    real Y(2), the current solution.
%
%  Output:
%
%    real DYDT(2), the right hand side of the ODE's.
%
  [ a, b, t0, y0, tstop ] = brusselator_parameters ( );

  u = y(1);
  v = y(2);

  dudt = a + u.^2 * v - ( b + 1.0 ) * u;
  dvdt = b * u - u.^2 * v;

  dydt = [ dudt; dvdt ];

  return
end
 
