function [ r, k, t0, y0, tstop ] = logistic_parameters ( r_user, k_user, ...
  t0_user, y0_user, tstop_user )

%*****************************************************************************80
%
%% logistic_parameters() returns parameters for logistic_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:
%
%    02 August 2022
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real r_user: the rate of increase.
%
%    real k_user: the carrying capacity.
%
%    real t0_user: the initial time.
%
%    real y0_user: the initial condition.
%
%    real tstop_user: the final time.
%
%  Output:
%
%    real r: the rate of increase.
%
%    real k: the carrying capacity.
%
%    real t0: the initial time.
%
%    real y0: the initial condition.
%
%    real tstop: the final time.
%
  persistent r_default;
  persistent k_default;
  persistent t0_default;
  persistent y0_default;
  persistent tstop_default;
%
%  Initialize defaults.
%
  if ( isempty ( r_default ) )
    r_default = 1.0;
  end

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

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

  if ( isempty ( y0_default ) )
    y0_default = 0.5;
  end

  if ( isempty ( tstop_default ) )
    tstop_default = 8.0;
  end
%
%  Update defaults if input was supplied.
%
  if ( 1 <= nargin )
    r_default = r_user;
  end

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

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

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

  if ( 5 <= nargin )
    tstop_default = tstop_user;
  end
%
%  Return values.
%
  r = r_default;
  k = k_default;
  t0 = t0_default;
  y0 = y0_default;
  tstop = tstop_default;
  
  return
end

