function [ kappa, lambda, t0, xyz0, tstop ] = rucklidge_parameters ( ...
  kappa_user, lambda_user, t0_user, xyz0_user, tstop_user )

%*****************************************************************************80
%
%% rucklidge_parameters() returns parameters for rucklidge_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 kappa_USER, lambda_USER: problem parameters.
%
%    real T0_USER: the initial time.
%
%    real xyz0_USER(3): the initial condition.
%
%    real TSTOP_USER: the final time.
%
%  Output:
%
%    real kappa, lambda: problem parameters.
%
%    real T0: the initial time.
%
%    real xyz0(3): the initial condition.
%
%    real TSTOP: the final time.
%
  persistent kappa_default;
  persistent lambda_default;
  persistent t0_default;
  persistent xyz0_default;
  persistent tstop_default;
%
%  Initialize defaults.
%
  if ( isempty ( kappa_default ) )
    kappa_default = - 2.0;
  end

  if ( isempty ( lambda_default ) )
    lambda_default = - 6.7;
  end

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

  if ( isempty ( xyz0_default ) )
    xyz0_default = [ 1.0; 0.0; 4.5 ];
  end

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

  if ( 2 <= nargin )
    lambda_default = lambda_user;
  end

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

  if ( 4 <= nargin )
    xyz0_default = xyz0_user;
  end

  if ( 5 <= nargin )
    tstop_default = tstop_user;
  end
%
%  Return values.
%
  kappa = kappa_default;
  lambda = lambda_default;
  t0 = t0_default;
  xyz0 = xyz0_default;
  tstop = tstop_default;
  
  return
end

