%% D6_PLOTS
%
%  Discussion:
%
%    Make plots comparing the error in estimating the 6 Genz integrals,
%    using "UA", (cyan) a random sequence from UNIFORM_DATASET with initial seed 123456789
%          "UB", (blue) a random sequence from UNIFORM_DATASET with initial seed 234567891
%          "CC", (red)  a sparse grid of levels 0, 1, 2, 3, 4, 5 using Clenshaw-Curtis.
%
%    The black line suggests the expected Monte Carlo convergence rate.
%
%    The data was computed using the "QUADRATURE_TEST_GENZ" program.
%
%  Modified:
%
%    29 November 2011
%
%  Author:
%
%    John Burkardt
%
n = [ 1, 13, 85, 389, 1457, 4865 ];

p27ua = [ 0.275104E-01,  0.412903E-02,  0.678814E-02,  0.137266E-02,  0.143738E-02,  0.381690E-02 ];
p28ua = [ 0.458857E-01,  0.219526E-01,  0.253931E-02,  0.617476E-03,  0.576553E-03,  0.161933E-02 ];
p29ua = [ 0.224566E-01,  0.365537E-02,  0.355157E-02,  0.328366E-03,  0.789292E-03,  0.188627E-02 ];
p30ua = [ 0.264083E-02,  0.104023E-02,  0.772539E-04,  0.586358E-05,  0.363339E-04,  0.886862E-03 ];
p31ua = [ 0.362737E-02,  0.193993E-01,  0.956476E-03,  0.517775E-03,  0.366187E-03,  0.886862E-03 ];
p32ua = [ 10.9776,       0.938241,      0.282886,      0.194412,      0.286599,      0.428477E-01 ];

p27ub = [ 0.104299E-01,0.396153E-01,0.270116E-02,0.326733E-02,0.558124E-03,0.177893E-02 ];
p28ub = [ 0.599629E-01,0.419078E-01,0.911534E-03,0.495556E-02,0.290121E-02,0.134627E-02 ];
p29ub = [ 0.149322E-01,0.275803E-01,0.125773E-02,0.224731E-02,0.899553E-03,0.130390E-02 ];
p30ub = [ 0.262055E-02,0.211365E-02,0.359988E-04,0.229389E-03,0.142474E-03,0.658826E-04 ];
p31ub = [ 0.267420E-01,0.198807E-01,0.349883E-03,0.252823E-02,0.131745E-02,0.599070E-03 ];
p32ub = [ 6.32573,     1.95486,     0.192089E-01,0.363306,    0.209997,    0.596243E-02 ];

p27cc = [ 0.676669,    0.134101E-04,0.157654E-07,0.480349E-11,0.799361E-13,0.185629E-12 ];
p28cc = [ 0.573282,    0.357818E-01,0.467073E-02,0.582152E-03,0.492033E-04,0.375410E-05];
p29cc = [ 0.852816E-01,0.114759E-02,0.733315E-04,0.192317E-05,0.177856E-06,0.149580E-07];
p30cc = [ 0.923720,    0.605690E-04,0.273726E-07,0.407048E-09,0.436429E-12,0.318856E-12];
p31cc = [ 0.129689E-02,0.328038,    0.272865,    0.704983E-01,0.520638E-01,0.397528E-01];
p32cc = [ 5.42080,     11.5304,     17.6836,     12.2901,     9.98698,     3.96047 ];

figure ( 1 )
clf
xmc = [ 0.0,  4.0 ];
ymc = [ 0.0, -2.0 ];
plot ( xmc, ymc, 'k-', 'LineWidth', 2 )
hold on
plot ( log10 ( n ), log10 ( p27ua ), 'c.-', 'LineWidth', 3, 'MarkerSize', 20 );
plot ( log10 ( n ), log10 ( p27ub ), 'b.-', 'LineWidth', 3, 'MarkerSize', 20 );
plot ( log10 ( n ), log10 ( p27cc ), 'r.-', 'LineWidth', 3, 'MarkerSize', 20 );
grid on
xlabel ( 'Log10(N), number of points' )
ylabel ( 'Log10(E), integral error' )
title ( 'Genz Oscillatory, Dimension 6' )

figure ( 2 )
clf
xmc = [ 0.0,  4.0 ];
ymc = [ 0.0, -2.0 ];
plot ( xmc, ymc, 'k-', 'LineWidth', 2 )
hold on
plot ( log10 ( n ), log10 ( p28ua ), 'c.-', 'LineWidth', 3, 'MarkerSize', 20 );
plot ( log10 ( n ), log10 ( p28ub ), 'b.-', 'LineWidth', 3, 'MarkerSize', 20 );
plot ( log10 ( n ), log10 ( p28cc ), 'r.-', 'LineWidth', 3, 'MarkerSize', 20 );
grid on
xlabel ( 'Log10(N), number of points' )
ylabel ( 'Log10(E), integral error' )
title ( 'Genz Product Peak, Dimension 6' )

figure ( 3 )
clf
xmc = [ 0.0,  4.0 ];
ymc = [ 0.0, -2.0 ];
plot ( xmc, ymc, 'k-', 'LineWidth', 2 )
hold on
plot ( log10 ( n ), log10 ( p29ua ), 'c.-', 'LineWidth', 3, 'MarkerSize', 20 );
plot ( log10 ( n ), log10 ( p29ub ), 'b.-', 'LineWidth', 3, 'MarkerSize', 20 );
plot ( log10 ( n ), log10 ( p29cc ), 'r.-', 'LineWidth', 3, 'MarkerSize', 20 );
grid on
xlabel ( 'Log10(N), number of points' )
ylabel ( 'Log10(E), integral error' )
title ( 'Genz Corner Peak, Dimension 6' )

figure ( 4 )
clf
xmc = [ 0.0,  4.0 ];
ymc = [ 0.0, -2.0 ];
plot ( xmc, ymc, 'k-', 'LineWidth', 2 )
hold on
plot ( log10 ( n ), log10 ( p30ua ), 'c.-', 'LineWidth', 3, 'MarkerSize', 20 );
plot ( log10 ( n ), log10 ( p30ub ), 'b.-', 'LineWidth', 3, 'MarkerSize', 20 );
plot ( log10 ( n ), log10 ( p30cc ), 'r.-', 'LineWidth', 3, 'MarkerSize', 20 );
grid on
xlabel ( 'Log10(N), number of points' )
ylabel ( 'Log10(E), integral error' )
title ( 'Genz Gaussian, Dimension 6' )

figure ( 5 )
clf
xmc = [ 0.0,  4.0 ];
ymc = [ 0.0, -2.0 ];
plot ( xmc, ymc, 'k-', 'LineWidth', 2 )
hold on
plot ( log10 ( n ), log10 ( p31ua ), 'c.-', 'LineWidth', 3, 'MarkerSize', 20 );
plot ( log10 ( n ), log10 ( p31ub ), 'b.-', 'LineWidth', 3, 'MarkerSize', 20 );
plot ( log10 ( n ), log10 ( p31cc ), 'r.-', 'LineWidth', 3, 'MarkerSize', 20 );
grid on
xlabel ( 'Log10(N), number of points' )
ylabel ( 'Log10(E), integral error' )
title ( 'Genz Continuous, Dimension 6' )

figure ( 6 )
clf
xmc = [ 0.0,  4.0 ];
ymc = [ 0.0, -2.0 ];
plot ( xmc, ymc, 'k-', 'LineWidth', 2 )
hold on
plot ( log10 ( n ), log10 ( p32ua ), 'c.-', 'LineWidth', 3, 'MarkerSize', 20 );
plot ( log10 ( n ), log10 ( p32ub ), 'b.-', 'LineWidth', 3, 'MarkerSize', 20 );
plot ( log10 ( n ), log10 ( p32cc ), 'r.-', 'LineWidth', 3, 'MarkerSize', 20 );
grid on
xlabel ( 'Log10(N), number of points' )
ylabel ( 'Log10(E), integral error' )
title ( 'Genz Discontinuous, Dimension 6' )
