function convergence_h_test01 ( )

%*****************************************************************************80
%
%% convergence_h_test01() tests convergence_h() on a set of ? results.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 September 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'convergence_h_test01():\n' );
  fprintf ( 1, '  A computation has been carried out with intervals,\n' );
  fprintf ( 1, '  of size h(k), for k = 1 to 5.  For each h, the\n' );
  fprintf ( 1, '  approximation error e(k) was computed.\n' );
  fprintf ( 1, '  convergence_h() estimates the convergence order.\n' );

  nn = 5;
  h = [ 0.25, 0.125, 0.0625, 0.03125, 0.015625 ];
  e = [ 0.069288, 0.0185749, 0.00479553, 0.00121795, 0.000306885 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The number of computations was %d\n', nn );
  fprintf ( 1, '  The mesh sizes h(k):\n' );
  disp ( h );
  fprintf ( 1, '  The errors e(k):\n' );
  disp ( e );
%
%  Request convergence order estimates.
%
  eoc = convergence_h ( h, e );

  eoc_mean = mean ( eoc(2:end) );

  fprintf ( 1, '\n' );
  fprintf ( 1, '    h(k)  error(k)   eoc(k)\n' );
  fprintf ( 1, '\n' );
  for k = 1 : nn
    fprintf ( 1, '  %.6f  %.2e  %.2f\n', h(k), e(k), eoc(k) );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, '  eoc mean       %.2f\n', eoc_mean );

  return
end
