function [ A1, A2, A3, m, t0, y0, tstop ] = gyroscope_parameters ( ...
   A1_user, A2_user, A3_user, m_user, t0_user, y0_user, tstop_user )

%*****************************************************************************80
%
%% gyroscope_parameters() returns parameters for gyroscope_ode().
%
%  Discussion:
%
%    If input values are specified, this resets the default parameters.
%    Otherwise, the output will be the current defaults.
%
%    Ordinarily, A1 = A2.
%    In the ordinary gyroscope, A3 is greater than A1 and A2.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 August 2024
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Forest Ray Moulton,
%    "The Damped Gyroscope",
%    Differential Equations,
%    Dover, 1958.
%
%  Input:
%
%    real A1_USER, A2_USER, A3_USER: the moments of inertia about axes 1, 2, 3.
%
%    real M_USER: the magnitude of the exterior force.
%
%    real T0_USER: the initial time, in seconds;
%
%    real Y0_USER(6): the initial values 
%    of psi, theta, phi, omega1, omega2, omega3.
%
%    real TSTOP_USER: the final time.
%
%  Output:
%
%    real A1, A2, A3: the moments of inertia about axes 1, 2, 3.
%
%    real M: the magnitude of the exterior force.
%
%    real T0: the initial time, in seconds;
%
%    real Y0(6): the initial values
%    of psi, theta, phi, omega1, omega2, omega3.
%
%    real TSTOP: the final time.
%
  persistent A1_default;
  persistent A2_default;
  persistent A3_default;
  persistent m_default;
  persistent t0_default;
  persistent y0_default;
  persistent tstop_default;
%
%  Initialize defaults.
%
  if ( isempty ( A1_default ) )
    A1_default = 1.0;
  end

  if ( isempty ( A2_default ) )
    A2_default = A1_default;
  end

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

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

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

  if ( isempty ( y0_default ) )
    y0_default = [ 0.25, 0.4, 0.1, 1.0, 2.0, 3.0 ];
  end

  if ( isempty ( tstop_default ) )
    tstop_default = 5.0;
  end
%
%  Update defaults if input was supplied.
%
  if ( 1 <= nargin )
    A1_default = A1_user;
  end

  if ( 2 <= nargin )
    A2_default = A2_user;
  end

  if ( 3 <= nargin )
    A3_default = A3_user;
  end

  if ( 4 <= nargin )
    m_default = m_user;
  end

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

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

  if ( 7 <= nargin )
    tstop_default = tstop_user;
  end
%
%  Return values.
%
  A1 = A1_default;
  A2 = A2_default;
  A3 = A3_default;
  m = m_default;
  t0 = t0_default;
  y0 = y0_default;
  tstop = tstop_default;
  
  return
end

