function [ a, b, c, t0, xyz0, tstop ] = chen_parameters ( ...
  a_user, b_user, c_user, t0_user, xyz0_user, tstop_user )

%*****************************************************************************80
%
%% chen_parameters() returns parameters for chen_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:
%
%    14 September 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real a_USER, b_USER, c_USER: problem parameters.
%
%    real T0_USER: the initial time.
%
%    real xyz0_USER(3): the initial condition.
%
%    real TSTOP_USER: the final time.
%
%  Output:
%
%    real a, b, c: problem parameters.
%
%    real T0: the initial time.
%
%    real xyz0(3): the initial condition.
%
%    real TSTOP: the final time.
%
  persistent a_default;
  persistent b_default;
  persistent c_default;
  persistent t0_default;
  persistent xyz0_default;
  persistent tstop_default;
%
%  Initialize defaults.
%
  if ( isempty ( a_default ) )
    a_default = 40.0;
  end

  if ( isempty ( b_default ) )
    b_default = 3.0;
  end

  if ( isempty ( c_default ) )
    c_default = 28.0;
  end

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

  if ( isempty ( xyz0_default ) )
    xyz0_default = [ -0.1; 0.5; -0.6 ];
  end

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

  if ( 2 <= nargin )
    b_default = b_user;
  end

  if ( 3 <= nargin )
    c_default = c_user;
  end

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

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

  if ( 6 <= nargin )
    tstop_default = tstop_user;
  end
%
%  Return values.
%
  a = a_default;
  b = b_default;
  c = c_default;
  t0 = t0_default;
  xyz0 = xyz0_default;
  tstop = tstop_default;
  
  return
end

