function [ a, b, kc, kn, rmax, e, t0, y0, tstop ] = ...
  biochemical_nonlinear_parameters ( a_user, b_user, kc_user, kn_user, ...
  rmax_user, e_user, t0_user, y0_user, tstop_user )

%*****************************************************************************80
%
%% biochemical_nonlinear_parameters(): parameters for biochemical_nonlinear_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:
%
%    23 April 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A_USER, B_USER: parameters;
%
%    real KC_USER, KN_USER: parameters
%
%    real RMAX_USER: a parameter.
%
%    real E_USER: a parameter.
%
%    real T0_USER: the initial time.
%
%    real Y0_USER(4): the initial condition.
%
%    real TSTOP_USER: the final time.
%
%  Output:
%
%    real A, B: parameters;
%
%    real KC, KN: parameters
%
%    real RMAX: a parameter.
%
%    real E: a parameter.
%
%    real T0: the initial time.
%
%    real Y0(4): the initial condition.
%
%    real TSTOP: the final time.
%
  persistent a_default;
  persistent b_default;
  persistent kc_default;
  persistent kn_default;
  persistent rmax_default;
  persistent e_default;
  persistent t0_default;
  persistent y0_default;
  persistent tstop_default;
%
%  Initialize defaults.
%
  if ( isempty ( a_default ) )
    a_default = 1.0;
  end

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

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

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

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

  if ( isempty ( e_default ) )
    e_default = 0.3;
  end

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

  if ( isempty ( y0_default ) )
    y0_default = [ 29.98, 9.98, 0.01, 0.01 ];
  end

  if ( isempty ( tstop_default ) )
    tstop_default = 13.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 )
    kc_default = kc_user;
  end

  if ( 4 <= nargin )
    kn_default = kn_user;
  end

  if ( 5 <= nargin )
    rmax_default = rmax_user;
  end

  if ( 6 <= nargin )
    e_default = e_user;
  end

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

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

  if ( 9 <= nargin )
    tstop_default = tstop_user;
  end
%
%  Return values.
%
  a = a_default;
  b = b_default;
  kc = kc_default;
  kn = kn_default;
  rmax = rmax_default;
  e = e_default;
  t0 = t0_default;
  y0 = y0_default;
  tstop = tstop_default;

  return
end

