Tue May 20 22:43:22 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.279139 0.0595132 1 : 0.0730818 0.107628 2 : 0.018266 0.703274 3 : 0.227055 0.392132 4 : 0.364659 0.63168 5 : 0.213485 0.674315 6 : 0.033391 0.578838 7 : 0.472779 0.504338 8 : 0.388748 0.59646 9 : 0.337443 0.229936 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 36.0692 37.0488 330.435 76.2309 16.9078 14.0737 808.475 2 138.42 47.8607 124.462 512.998 119.389 320.365 290.275 4 68.3535 324.34 237.284 103.125 57.2948 44.2445 56.0138 8 110.846 214.787 127.877 144.319 119.983 247.698 198.724 16 153.681 246.398 127.405 222.627 196.284 173.659 133.24 32 150.159 165.897 143.928 197.518 156.006 215.117 141.011 64 136.028 187.671 118.893 211.478 178.874 206.35 195.676 128 177.575 155.8 175.907 180.209 157.187 191.75 168.011 256 174.625 170.802 184.486 150.686 159.354 179.6 176.25 512 154.708 180.897 155.606 175.994 162.934 191.544 170.97 1024 179.607 171.686 174.536 158.936 176.262 176.266 178.644 2048 172.865 164.111 168.81 166.408 170.747 173.102 172.069 4096 173.183 173.257 166.721 171.5 174.25 175.994 167.038 8192 172.365 168.972 166.478 169.97 173.744 167.881 174.191 16384 168.48 170.222 168.695 169.286 171.68 167.218 168.095 32768 170.368 169.03 167.747 171.545 170.358 170.111 169.048 65536 168.218 169.39 168.871 169.349 169.714 171.036 168.463 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.007972 2 0.016278 4 0.015005 8 0.011948 16 0.009390 32 0.006653 64 0.008976 128 0.010247 256 0.008546 512 0.008000 1024 0.009145 2048 0.007856 4096 0.008234 8192 0.008300 16384 0.008198 32768 0.008258 65536 0.008433 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 41.642347 2 287.963635 4 190.130054 8 112.550252 16 89.318569 32 204.066885 64 214.344756 128 191.576846 256 166.735515 512 165.701510 1024 159.362435 2048 159.934727 4096 171.495746 8192 172.133114 16384 169.752264 32768 170.396796 65536 168.011186 triangle_monte_carlo_tests(): Normal end of execution. Tue May 20 22:43:31 2025