function [ a, v, t0, tstop ] = kdv_parameters ( a_user, v_user, t0_user, ...
  tstop_user )

%*****************************************************************************80
%
%% kdv_parameters(): parameters for the Korteweg-Devries PDE.
%
%  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:
%
%    03 November 2023
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real a_user: the phase;
%
%    real v_user: the velocity;
%
%    real t0_user: the initial time;
%
%    real tstop_user: the final time.
%
%  Output:
%
%    real a: the phase.
%
%    real v: the velocity;
%
%    real t0: the initial time;
%
%    real tstop: the final time.
%
  persistent a_default;
  persistent v_default;
  persistent t0_default;
  persistent tstop_default;
%
%  Initialize defaults.
%
  if ( isempty ( a_default ) )
    a_default = 0.0;
  end

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

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

  if ( isempty ( tstop_default ) )
    tstop_default = 10.0;
  end
%
%  Update defaults if input was supplied.
%
  if ( 1 <= nargin )
    a_default = a_user;
  end

  if ( 2 <= nargin )
    v_default = v_user;
  end

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

  if ( 4 <= nargin )
    tstop_default = tstop_user;
  end
%
%  Return values.
%
  a = a_default;
  v = v_default;
  t0 = t0_default;
  tstop = tstop_default;
  
  return
end

