function clayton_test01 ( )

%*****************************************************************************80
%
%% clayton_test01() plots a correlation function for several values of RH00.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 March 2012
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'clayton_test01():\n' );
  fprintf ( 1, '  Make plots of correlation functions.\n' );
  fprintf ( 1, '\n' );
%
%  besselj
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_besselj ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'Bessel J, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [-2.0, 2.0, -1.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_besselj_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  besselk
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_besselk ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'Bessel K, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [-2.0, 2.0, 0.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_besselk_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  circular
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_circular ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0 ], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'Circular correlation, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [-2.0, 2.0, 0.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_circular_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  constant
%  Pointless to make multiple plots for this one.
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = 1.0;
  rho = linspace ( -2.0, 2.0, n );
  c = correlation_constant ( n, rho, rho0 );
  plot ( rho, c, 'Linewidth', 4 );
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'Constant correlation, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [ -2.0, 2.0, 0.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_constants_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  cubic
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_cubic ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'Cubic correlation, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [ -2.0, 2.0, 0.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_cubic_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  damped_cosine
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_damped_cosine ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'Damped cosine correlation, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [ -2.0, 2.0, -1.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_damped_cosine_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  damped_sine
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_damped_sine ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'Damped sine correlation, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [ -2.0, 2.0, -1.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_damped_sine_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  exponential
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_exponential ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'Exponential correlation, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [ -2.0, 2.0, 0.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_exponential_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  gaussian
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_gaussian ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'Gaussian correlation, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [-2.0, 2.0, 0.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_gaussian_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Linear
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_linear ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'Linear correlation, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [-2.0, 2.0, 0.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_linear_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  pentaspherical
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_pentaspherical ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'Pentaspherical correlation, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [ -2.0, 2.0, 0.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_pentaspherical_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  rational quadratic
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_rational_quadratic ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'Rational quadratic correlation, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [ -2.0, 2.0, 0.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_rational_quadratic_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  spherical
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_spherical ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'Spherical correlation, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [ -2.0, 2.0, 0.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_spherical_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  white_noise
%
  clf ( );
  hold ( 'on' );
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_white_noise ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid ( 'on' );
  ylabel ( '<-- Correlation Strength -->' );
  xlabel ( '<-- Distance -->' );
  title ( 'White noise correlation, Correlation length = 1 (red), 1/4 (blue)' );
  axis ( [-2.0, 2.0, 0.0, +1.0] );
  hold ( 'off' );
  filename = 'clayton_white_noise_plots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  close ( );

  return
end



