function [ k, n, xy0 ] = chirikov_parameters ( k_user, n_user, xy0_user )

%*****************************************************************************80
%
%% chirikov_parameters() returns parameters for the chirikov difference equation.
%
%  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 K_USER: problem parameters.
%
%    integer N_USER: the number of iterations to take.
%
%    real XY0_USER(2): the initial condition.
%
%  Output:
%
%    real K: problem parameters.
%
%    integer N: the number of iterations to take.
%
%    real XY0(2): the initial condition.
%
  persistent k_default;
  persistent n_default;
  persistent xy0_default;
%
%  Initialize defaults.
%
  if ( isempty ( k_default ) )
%   k_default = ( 1.0 + sqrt ( 5.0 ) ) / 2.0;
    k_default = 0.55;
  end

  if ( isempty ( n_default ) )
    n_default = 100;
  end

  if ( isempty ( xy0_default ) )
    xy0_default = [ 0.6; 0.7 ];
  end
%
%  Update defaults if input was supplied.
%
  if ( 1 <= nargin )
    k_default = k_user;
  end

  if ( 2 <= nargin )
    n_default = n_user;
  end

  if ( 3 <= nargin )
    xy0_default = xy0_user;
  end
%
%  Return values.
%
  k = k_default;
  n = n_default;
  xy0 = xy0_default;
  
  return
end

