function [ a, c1, c2, d1, d2, k, r1, t0, y0, tstop ] = grazing_parameters ...
  ( a_user, c1_user, c2_user, d1_user, d2_user, k_user, r1_user, ...
  t0_user, y0_user, tstop_user )

%*****************************************************************************80
%
%% grazing_parameters() returns parameters for grazing_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 April 2021
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Michael Thompson, Bruce Stewart,
%    Nonlinear Dynamics and Chaos,
%    Second Edition,
%    Wiley, 2002,
%    ISBN: 0-471-87645-3,
%    LC: QA871.T47.
%
%  Input:
%
%    real A_USER, the rate at which herbivores decline when the plant
%    density is low;
%
%    real C1_USER, the maximum rate of food intake per herbivore,
%
%    real C2_USER, the rate at which herbivore decline is ameliorated
%    in cases of high plant density;
%
%    real D1_USER, the grazing efficiency of the herbivore when 
%    the plant density is low;
%
%    real D2_USER, the demographic efficiency of the plant, the ability
%    to regrow from a sparse state;
%
%    real K_USER, the maximum ungrazed plant density;
%
%    real R1_USER: the intrinsic rate of increase of the plants;
%
%    real T0_USER: the initial time.
%
%    real Y0_USER(2): the initial condition.
%
%    real TSTOP_USER: the final time.
%
%  Output:
%
%    real A, the rate at which herbivores decline when the plant
%    density is low;
%
%    real C1, the maximum rate of food intake per herbivore,
%
%    real C2, the rate at which herbivore decline is ameliorated
%    in cases of high plant density;
%
%    real D1, the grazing efficiency of the herbivore when 
%    the plant density is low;
%
%    real D2, the demographic efficiency of the plant, the ability
%    to regrow from a sparse state;
%
%    real K, the maximum ungrazed plant density;
%
%    real R1: the intrinsic rate of increase of the plants;
%
%    real T0: the initial time.
%
%    real Y0(2): the initial condition.
%
%    real TSTOP: the final time.
%
  persistent a_default;
  persistent c1_default;
  persistent c2_default;
  persistent d1_default;
  persistent d2_default;
  persistent k_default;
  persistent r1_default;
  persistent t0_default;
  persistent y0_default;
  persistent tstop_default;
%
%  Initialize defaults.
%
  if ( isempty ( a_default ) )
    a_default = 1.1;
  end

  if ( isempty ( c1_default ) )
    c1_default = 1.2;
  end

  if ( isempty ( c2_default ) )
    c2_default = 1.5;
  end

  if ( isempty ( d1_default ) )
    d1_default = 0.001;
  end

  if ( isempty ( d2_default ) )
    d2_default = 0.001;
  end

  if ( isempty ( k_default ) )
    k_default = 3000.0;
  end

  if ( isempty ( r1_default ) )
    r1_default = 0.8;
  end

  if ( isempty ( t0_default ) )
    t0_default = 0.0;
  end

  if ( isempty ( y0_default ) )
    y0_default = [ 3000.0, 5.0 ];
  end

  if ( isempty ( tstop_default ) )
    tstop_default = 100.0;
  end
%
%  Update defaults if input was supplied.
%
  if ( 1 <= nargin )
    a_default = a_user;
  end

  if ( 2 <= nargin )
    c1_default = c1_user;
  end

  if ( 3 <= nargin )
    c2_default = c2_user;
  end

  if ( 4 <= nargin )
    d1_default = d1_user;
  end

  if ( 5 <= nargin )
    d2_default = d2_user;
  end

  if ( 6 <= nargin )
    k_default = k_user;
  end

  if ( 7 <= nargin )
    r1_default = r1_user;
  end

  if ( 8 <= nargin )
    t0_default = t0_user;
  end

  if ( 9 <= nargin )
    y0_default = y0_user;
  end

  if ( 10 <= nargin )
    tstop_default = tstop_user;
  end
%
%  Return values.
%
  a = a_default;
  c1 = c1_default;
  c2 = c2_default;
  d1 = d1_default;
  d2 = d2_default;
  k = k_default;
  r1 = r1_default;
  t0 = t0_default;
  y0 = y0_default;
  tstop = tstop_default;
  
  return
end

