Wed Oct 8 09:07:47 2025 triangle_monte_carlo_tests() python version: 3.10.12 numpy version: 1.26.4 Test triangle_monte_carlo(). reference_to_physical_t3_test: reference_to_physical_t3 maps points in a reference triangle to points in a physical triangle. XY triangle vertices: Row: 0 1 Col 0 : 2 0 1 : 3 4 2 : 0 3 Apply map to RS triangle vertices. Recover XY vertices (2,0), (3,4) and (0,3). V(0) = ( 2, 0 ) V(1) = ( 3, 4 ) V(2) = ( 0, 3 ) triangle01_sample_test triangle01_sample samples the unit triangle. Triangle vertices: Row: 0 1 Col 0 : 0 1 1 : 0 0 2 : 1 0 Sample points: Row: 0 1 Col 0 : 0.0102763 0.46774 1 : 0.709126 0.152661 2 : 0.536033 0.377459 3 : 0.663283 0.31492 4 : 0.102067 0.2839 5 : 0.0398157 0.365116 6 : 0.35359 0.0291975 7 : 0.621768 0.191939 8 : 0.602049 0.0863767 9 : 0.614234 0.325572 triangle_monte_carlo_test triangle_monte_carlo estimates an integral over a general triangle using the Monte Carlo method. Triangle vertices: Row: 0 1 Col 0 : 2 0 1 : 3 4 2 : 0 3 N 1 X Y X^2 XY Y^2 X^3 1 171.357 313.824 19.6906 40.5793 26.448 301.454 117.529 2 477.629 259.274 155.776 51.0512 145.819 118.131 224.882 4 57.494 129.887 128.244 225.349 148.753 279.186 98.4328 8 144.53 134.58 180.555 227.499 125.191 50.3093 131.591 16 96.0383 143.387 138.135 107.717 185.446 181.59 101.959 32 147.214 132.735 201.157 131.003 144.711 136.102 177.003 64 164.872 204.125 199.913 148.956 145.987 144.494 144.163 128 175.817 144.237 161.22 200.113 190.979 145.249 172.147 256 175.963 170.049 164.491 156.415 171.787 163.573 190.81 512 173.445 167.84 159.171 157.481 167.363 166.241 164.48 1024 166.031 178.512 169.965 165.446 172.665 174.016 164.385 2048 169.149 168.497 171.997 172.85 171.295 171.951 172.07 4096 169.198 167.431 173.581 170.918 170.864 169.437 171.859 8192 167.824 168.596 168.49 169.167 168.615 170.246 170.146 16384 169.604 169.494 169 171.551 167.983 171.006 169.367 32768 170.205 166.949 170.537 170.199 168.415 170.961 169.965 65536 168.523 169.644 170.424 170.012 170.542 169.471 169.981 triangle_monte_carlo_test01 Integrate xy^3 Integration region is the unit triangle. Use an increasing number of points N. N XY^3 1 0.000487 2 0.000663 4 0.004023 8 0.005052 16 0.004631 32 0.007423 64 0.009621 128 0.007875 256 0.009179 512 0.007885 1024 0.008743 2048 0.008319 4096 0.008109 8192 0.008173 16384 0.008391 32768 0.008326 65536 0.008310 Triangle vertices: Row: 0 1 Col 0 : 2 0 1 : 3 4 2 : 0 3 triangle_monte_carlo_test02 Integrate xy^3 Integration region is a general triangle. Use an increasing number of points N. N XY^3 1 637.891202 2 198.156976 4 130.223517 8 284.167432 16 129.581876 32 116.775813 64 184.314705 128 181.068761 256 187.357016 512 159.458696 1024 173.422208 2048 172.984246 4096 167.253023 8192 168.936320 16384 167.858669 32768 168.648229 65536 168.985874 triangle_monte_carlo_tests(): Normal end of execution. Wed Oct 8 09:07:56 2025