function dydt = zombie_deriv ( t, y )

%*****************************************************************************80
%
%% zombie_deriv() returns the right hand side of zombie_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 November 2020
%
%  Reference:
%
%    Philip Munz, Ioan Hudea, Joe Imad, Robert Smith,
%    When Zombies Attack!: Mathematical Modelling of an Outbreak
%    of Zombie Infection,
%    Infection Disease Modelling Progress, 
%    Editors: J M Tchuenche, C Chiyaka,
%    Nova Science Publishers, 2009.
%
%  Input:
%
%    real t: the current time.
%
%    real y(3): the current solution.
%
%  Output:
%
%    real dydt(3): the right hand side of the zombie ODE.
%
  [ alpha, beta, gamma, delta, t0, y0, tstop ] = zombie_parameters ( );

  s = y(1);
  z = y(2);
  r = y(3);

  dsdt = - beta * s * z                             - delta * s; 
  dzdt =   beta * s * z - alpha * s * z + gamma * r;
  drdt =                  alpha * s * z - gamma * r + delta * s;

  dydt = [ dsdt; dzdt; drdt ];

  return
end
