function [ a, b, sc, t0, xyz0, tstop ] = bioconvection_parameters ( ...
  a_user, b_user, sc_user, t0_user, xyz0_user, tstop_user )

%*****************************************************************************80
%
%% bioconvection_parameters() returns parameters for bioconvection_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:
%
%    18 January 2024
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real a_user, b_user, sc_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, sc: 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 sc_default;
  persistent t0_default;
  persistent xyz0_default;
  persistent tstop_default;
%
%  Initialize defaults.
%  These values suggested from table 3 in the paper.
%
  if ( isempty ( a_default ) )
    a_default = 49.6;
  end

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

  if ( isempty ( sc_default ) )
    sc_default = 5.0;
  end

  if ( isempty ( t0_default ) )
    t0_default = 0.0;
  end
%
%  Increasing m seems to make for interesting solutions.
%
  if ( isempty ( xyz0_default ) )
    m = 1.0;
    m = 100.0;
    xyz0_default = [ 0.0, m, 0.0 ];
  end

  if ( isempty ( tstop_default ) )
    tstop_default = 1000.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 )
    sc_default = sc_user;
  end

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

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

  if ( 6 <= nargin )
    tstop_default = tstop_user;
  end
%
%  The returned values are the defaults, or overridden by user input.
%
  a = a_default;
  b = b_default;
  sc = sc_default;
  t0 = t0_default;
  xyz0 = xyz0_default;
  tstop = tstop_default;
  
  return
end

