function [ mu1, mu2, t0, y0, tstop ] = arenstorf_parameters ( ...
  mu1_user, mu2_user, t0_user, y0_user, tstop_user )

%*****************************************************************************80
%
%% arenstorf_parameters() returns parameters for arenstorf_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:
%
%    22 April 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real MU1_USER, MU2_USER: the relative masses of the moon and the earth.
%
%    real T0_USER: the initial time.
%
%    real Y0_USER(4): the initial condition.
%
%    real TSTOP_USER: the final time.
%
%  Output:
%
%    real MU1, MU2: the relative masses of the moon and the earth.
%
%    real T0: the initial time.
%
%    real Y0(4): the initial condition.
%
%    real TSTOP: the final time.
%
  persistent mu1_default;
  persistent mu2_default;
  persistent t0_default;
  persistent y0_default;
  persistent tstop_default;
%
%  Initialize defaults.
%
  if ( isempty ( mu1_default ) )
    mu1_default = 0.012277471;           
  end

  if ( isempty ( mu2_default ) )
    mu2_default = 0.987722529;
  end

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

  if ( isempty ( y0_default ) )
    y0_default = [ 0.994, 0.0, 0.0, -2.00158510637908252240537862224 ];
  end

  if ( isempty ( tstop_default ) )
    tstop_default = 17.0652165601579625588917206249;
  end
%
%  Update defaults if input was supplied.
%
  if ( 1 <= nargin )
    mu1_default = mu1_user;
  end

  if ( 2 <= nargin )
    mu2_default = mu2_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.
%
  mu1 = mu1_default;
  mu2 = mu2_default;
  t0 = t0_default;
  y0 = y0_default;
  tstop = tstop_default;

  return
end

