31-Mar-2019 14:44:58 test_triangle_integrals_test MATLAB version 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 Seed Pts Approx Error f(x,y) = 2 1 1.000000 123456789 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 123456789 1 0.995276 0.004724 2 1.773974 0.773974 4 0.462446 0.537554 8 1.268155 0.268155 16 0.744146 0.255854 32 1.080774 0.080774 64 0.941664 0.058336 128 1.092809 0.092809 256 1.042350 0.042350 512 1.034844 0.034844 1024 1.025033 0.025033 2048 1.009509 0.009509 4096 1.019889 0.019889 8192 0.988857 0.011143 16384 0.999385 0.000615 32768 0.994452 0.005548 f(x,y) = 6 * y 3 1.000000 123456789 1 0.799562 0.200438 2 0.947250 0.052750 4 0.587278 0.412722 8 1.091552 0.091552 16 0.869840 0.130160 32 1.061250 0.061250 64 0.946969 0.053031 128 1.016365 0.016365 256 0.987598 0.012402 512 1.013828 0.013828 1024 0.999433 0.000567 2048 1.016212 0.016212 4096 0.987907 0.012093 8192 0.995952 0.004048 16384 0.999661 0.000339 32768 0.999540 0.000460 f(x,y) = 12 * x^2 4 1.000000 123456789 1 1.982489 0.982489 2 1.152306 0.152306 4 0.273533 0.726467 8 1.280220 0.280220 16 0.837766 0.162234 32 1.071576 0.071576 64 1.119306 0.119306 128 0.996923 0.003077 256 1.041150 0.041150 512 0.995884 0.004116 1024 1.022820 0.022820 2048 1.029530 0.029530 4096 1.012481 0.012481 8192 1.002122 0.002122 16384 0.995090 0.004910 32768 0.994522 0.005478 f(x,y) = 24 * x*y 5 1.000000 123456789 1 0.310557 0.689443 2 1.100488 0.100488 4 1.264557 0.264557 8 1.411505 0.411505 16 0.862779 0.137221 32 0.999614 0.000386 64 0.919767 0.080233 128 1.065355 0.065355 256 0.912600 0.087400 512 1.040915 0.040915 1024 1.032695 0.032695 2048 1.013130 0.013130 4096 0.998465 0.001535 8192 0.999910 0.000090 16384 1.004696 0.004696 32768 0.999956 0.000044 f(x,y) = 12 * y^2 6 1.000000 123456789 1 0.110874 0.889126 2 0.951255 0.048745 4 0.911505 0.088495 8 1.195492 0.195492 16 1.442279 0.442279 32 1.227004 0.227004 64 0.962407 0.037593 128 0.887450 0.112550 256 1.023333 0.023333 512 0.996146 0.003854 1024 1.034876 0.034876 2048 0.995912 0.004088 4096 0.991050 0.008950 8192 1.000752 0.000752 16384 0.990837 0.009163 32768 1.005666 0.005666 f(x,y) = 20 * x^3 7 1.000000 123456789 1 0.679631 0.320369 2 0.649285 0.350715 4 0.723085 0.276915 8 0.365997 0.634003 16 1.100133 0.100133 32 1.209564 0.209564 64 1.410228 0.410228 128 1.184663 0.184663 256 0.791197 0.208803 512 0.927304 0.072696 1024 1.006943 0.006943 2048 1.017692 0.017692 4096 0.993339 0.006661 8192 1.018072 0.018072 16384 0.979813 0.020187 32768 1.006705 0.006705 f(x,y) = 30 * x^4 8 1.000000 123456789 1 0.000191 0.999809 2 1.245539 0.245539 4 1.019721 0.019721 8 0.912434 0.087566 16 0.717466 0.282534 32 1.119622 0.119622 64 0.676315 0.323685 128 0.940005 0.059995 256 0.809353 0.190647 512 0.917092 0.082908 1024 0.988891 0.011109 2048 1.013483 0.013483 4096 0.958405 0.041595 8192 1.001562 0.001562 16384 0.986949 0.013051 32768 0.995439 0.004561 f(x,y) = 42 * x^5 9 1.000000 123456789 1 1.026645 0.026645 2 6.829242 5.829242 4 0.124465 0.875535 8 0.463885 0.536115 16 1.298067 0.298067 32 0.733402 0.266598 64 1.581654 0.581654 128 0.783220 0.216780 256 1.244528 0.244528 512 0.865088 0.134912 1024 1.027795 0.027795 2048 0.991664 0.008336 4096 1.015411 0.015411 8192 1.016687 0.016687 16384 1.032051 0.032051 32768 1.015792 0.015792 f(x,y) = x^(-0.2) on ((1,0),(5,0),(5,1)) 10 1.000000 123456789 1 0.386635 0.613365 2 0.705888 0.294112 4 0.304208 0.695792 8 1.722218 0.722218 16 0.515405 0.484595 32 0.766279 0.233721 64 1.793534 0.793534 128 1.153757 0.153757 256 0.941368 0.058632 512 1.051051 0.051051 1024 1.190198 0.190198 2048 0.973969 0.026031 4096 1.008220 0.008220 8192 0.963278 0.036722 16384 0.963182 0.036818 32768 0.974619 0.025381 f(x,y) = (x+y)^(-0.2) 11 1.000000 123456789 1 1.080438 0.080438 2 0.906136 0.093864 4 1.092161 0.092161 8 1.010358 0.010358 16 1.003744 0.003744 32 0.991283 0.008717 64 0.983609 0.016391 128 1.003871 0.003871 256 1.007290 0.007290 512 1.001785 0.001785 1024 0.999295 0.000705 2048 1.003253 0.003253 4096 1.002129 0.002129 8192 1.000425 0.000425 16384 0.999297 0.000703 32768 1.000118 0.000118 f(x,y) = (1-x-y)^(-0.2) on ((-1,-3),(3,-2),(-1,2)) 12 1.000000 123456789 1 0.864394 0.135606 2 0.928611 0.071389 4 1.039513 0.039513 8 0.894300 0.105700 16 0.993173 0.006827 32 0.965273 0.034727 64 0.991728 0.008272 128 0.973662 0.026338 256 1.012472 0.012472 512 0.993000 0.007000 1024 0.997507 0.002493 2048 0.999631 0.000369 4096 1.001218 0.001218 8192 0.998180 0.001820 16384 0.998602 0.001398 32768 1.000208 0.000208 f(x,y) = (x*y)^(-0.2) on ((0,0),(-7,0),(0,-3)) 13 1.000000 123456789 1 1.408532 0.408532 2 1.308889 0.308889 4 0.871657 0.128343 8 1.032542 0.032542 16 0.960688 0.039312 32 0.949518 0.050482 64 0.985777 0.014223 128 1.001582 0.001582 256 1.018372 0.018372 512 0.985099 0.014901 1024 1.020558 0.020558 2048 0.999294 0.000706 4096 0.994070 0.005930 8192 1.002674 0.002674 16384 0.998581 0.001419 32768 1.000044 0.000044 f(x,y) = 1/sqrt(x) + 1/sqrt(y) + 1/sqrt(x+y) 14 1.000000 123456789 1 0.650976 0.349024 2 0.904702 0.095298 4 1.199597 0.199597 8 0.939267 0.060733 16 0.828046 0.171954 32 1.016938 0.016938 64 1.082187 0.082187 128 0.918850 0.081150 256 1.143804 0.143804 512 1.052035 0.052035 1024 0.990697 0.009303 2048 0.979345 0.020655 4096 1.000206 0.000206 8192 1.004175 0.004175 16384 1.002787 0.002787 32768 0.998772 0.001228 f(x,y) = 1/sqrt(1-x-y) 15 1.000000 123456789 1 0.842868 0.157132 2 0.883596 0.116404 4 1.087266 0.087266 8 0.930933 0.069067 16 0.795635 0.204365 32 0.898131 0.101869 64 0.836784 0.163216 128 0.974037 0.025963 256 0.927084 0.072916 512 0.974269 0.025731 1024 1.033368 0.033368 2048 0.947378 0.052622 4096 0.992507 0.007493 8192 0.984038 0.015962 16384 0.974435 0.025565 32768 0.978139 0.021861 f(x,y) = log(x*y) 16 1.000000 123456789 1 0.805354 0.194646 2 0.887318 0.112682 4 1.120617 0.120617 8 0.939533 0.060467 16 1.096486 0.096486 32 1.053788 0.053788 64 0.956275 0.043725 128 1.075855 0.075855 256 0.953836 0.046164 512 1.003235 0.003235 1024 0.989705 0.010295 2048 1.007967 0.007967 4096 1.013754 0.013754 8192 0.999322 0.000678 16384 0.996431 0.003569 32768 0.999142 0.000858 f(x,y) = 1/sqrt(|x-1/4|) + 1/sqrt(|y-1/2|) 17 1.000000 123456789 1 1.021782 0.021782 2 1.176112 0.176112 4 0.925856 0.074144 8 1.172633 0.172633 16 1.366862 0.366862 32 0.881949 0.118051 64 0.971259 0.028741 128 1.001726 0.001726 256 0.883609 0.116391 512 0.947236 0.052764 1024 0.951910 0.048090 2048 0.992377 0.007623 4096 0.969288 0.030712 8192 0.999935 0.000065 16384 0.997925 0.002075 32768 0.994981 0.005019 f(x,y) = log ( x + y ) 18 1.000000 123456789 1 0.028277 0.971723 2 0.754416 0.245584 4 0.428221 0.571779 8 1.293270 0.293270 16 1.046713 0.046713 32 0.947426 0.052574 64 0.878333 0.121667 128 0.893922 0.106078 256 0.967668 0.032332 512 1.068955 0.068955 1024 0.994838 0.005162 2048 0.992783 0.007217 4096 1.004285 0.004285 8192 1.025949 0.025949 16384 1.009558 0.009558 32768 1.006411 0.006411 f(x,y) = sin ( x ) cos ( 5 y ) 19 1.000000 123456789 1 3.681685 2.681685 2 -3.584914 4.584914 4 -1.752243 2.752243 8 0.111275 0.888725 16 2.437950 1.437950 32 1.131828 0.131828 64 1.221516 0.221516 128 1.145745 0.145745 256 1.006787 0.006787 512 1.176659 0.176659 1024 0.980583 0.019417 2048 1.064590 0.064590 4096 0.981832 0.018168 8192 1.031065 0.031065 16384 1.012265 0.012265 32768 0.999113 0.000887 f(x,y) = sin ( 11 x ) cos ( y ) 20 1.000000 123456789 1 -4.258046 5.258046 2 -1.363296 2.363296 4 2.383880 1.383880 8 1.280517 0.280517 16 0.783615 0.216385 32 0.711257 0.288743 64 1.274061 0.274061 128 1.272302 0.272302 256 0.816612 0.183388 512 1.193954 0.193954 1024 1.059091 0.059091 2048 0.909365 0.090635 4096 1.032331 0.032331 8192 1.019069 0.019069 16384 1.000803 0.000803 32768 0.974653 0.025347 f(x,y) = 1 / r = 1 / sqrt ( x^2 + y^2 ) 21 1.000000 123456789 1 0.603916 0.396084 2 0.979375 0.020625 4 1.447920 0.447920 8 0.881714 0.118286 16 0.962147 0.037853 32 0.887268 0.112732 64 0.899703 0.100297 128 0.977888 0.022112 256 1.004790 0.004790 512 1.040603 0.040603 1024 1.045389 0.045389 2048 0.997640 0.002360 4096 1.015883 0.015883 8192 1.032836 0.032836 16384 1.022270 0.022270 32768 0.995534 0.004466 f(x,y) = log ( r ) / r 22 1.000000 123456789 1 0.179385 0.820615 2 0.133042 0.866958 4 0.496203 0.503797 8 1.039859 0.039859 16 0.818068 0.181932 32 0.749499 0.250501 64 0.686706 0.313294 128 0.613429 0.386571 256 1.090402 0.090402 512 0.835667 0.164333 1024 0.877531 0.122469 2048 0.840055 0.159945 4096 1.024722 0.024722 8192 0.901320 0.098680 16384 1.001079 0.001079 32768 1.012699 0.012699 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. 31-Mar-2019 14:45:03