function zombie_euler ( n )

%*****************************************************************************80
%
%% zombie_euler() uses euler() to solve zombie_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    24 April 2021
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'zombie_euler:\n' );
  fprintf ( 1, '  Use euler() to solve zombie_ode().\n' );

  [ alpha, beta, gamma, delta, t0, y0, tstop ] = zombie_parameters ( );

  f = @ zombie_deriv;
  tspan = [ t0, tstop ];

  [ t, y ] = euler ( f, tspan, y0, n );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of equal steps = %d\n', n );
%
%  Plot the solution.
%
  clf ( );
  plot ( t, y, 'LineWidth', 2 );
  xlabel ( '<--- Time --->' );
  ylabel ( '<--- Population --->' );
  title ( 'zombie\_ode(): euler(): plot' );
  grid ( 'on' )
  legend ( 'Humans', 'Zombies', 'Suspended Zombies' )
  filename = 'zombie_euler_plot.png';
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved as "%s".\n', filename );
%
%  Plot the conserved quantity.
%
  h = zombie_conserved ( y );

  clf ( );
  hold ( 'on' );
    plot ( t, h, 'r-', 'LineWidth', 2 );
    plot ( [t(1), t(end)], [h(1), h(1)], 'b--', 'linewidth', 2 )
    plot ( [t(1), t(end)], [0.0, 0.0], 'k--', 'linewidth', 2 );
  hold ( 'off' );
  xlabel ( '<--- Time --->' );
  ylabel ( '<--- Total population --->' );
  title ( 'zombie\_ode(): euler(): population conservation' );
  grid ( 'on' )
  filename = 'zombie_euler_conservation.png';
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved as "%s".\n', filename );

  return
end
