function [ pdia, psys, pulse, q, told, t0, y0, tstop ] = ...
  blood_pressure_parameters ( pdia_user, psys_user, pulse_user, q_user, ...
  told_user, t0_user, y0_user, tstop_user )

%*****************************************************************************80
%
%% blood_pressure_parameters() returns parameters for blood_pressure_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 March 2022
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real PDIA_USER: the diastolic blood pressure.
%
%    real PSYS_USER: the systolic blood pressure.
%
%    real PULSE_USER: the number of heart beats per minute.
%
%    real Q_USER: the cardiac output, liters of blood per minute.
%
%    real TOLD_USER: the time at the previous call to blood_pressure_deriv.
%
%    real T0_USER: the initial time.
%
%    real Y0_USER: the initial condition at time T0.
%
%    real TSTOP_USER: the final time.
%
%  Output:
%
%    real PULSE: the number of heart beats per minute.
%
%    real Q: the cardiac output, liters of blood per minute.
%
%    real TOLD_USER: the time at the previous call to blood_pressure_deriv.
%
%    real T0: the initial time.
%
%    real Y0: the initial condition at time T0.
%
%    real TSTOP: the final time.
%
  persistent pdia_default;
  persistent psys_default;
  persistent pulse_default;
  persistent q_default;
  persistent told_default;
  persistent t0_default;
  persistent y0_default;
  persistent tstop_default;
%
%  Initialize defaults.
%
  if ( isempty ( pdia_default ) )
    pdia_default = 80.0;
  end

  if ( isempty ( psys_default ) )
    psys_default = 120.0;
  end

  if ( isempty ( pulse_default ) )
    pulse_default = 70.0;
  end

  if ( isempty ( q_default ) )
    q_default = 5.6;
  end

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

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

  if ( isempty ( y0_default ) )
    y0_default = 120.0;
  end

  if ( isempty ( tstop_default ) )
    tstop_default = 10.0 / 70.0;
    tstop_default = 4.0 / 70.0;
  end
%
%  Update defaults if input was supplied.
%
  if ( 1 <= nargin )
    pdia_default = pdia_user;
  end

  if ( 2 <= nargin )
    psys_default = psys_user;
  end

  if ( 3 <= nargin )
    pulse_default = pulse_user;
  end

  if ( 4 <= nargin )
    q_default = q_user;
  end

  if ( 5 <= nargin )
    told_default = told_user;
  end

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

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

  if ( 8 <= nargin )
    tstop_default = tstop_user;
  end
%
%  Return values.
%
  pdia = pdia_default;
  psys = psys_default;
  pulse = pulse_default;
  q = q_default;
  told = told_default;
  t0 = t0_default;
  y0 = y0_default;
  tstop = tstop_default;

  return
end

