function [ dUdt, dVdt ] = spiral_deriv ( t, U, V, dx, dy )

%*****************************************************************************80
%
%% spiral_deriv(): right hand side of spiral reaction-diffusion PDE.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 February 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real T: the current time.
%
%    real U(NX,NY), V(NX,NY): the current solution.
%
%    real DX, DY: the X and Y spacings.
%
%  Output:
%
%    real DUDT, DVDT(NX,NY), the right hand sides of the ODE at each node.
%
%
%  Get parameters:
%
  [ alpha, beta, delta, epsilon ] = spiral_parameters ( );
%
%  Compute the laplacians of U and V using a 9 point stencil.
%
  del2U = laplacian9_torus ( U, dx, dy );
  del2V = laplacian9_torus ( V, dx, dy );
%
%  Take an explicit Euler time step for U and V.
%
  dUdt = del2U + ( 1.0 / epsilon ) * ...
    U .* ( 1.0 - U ) .* ( U - ( V + beta ) / alpha );
  dVdt = delta * del2V + U - V;

  return
end

