function [ alpha, beta, t0, wxyz0, tstop ] = autocatalytic_parameters ( ...
  alpha_user, beta_user, t0_user, wxyz0_user, tstop_user )

%*****************************************************************************80
%
%% autocatalytic_parameters() returns parameters for autocatalytic_ode().
%
%  Discussion:
%
%    If input values are specified, this resets the default parameters.
%    Otherwise, the output will be the current defaults.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 September 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real alpha_user, beta_user: problem parameters.
%
%    real t0_user: the initial time.
%
%    real wxyz0_user(4): the initial condition.
%
%    real tstop_user: the final time.
%
%  Output:
%
%    real alpha, beta: problem parameters.
%
%    real t0: the initial time.
%
%    real wxyz0(4): the initial condition.
%
%    real tstop: the final time.
%
  persistent alpha_default;
  persistent beta_default;
  persistent t0_default;
  persistent wxyz0_default;
  persistent tstop_default;
%
%  Initialize defaults.
%
  if ( isempty ( alpha_default ) )
    alpha_default = 0.002;
  end

  if ( isempty ( beta_default ) )
    beta_default = 0.08;
  end

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

  if ( isempty ( wxyz0_default ) )
    wxyz0_default = [ 500.0; 0.0; 0.0; 0.0 ];
  end

  if ( isempty ( tstop_default ) )
    tstop_default = 1000.0;
  end
%
%  Update defaults if input was supplied.
%
  if ( 1 <= nargin )
    alpha_default = alpha_user;
  end

  if ( 2 <= nargin )
    beta_default = beta_user;
  end

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

  if ( 4 <= nargin )
    wxyz0_default = wxyz0_user;
  end

  if ( 5 <= nargin )
    tstop_default = tstop_user;
  end
%
%  Return values.
%
  alpha = alpha_default;
  beta = beta_default;
  t0 = t0_default;
  wxyz0 = wxyz0_default;
  tstop = tstop_default;
  
  return
end

