%% D10_PLOTS
%
%  Discussion:
%
%    Make plots comparing the error in estimating the 6 Genz integrals in dimension 10.
%    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:
%
%    23 December 2011
%
%  Author:
%
%    John Burkardt
%
n = [ 1, 21, 221, 1581, 8801, 41265, 171425 ];

p27ua = [ 0.621663E-01,0.661411E-02,0.237556E-02,0.240700E-02,0.510630E-03,0.500981E-03, 0.469786E-04 ];
p28ua = [ 0.862431E-01,0.358116E-03,0.325280E-02,0.558759E-03,0.969064E-03,0.335342E-03, 0.374561E-03 ];
p29ua = [ 0.998458E-02,0.717662E-03,0.231674E-03,0.731622E-03,0.883475E-04,0.947415E-04, 0.161410E-05 ];
p30ua = [ 0.197359E-02,0.797690E-05,0.849772E-04,0.195301E-04,0.216260E-04,0.659042E-05, 0.933405E-05 ];
p31ua = [ 0.697293E-02,0.208406E-03,0.356953E-03,0.282006E-04,0.853606E-04,0.770556E-04, 0.418829E-04 ];
p32ua = [ 53.1655,23.0200,0.810329,0.248752,0.541233,0.647644, 0.140701 ];

p27ub = [ 0.120873E-01,0.139794E-01,0.961006E-03,0.358429E-02,0.192397E-02,0.375275E-03, 0.296305E-04 ];
p28ub = [ 0.671921E-01,0.217870E-01,0.470508E-02,0.129022E-02,0.926863E-03,0.406808E-03, 0.317503E-03 ];
p29ub = [ 0.519288E-02,0.203308E-02,0.229720E-03,0.639745E-03,0.354069E-03,0.576833E-04, 0.158868E-04 ];
p30ub = [ 0.176189E-02,0.631803E-03,0.400524E-04,0.342539E-04,0.191484E-04,0.374663E-04, 0.793555E-05 ];
p31ub = [ 0.124642E-02,0.649251E-03,0.114824E-02,0.176930E-03,0.943328E-04,0.209536E-05, 0.147853E-04 ];
p32ub = [ 67.0433,20.4676,0.916458,2.60275,0.587116,0.334229E-01, 0.732573E-02 ];

p27cc = [ 0.721285,0.542067E-05,0.536005E-08,0.281419E-11,0.390021E-12,0.270561E-12, 0.299560E-11 ];
p28cc = [ 0.466183,0.136756,0.398495E-02,0.286322E-02,0.216986E-03,0.362970E-04, 0.289173E-05];
p29cc = [ 0.191540E-01,0.498395E-03,0.487872E-04,0.365265E-05,0.186379E-06,0.420987E-08, 0.124141E-08];
p30cc = [ 0.987798,0.269723E-04,0.382537E-07,0.631373E-11,0.215783E-11,0.204907E-10, 0.209724E-09];
p31cc = [ 0.627964E-02,1.11725,0.137351,0.247154,0.205082,0.125434E-01, 0.614985E-01];
p32cc = [ 52.7507,189.932,285.665,407.676,487.744,535.599, 541.784];

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

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

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

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

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

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