08-Jan-2022 10:29:31 test_triangle_integrals_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test test_triangle_integrals(). TEST_TRIANGLE_INTEGRALS_TEST01(): GET_PROB_NUM reports the number of problems. P00_TITLE returns a title for each problem. The number of problems available is 22 The problem titles: 1 f(x,y) = 2 2 f(x,y) = 6 * x 3 f(x,y) = 6 * y 4 f(x,y) = 12 * x^2 5 f(x,y) = 24 * x*y 6 f(x,y) = 12 * y^2 7 f(x,y) = 20 * x^3 8 f(x,y) = 30 * x^4 9 f(x,y) = 42 * x^5 10 f(x,y) = x^(-0.2) on ((1,0),(5,0),(5,1)) 11 f(x,y) = (x+y)^(-0.2) 12 f(x,y) = (1-x-y)^(-0.2) on ((-1,-3),(3,-2),(-1,2)) 13 f(x,y) = (x*y)^(-0.2) on ((0,0),(-7,0),(0,-3)) 14 f(x,y) = 1/sqrt(x) + 1/sqrt(y) + 1/sqrt(x+y) 15 f(x,y) = 1/sqrt(1-x-y) 16 f(x,y) = log(x*y) 17 f(x,y) = 1/sqrt(|x-1/4|) + 1/sqrt(|y-1/2|) 18 f(x,y) = log ( x + y ) 19 f(x,y) = sin ( x ) cos ( 5 y ) 20 f(x,y) = sin ( 11 x ) cos ( y ) 21 f(x,y) = 1 / r = 1 / sqrt ( x^2 + y^2 ) 22 f(x,y) = log ( r ) / r TEST_TRIANGLE_INTEGRALS_TEST02(): P00_MONTE_CARLO applies a Monte Carlo rule. Problem Exact Pts Approx Error f(x,y) = 2 1 1.000000 1 1.000000 0.000000 2 1.000000 0.000000 4 1.000000 0.000000 8 1.000000 0.000000 16 1.000000 0.000000 32 1.000000 0.000000 64 1.000000 0.000000 128 1.000000 0.000000 256 1.000000 0.000000 512 1.000000 0.000000 1024 1.000000 0.000000 2048 1.000000 0.000000 4096 1.000000 0.000000 8192 1.000000 0.000000 16384 1.000000 0.000000 32768 1.000000 0.000000 f(x,y) = 6 * x 2 1.000000 1 0.803835 0.196165 2 1.359440 0.359440 4 0.641275 0.358725 8 1.220327 0.220327 16 0.686111 0.313889 32 0.912284 0.087716 64 0.973452 0.026548 128 1.031211 0.031211 256 1.062424 0.062424 512 0.984544 0.015456 1024 0.997319 0.002681 2048 1.012791 0.012791 4096 1.002998 0.002998 8192 0.994192 0.005808 16384 0.996478 0.003522 32768 1.000436 0.000436 f(x,y) = 6 * y 3 1.000000 1 1.313228 0.313228 2 1.517427 0.517427 4 1.007141 0.007141 8 1.288440 0.288440 16 1.110998 0.110998 32 0.870921 0.129079 64 1.063506 0.063506 128 1.045903 0.045903 256 1.064527 0.064527 512 1.029995 0.029995 1024 0.983880 0.016120 2048 1.002801 0.002801 4096 0.989838 0.010162 8192 0.997061 0.002939 16384 0.990099 0.009901 32768 0.999570 0.000430 f(x,y) = 12 * x^2 4 1.000000 1 0.281162 0.718838 2 1.060247 0.060247 4 2.144114 1.144114 8 0.737385 0.262615 16 1.470652 0.470652 32 1.181785 0.181785 64 1.226114 0.226114 128 1.075995 0.075995 256 1.069742 0.069742 512 0.926461 0.073539 1024 0.935982 0.064018 2048 1.009048 0.009048 4096 0.971822 0.028178 8192 0.980880 0.019120 16384 0.988576 0.011424 32768 0.998246 0.001754 f(x,y) = 24 * x*y 5 1.000000 1 1.919650 0.919650 2 1.092584 0.092584 4 1.399328 0.399328 8 0.783991 0.216009 16 1.512967 0.512967 32 1.089597 0.089597 64 1.111916 0.111916 128 1.195929 0.195929 256 0.990489 0.009511 512 1.029172 0.029172 1024 1.005872 0.005872 2048 1.016554 0.016554 4096 1.004252 0.004252 8192 0.988126 0.011874 16384 1.005079 0.005079 32768 1.001840 0.001840 f(x,y) = 12 * y^2 6 1.000000 1 0.220642 0.779358 2 0.376492 0.623508 4 0.362320 0.637680 8 1.201077 0.201077 16 1.115476 0.115476 32 1.151470 0.151470 64 0.895907 0.104093 128 1.050660 0.050660 256 1.006154 0.006154 512 1.007498 0.007498 1024 1.080874 0.080874 2048 0.969326 0.030674 4096 0.999810 0.000190 8192 1.001133 0.001133 16384 0.996945 0.003055 32768 0.998514 0.001486 f(x,y) = 20 * x^3 7 1.000000 1 0.008250 0.991750 2 1.866730 0.866730 4 0.967954 0.032046 8 1.791824 0.791824 16 0.817674 0.182326 32 0.963699 0.036301 64 0.960157 0.039843 128 0.861732 0.138268 256 1.049235 0.049235 512 0.933181 0.066819 1024 0.928124 0.071876 2048 1.042257 0.042257 4096 0.975937 0.024063 8192 1.034788 0.034788 16384 0.991409 0.008591 32768 0.982527 0.017473 f(x,y) = 30 * x^4 8 1.000000 1 0.000001 0.999999 2 0.460494 0.539506 4 0.048531 0.951469 8 0.340861 0.659139 16 0.287893 0.712107 32 0.853475 0.146525 64 1.104879 0.104879 128 0.936622 0.063378 256 0.837709 0.162291 512 1.018123 0.018123 1024 1.035778 0.035778 2048 1.034264 0.034264 4096 1.060385 0.060385 8192 1.010811 0.010811 16384 0.993030 0.006970 32768 1.002467 0.002467 f(x,y) = 42 * x^5 9 1.000000 1 0.352066 0.647934 2 0.051382 0.948618 4 0.008504 0.991496 8 0.572379 0.427621 16 0.412886 0.587114 32 1.304319 0.304319 64 0.746401 0.253599 128 1.164017 0.164017 256 1.087265 0.087265 512 0.852908 0.147092 1024 0.986212 0.013788 2048 0.959737 0.040263 4096 0.940791 0.059209 8192 0.976794 0.023206 16384 0.978949 0.021051 32768 0.994206 0.005794 f(x,y) = x^(-0.2) on ((1,0),(5,0),(5,1)) 10 1.000000 1 0.122289 0.877711 2 2.136689 1.136689 4 4.611276 3.611276 8 0.684397 0.315603 16 0.814787 0.185213 32 0.529133 0.470867 64 0.765941 0.234059 128 0.895384 0.104616 256 0.884371 0.115629 512 0.988250 0.011750 1024 0.898624 0.101376 2048 0.925549 0.074451 4096 0.941598 0.058402 8192 0.887614 0.112386 16384 0.988665 0.011335 32768 1.037012 0.037012 f(x,y) = (x+y)^(-0.2) 11 1.000000 1 0.907292 0.092708 2 1.046146 0.046146 4 0.994882 0.005118 8 0.989195 0.010805 16 0.985074 0.014926 32 1.038004 0.038004 64 1.007089 0.007089 128 1.002001 0.002001 256 0.998078 0.001922 512 0.992915 0.007085 1024 1.002376 0.002376 2048 0.998638 0.001362 4096 0.999821 0.000179 8192 1.000378 0.000378 16384 1.000228 0.000228 32768 0.999414 0.000586 f(x,y) = (1-x-y)^(-0.2) on ((-1,-3),(3,-2),(-1,2)) 12 1.000000 1 1.086793 0.086793 2 1.003634 0.003634 4 1.113935 0.113935 8 1.333340 0.333340 16 0.974848 0.025152 32 0.989309 0.010691 64 1.001007 0.001007 128 1.011288 0.011288 256 0.985012 0.014988 512 0.986851 0.013149 1024 0.998334 0.001666 2048 1.000585 0.000585 4096 0.995946 0.004054 8192 1.000622 0.000622 16384 1.000534 0.000534 32768 0.999037 0.000963 f(x,y) = (x*y)^(-0.2) on ((0,0),(-7,0),(0,-3)) 13 1.000000 1 0.992848 0.007152 2 0.876495 0.123505 4 0.848078 0.151922 8 1.015996 0.015996 16 0.966735 0.033265 32 0.983163 0.016837 64 0.986925 0.013075 128 1.015814 0.015814 256 0.999020 0.000980 512 0.983188 0.016812 1024 1.008844 0.008844 2048 1.007972 0.007972 4096 1.000635 0.000635 8192 1.005474 0.005474 16384 0.999672 0.000328 32768 0.997238 0.002762 f(x,y) = 1/sqrt(x) + 1/sqrt(y) + 1/sqrt(x+y) 14 1.000000 1 0.600437 0.399563 2 0.775569 0.224431 4 0.807582 0.192418 8 0.795915 0.204085 16 1.235242 0.235242 32 1.012528 0.012528 64 0.937296 0.062704 128 1.004652 0.004652 256 1.087714 0.087714 512 0.977707 0.022293 1024 1.000288 0.000288 2048 1.024851 0.024851 4096 0.986880 0.013120 8192 1.009665 0.009665 16384 0.991136 0.008864 32768 0.992612 0.007388 f(x,y) = 1/sqrt(1-x-y) 15 1.000000 1 0.506268 0.493732 2 0.745593 0.254407 4 1.033219 0.033219 8 0.874534 0.125466 16 0.758471 0.241529 32 0.867643 0.132357 64 1.225506 0.225506 128 1.125326 0.125326 256 1.117690 0.117690 512 1.137851 0.137851 1024 0.967879 0.032121 2048 0.974502 0.025498 4096 1.044537 0.044537 8192 1.203859 0.203859 16384 0.977685 0.022315 32768 1.012119 0.012119 f(x,y) = log(x*y) 16 1.000000 1 0.578796 0.421204 2 0.757764 0.242236 4 1.041506 0.041506 8 1.103144 0.103144 16 0.988206 0.011794 32 1.046311 0.046311 64 0.992279 0.007721 128 0.963244 0.036756 256 1.046455 0.046455 512 1.014063 0.014063 1024 0.983143 0.016857 2048 1.001764 0.001764 4096 0.989116 0.010884 8192 1.004520 0.004520 16384 0.999600 0.000400 32768 0.997829 0.002171 f(x,y) = 1/sqrt(|x-1/4|) + 1/sqrt(|y-1/2|) 17 1.000000 1 0.906921 0.093079 2 1.496218 0.496218 4 0.769697 0.230303 8 1.020955 0.020955 16 1.018522 0.018522 32 0.909356 0.090644 64 0.772029 0.227971 128 0.978025 0.021975 256 0.965405 0.034595 512 1.003714 0.003714 1024 1.002347 0.002347 2048 1.021893 0.021893 4096 1.005484 0.005484 8192 1.005015 0.005015 16384 0.981910 0.018090 32768 0.999208 0.000792 f(x,y) = log ( x + y ) 18 1.000000 1 0.457209 0.542791 2 1.375081 0.375081 4 0.602862 0.397138 8 1.392555 0.392555 16 0.939956 0.060044 32 1.108576 0.108576 64 1.130780 0.130780 128 0.880489 0.119511 256 1.041413 0.041413 512 1.014538 0.014538 1024 0.983653 0.016347 2048 0.990185 0.009815 4096 0.989747 0.010253 8192 0.996253 0.003747 16384 0.997425 0.002575 32768 0.999239 0.000761 f(x,y) = sin ( x ) cos ( 5 y ) 19 1.000000 1 -0.963357 1.963357 2 -1.689130 2.689130 4 3.180912 2.180912 8 2.073208 1.073208 16 1.198670 0.198670 32 0.506924 0.493076 64 1.126314 0.126314 128 1.215485 0.215485 256 1.321682 0.321682 512 0.916028 0.083972 1024 1.061826 0.061826 2048 0.961433 0.038567 4096 1.029766 0.029766 8192 1.000467 0.000467 16384 1.018433 0.018433 32768 1.035738 0.035738 f(x,y) = sin ( 11 x ) cos ( y ) 20 1.000000 1 4.789186 3.789186 2 2.380756 1.380756 4 0.764850 0.235150 8 1.651805 0.651805 16 1.009652 0.009652 32 1.353761 0.353761 64 1.165380 0.165380 128 0.881045 0.118955 256 0.561550 0.438450 512 0.977761 0.022239 1024 1.067137 0.067137 2048 1.041502 0.041502 4096 0.874251 0.125749 8192 0.924621 0.075379 16384 0.992703 0.007297 32768 0.970350 0.029650 f(x,y) = 1 / r = 1 / sqrt ( x^2 + y^2 ) 21 1.000000 1 1.873308 0.873308 2 0.798181 0.201819 4 0.649848 0.350152 8 1.400266 0.400266 16 1.135891 0.135891 32 0.940568 0.059432 64 1.998651 0.998651 128 1.003369 0.003369 256 1.045247 0.045247 512 1.003137 0.003137 1024 0.979045 0.020955 2048 1.007947 0.007947 4096 0.954510 0.045490 8192 0.985435 0.014565 16384 0.989340 0.010660 32768 0.994687 0.005313 f(x,y) = log ( r ) / r 22 1.000000 1 0.160059 0.839941 2 0.329287 0.670713 4 1.029737 0.029737 8 0.347434 0.652566 16 0.656891 0.343109 32 0.991209 0.008791 64 2.053684 1.053684 128 0.987869 0.012131 256 0.801818 0.198182 512 0.845690 0.154310 1024 1.056728 0.056728 2048 0.870451 0.129549 4096 1.095660 0.095660 8192 1.034434 0.034434 16384 0.981692 0.018308 32768 1.009766 0.009766 TEST_TRIANGLE_INTEGRALS_TEST03 P00_VERTEX_SUB applies a vertex rule with subdivision. Problem Exact Pts Approx Error f(x,y) = 2 1 1.000000 3 1.000000 0.000000 6 1.000000 0.000000 15 1.000000 0.000000 45 1.000000 0.000000 153 1.000000 0.000000 f(x,y) = 6 * x 2 1.000000 3 1.000000 0.000000 6 1.000000 0.000000 15 1.000000 0.000000 45 1.000000 0.000000 153 1.000000 0.000000 f(x,y) = 6 * y 3 1.000000 3 1.000000 0.000000 6 1.000000 0.000000 15 1.000000 0.000000 45 1.000000 0.000000 153 1.000000 0.000000 f(x,y) = 12 * x^2 4 1.000000 3 2.000000 1.000000 6 1.250000 0.250000 15 1.125000 0.125000 45 1.078125 0.078125 153 1.046875 0.046875 f(x,y) = 24 * x*y 5 1.000000 3 0.000000 1.000000 6 0.750000 0.250000 15 0.875000 0.125000 45 0.921875 0.078125 153 0.953125 0.046875 f(x,y) = 12 * y^2 6 1.000000 3 2.000000 1.000000 6 1.250000 0.250000 15 1.125000 0.125000 45 1.078125 0.078125 153 1.046875 0.046875 f(x,y) = 20 * x^3 7 1.000000 3 3.333333 2.333333 6 1.458333 0.458333 15 1.223958 0.223958 45 1.147786 0.147786 153 1.091390 0.091390 f(x,y) = 30 * x^4 8 1.000000 3 5.000000 4.000000 6 1.718750 0.718750 15 1.318359 0.318359 45 1.213257 0.213257 153 1.134422 0.134422 f(x,y) = 42 * x^5 9 1.000000 3 7.000000 6.000000 6 2.078125 1.078125 15 1.411621 0.411621 45 1.274155 0.274155 153 1.175731 0.175731 f(x,y) = x^(-0.2) on ((1,0),(5,0),(5,1)) 10 1.000000 Skip this problem, it has edge singularities. f(x,y) = (x+y)^(-0.2) 11 1.000000 Skip this problem, it has vertex singularities. f(x,y) = (1-x-y)^(-0.2) on ((-1,-3),(3,-2),(-1,2)) 12 1.000000 Skip this problem, it has edge singularities. f(x,y) = (x*y)^(-0.2) on ((0,0),(-7,0),(0,-3)) 13 1.000000 Skip this problem, it has edge singularities. f(x,y) = 1/sqrt(x) + 1/sqrt(y) + 1/sqrt(x+y) 14 1.000000 Skip this problem, it has edge singularities. f(x,y) = 1/sqrt(1-x-y) 15 1.000000 Skip this problem, it has edge singularities. f(x,y) = log(x*y) 16 1.000000 Skip this problem, it has edge singularities. singularity = 3 f(x,y) = 1/sqrt(|x-1/4|) + 1/sqrt(|y-1/2|) 17 1.000000 Skip this problem, it has internal singularities. f(x,y) = log ( x + y ) 18 1.000000 Skip this problem, it has vertex singularities. f(x,y) = sin ( x ) cos ( 5 y ) 19 1.000000 3 3.257551 2.257551 6 1.091193 0.091193 15 1.213464 0.213464 45 1.175858 0.175858 153 1.112362 0.112362 f(x,y) = sin ( 11 x ) cos ( y ) 20 1.000000 3 -1.950026 2.950026 6 -2.424940 3.424940 15 0.611848 0.388152 45 0.818723 0.181277 153 0.896438 0.103562 f(x,y) = 1 / r = 1 / sqrt ( x^2 + y^2 ) 21 1.000000 Skip this problem, it has vertex singularities. f(x,y) = log ( r ) / r 22 1.000000 Skip this problem, it has vertex singularities. TEST_TRIANGLE_INTEGRALS_TEST04 P00_WANDZURA05_SUB applies a Wandzura rule with subdivision. Problem Exact Pts Approx Error f(x,y) = 2 1 1.000000 7 1.000000 0.000000 Accuracy acceptable f(x,y) = 6 * x 2 1.000000 7 1.000000 0.000000 Accuracy acceptable f(x,y) = 6 * y 3 1.000000 7 1.000000 0.000000 Accuracy acceptable f(x,y) = 12 * x^2 4 1.000000 7 1.000000 0.000000 Accuracy acceptable f(x,y) = 24 * x*y 5 1.000000 7 1.000000 0.000000 Accuracy acceptable f(x,y) = 12 * y^2 6 1.000000 7 1.000000 0.000000 Accuracy acceptable f(x,y) = 20 * x^3 7 1.000000 7 1.000000 0.000000 Accuracy acceptable f(x,y) = 30 * x^4 8 1.000000 7 1.000000 0.000000 Accuracy acceptable f(x,y) = 42 * x^5 9 1.000000 7 1.000000 0.000000 Accuracy acceptable f(x,y) = x^(-0.2) on ((1,0),(5,0),(5,1)) 10 1.000000 7 0.798157 0.201843 28 0.883684 0.116316 112 0.933087 0.066913 448 0.961538 0.038462 1792 0.977901 0.022099 7168 0.987305 0.012695 f(x,y) = (x+y)^(-0.2) 11 1.000000 7 0.998396 0.001604 28 0.999539 0.000461 112 0.999868 0.000132 448 0.999962 0.000038 1792 0.999989 0.000011 7168 0.999997 0.000003 f(x,y) = (1-x-y)^(-0.2) on ((-1,-3),(3,-2),(-1,2)) 12 1.000000 7 0.972572 0.027428 28 0.983878 0.016122 112 0.990635 0.009365 448 0.994591 0.005409 1792 0.996884 0.003116 7168 0.998208 0.001792 f(x,y) = (x*y)^(-0.2) on ((0,0),(-7,0),(0,-3)) 13 1.000000 7 0.949590 0.050410 28 0.970474 0.029526 112 0.982868 0.017132 448 0.990106 0.009894 1792 0.994300 0.005700 7168 0.996721 0.003279 f(x,y) = 1/sqrt(x) + 1/sqrt(y) + 1/sqrt(x+y) 14 1.000000 7 0.873246 0.126754 28 0.909736 0.090264 112 0.935949 0.064051 448 0.954630 0.045370 1792 0.967890 0.032110 7168 0.977285 0.022715 f(x,y) = 1/sqrt(1-x-y) 15 1.000000 7 0.843800 0.156200 28 0.887964 0.112036 112 0.920217 0.079783 448 0.943387 0.056613 1792 0.959898 0.040102 7168 0.971619 0.028381 f(x,y) = log(x*y) 16 1.000000 7 0.950264 0.049736 28 0.974388 0.025612 112 0.987008 0.012992 448 0.993457 0.006543 1792 0.996717 0.003283 7168 0.998356 0.001644 f(x,y) = 1/sqrt(|x-1/4|) + 1/sqrt(|y-1/2|) 17 1.000000 7 0.864525 0.135475 28 0.965722 0.034278 112 0.913986 0.086014 448 0.939178 0.060822 1792 0.956993 0.043007 7168 0.969589 0.030411 f(x,y) = log ( x + y ) 18 1.000000 7 0.991081 0.008919 28 0.997766 0.002234 112 0.999442 0.000558 448 0.999860 0.000140 1792 0.999965 0.000035 7168 0.999991 0.000009 f(x,y) = sin ( x ) cos ( 5 y ) 19 1.000000 7 0.975991 0.024009 28 0.999840 0.000160 112 0.999998 0.000002 448 1.000000 0.000000 Accuracy acceptable f(x,y) = sin ( 11 x ) cos ( y ) 20 1.000000 7 0.051313 0.948687 28 1.019286 0.019286 112 1.000129 0.000129 448 1.000002 0.000002 1792 1.000000 0.000000 Accuracy acceptable f(x,y) = 1 / r = 1 / sqrt ( x^2 + y^2 ) 21 1.000000 7 0.973846 0.026154 28 0.987025 0.012975 112 0.993511 0.006489 448 0.996756 0.003244 1792 0.998378 0.001622 7168 0.999189 0.000811 f(x,y) = log ( r ) / r 22 1.000000 7 0.862016 0.137984 28 0.923815 0.076185 112 0.958237 0.041763 448 0.977284 0.022716 1792 0.987725 0.012275 7168 0.993404 0.006596 test_triangle_integrals_test(): Normal end of execution. 08-Jan-2022 10:29:32