Tue May 20 22:31:38 2025 simplex_monte_carlo_test(): python version: 3.10.12 numpy version: 1.26.4 Test simplex_monte_carlo(). simplex_general_sample_test simplex_general_sample computes a Monte Carlo estimate of an integral over the interior of a general simplex in 3D. Simplex vertices: 1 0 0 2 0 0 1 2 0 1 0 3 N 1 X Y Z X^2 XY XZ Y^2 YZ Z^2 1 1 1.0935 0.284263 1.52427 1.19574 0.310841 1.66679 0.0808052 0.433294 2.32341 2 1 1.29285 0.876449 0.465449 1.67158 1.13581 0.597399 0.831458 0.305538 0.382324 4 1 1.32513 0.25634 0.947134 1.78919 0.313381 1.30606 0.0921725 0.201744 1.02681 8 1 1.32501 0.388563 0.88791 1.83149 0.470517 1.06393 0.26298 0.325242 1.18432 16 1 1.2889 0.328904 0.687707 1.70288 0.409707 0.897041 0.214764 0.160231 0.73647 32 1 1.2014 0.50572 0.781936 1.47016 0.602746 0.907509 0.337402 0.326795 0.975058 64 1 1.25111 0.506885 0.845541 1.59947 0.608434 1.01708 0.408282 0.321033 1.13416 128 1 1.27002 0.554177 0.682922 1.64979 0.66481 0.835188 0.484479 0.314865 0.733436 256 1 1.24955 0.465948 0.813033 1.60185 0.560221 0.966348 0.358301 0.288641 1.04145 512 1 1.25418 0.478968 0.742881 1.61274 0.576875 0.894297 0.379064 0.280026 0.900094 1024 1 1.24417 0.490504 0.772739 1.58563 0.588753 0.921127 0.387425 0.292385 0.95953 2048 1 1.24697 0.507778 0.742892 1.59153 0.609849 0.891517 0.414554 0.289212 0.901923 4096 1 1.24946 0.502595 0.752087 1.59763 0.60304 0.903778 0.398213 0.301553 0.908018 8192 1 1.2483 0.494325 0.762995 1.59511 0.593557 0.914101 0.389356 0.301199 0.928871 16384 1 1.25057 0.500077 0.753539 1.6017 0.599994 0.904026 0.399196 0.303972 0.908355 32768 1 1.25012 0.503064 0.748587 1.60033 0.60353 0.898496 0.403925 0.3015 0.896097 65536 1 1.24963 0.500285 0.750324 1.59917 0.600198 0.900181 0.400235 0.300298 0.900686 simplex_unit_monomial_integral_test(): Estimate monomial integrals using Monte Carlo over the interior of the unit simplex in M dimensions. Number of sample points used is 4192 We randomly choose the exponents. Ex Ey Ez MC-Estimate Exact Error 1 1 1 0.00139157 0.00138889 2.7e-06 3 4 0 3.92104e-05 3.96825e-05 4.7e-07 2 2 4 2.41978e-06 2.405e-06 1.5e-08 2 0 1 0.00270768 0.00277778 7e-05 3 4 2 6.02089e-07 6.01251e-07 8.4e-10 1 3 0 0.00120815 0.00119048 1.8e-05 2 3 0 0.000298726 0.000297619 1.1e-06 2 2 1 9.92301e-05 9.92063e-05 2.4e-08 2 2 2 2.21234e-05 2.20459e-05 7.8e-08 4 1 2 1.32327e-05 1.32275e-05 5.2e-09 4 1 0 0.000589838 0.000595238 5.4e-06 2 3 4 6.03606e-07 6.01251e-07 2.4e-09 4 4 0 1.40703e-05 1.443e-05 3.6e-07 3 4 2 6.02089e-07 6.01251e-07 8.4e-10 4 4 2 1.84864e-07 1.85e-07 1.4e-10 2 3 4 6.03606e-07 6.01251e-07 2.4e-09 2 0 1 0.00270768 0.00277778 7e-05 2 3 2 6.62682e-06 6.61376e-06 1.3e-08 0 1 1 0.00838326 0.00833333 5e-05 4 2 3 6.0577e-07 6.01251e-07 4.5e-09 simplex_unit_sample_test00 simplex_unit_sample samples the unit simplex in M dimensions. Sample points in the unit simplex. Row: 0 1 2 Col 0 : 0.198248 0.286114 0.0829234 1 : 0.111297 0.260284 0.597635 2 : 0.169284 0.247698 0.178726 3 : 0.368064 0.148901 0.0706824 4 : 0.400597 0.15233 0.435205 5 : 0.0232622 0.64092 0.0322168 6 : 0.0205665 0.30454 0.506926 7 : 0.00431277 0.230527 0.227203 8 : 0.00760419 0.0882654 0.14873 9 : 0.244851 0.541438 0.207432 simplex_unit_sample_test01 simplex_unit_sample computes a Monte Carlo estimate of an integral over the interior of the unit simplex in 3D. N 1 X Y Z X^2 XY XZ Y^2 YZ Z^2 1 0.166667 0.00861322 0.0401555 0.0690904 0.000445126 0.00207521 0.00357054 0.00967478 0.0166461 0.0286409 2 0.166667 0.0197543 0.0613794 0.0617502 0.00237968 0.00765385 0.00685268 0.0263523 0.018128 0.028557 4 0.166667 0.0536881 0.033285 0.0560512 0.0213945 0.0102626 0.0153726 0.00973337 0.0099472 0.0214006 8 0.166667 0.0545575 0.0543053 0.027913 0.0204619 0.0169515 0.00790665 0.020239 0.0091528 0.0061912 16 0.166667 0.0444475 0.0371103 0.0384928 0.0171445 0.00755617 0.0108064 0.0151678 0.00618325 0.0139129 32 0.166667 0.0403796 0.0367954 0.0437827 0.0150639 0.00707875 0.00866898 0.0145976 0.00662499 0.0198021 64 0.166667 0.0448808 0.0409975 0.0446916 0.0183576 0.0095843 0.0088461 0.0160254 0.00872717 0.0184726 128 0.166667 0.0372207 0.0410564 0.0440963 0.0132482 0.0076062 0.00918062 0.0165169 0.00743795 0.017949 256 0.166667 0.0435744 0.0406754 0.0413894 0.0174264 0.0085615 0.00864663 0.0168286 0.00773849 0.0172225 512 0.166667 0.0405442 0.0415835 0.0418024 0.0158552 0.0081705 0.0083351 0.0165359 0.00826776 0.0166817 1024 0.166667 0.0412012 0.0417774 0.0422843 0.0168008 0.00809639 0.00829039 0.0166343 0.00865486 0.0169744 2048 0.166667 0.0428424 0.0411951 0.0408915 0.0174322 0.00860734 0.00829159 0.01595 0.00838984 0.0160944 4096 0.166667 0.0412849 0.0414427 0.0413596 0.0165567 0.00810063 0.00810326 0.0167086 0.00826914 0.0164721 8192 0.166667 0.0417364 0.0417967 0.0418833 0.0167672 0.00830626 0.00832252 0.0167864 0.00839956 0.0168653 16384 0.166667 0.0415957 0.0414541 0.0419777 0.0165883 0.00829446 0.0083654 0.0165616 0.00831162 0.0169103 32768 0.166667 0.0416956 0.0411839 0.041994 0.0166986 0.00832264 0.00837288 0.0163098 0.00826899 0.0169107 65536 0.166667 0.0416463 0.0417182 0.0417882 0.0166644 0.00834883 0.00832927 0.016693 0.00836379 0.0167846 Exact 0.166667 0.0416667 0.0416667 0.0416667 0.0166667 0.00833333 0.00833333 0.0166667 0.00833333 0.0166667 simplex_unit_sample_test02 simplex_unit_sample computes a Monte Carlo estimate of an integral over the interior of the unit simplex in 6D. N 1 U V^2 V^2W^2 X^4 Y^2Z^2 Z^6 1 0.00138889 0.000231938 5.01372e-05 2.92529e-06 3.93537e-09 1.01901e-10 5.4186e-14 2 0.00138889 1.5121e-05 0.000274352 1.62635e-06 4.41851e-07 1.93685e-11 1.71878e-08 4 0.00138889 0.000150339 5.89229e-05 5.6527e-06 2.53949e-06 5.61976e-09 3.12946e-10 8 0.00138889 0.000194146 4.23725e-05 2.42887e-06 1.61487e-06 2.00891e-08 1.40927e-06 16 0.00138889 0.000156488 2.26262e-05 7.36573e-07 3.12163e-06 1.25367e-08 1.17413e-07 32 0.00138889 0.000201304 4.24197e-05 8.14715e-07 1.82847e-05 7.81668e-09 4.14656e-08 64 0.00138889 0.000179323 5.64665e-05 1.08923e-06 2.8399e-06 1.51356e-08 3.58684e-06 128 0.00138889 0.00017665 4.47318e-05 1.53486e-06 5.72488e-06 1.56508e-08 1.17805e-06 256 0.00138889 0.00020315 4.15822e-05 7.93615e-07 6.43436e-06 1.48602e-08 2.05368e-06 512 0.00138889 0.00019283 5.41175e-05 1.26691e-06 6.29026e-06 2.08017e-08 1.19185e-06 1024 0.00138889 0.000191886 4.86868e-05 1.09847e-06 6.94378e-06 1.66123e-08 1.44278e-06 2048 0.00138889 0.000199948 4.85465e-05 9.69972e-07 5.95835e-06 1.59208e-08 1.67761e-06 4096 0.00138889 0.000200599 4.87482e-05 1.04584e-06 6.29365e-06 1.82663e-08 1.28617e-06 8192 0.00138889 0.00020037 4.79346e-05 1.0888e-06 6.80108e-06 1.70007e-08 1.51897e-06 16384 0.00138889 0.000198449 4.94797e-05 1.11297e-06 6.92869e-06 1.65595e-08 1.45704e-06 32768 0.00138889 0.000200311 4.91544e-05 1.104e-06 6.39533e-06 1.73025e-08 1.48866e-06 65536 0.00138889 0.000197449 4.99001e-05 1.10119e-06 6.58982e-06 1.67966e-08 1.45398e-06 Exact 0.00138889 0.000198413 4.96032e-05 1.10229e-06 6.61376e-06 1.67014e-08 1.50313e-06 simplex_unit_to_general_test01 simplex_unit_to_general maps points in the unit simplex to a general simplex. Here we consider a simplex in 2D, a triangle. The vertices of the general triangle are: 1.0000 1.0000 3.0000 1.0000 2.0000 5.0000 ( XSI ETA ) ( X Y ) 0.0000 0.0000 1.0000 1.0000 1.0000 0.0000 3.0000 1.0000 0.0000 1.0000 2.0000 5.0000 0.4081 0.4374 2.2537 2.7497 0.4679 0.0595 1.9953 1.2378 0.1153 0.0790 1.3097 1.3162 0.5565 0.2659 2.3788 2.0635 0.6953 0.2502 2.6409 2.0008 0.0341 0.4694 1.5376 2.8776 0.0340 0.6781 1.7461 3.7125 0.2628 0.6337 2.1593 3.5348 0.8042 0.0796 2.6880 1.3185 0.2282 0.4044 1.8607 2.6175 simplex_unit_to_general_test02 simplex_unit_to_general maps points in the unit simplex to a general simplex. Here we consider a simplex in 3D, a tetrahedron. The vertices of the general tetrahedron are: 1.0000 1.0000 1.0000 3.0000 1.0000 1.0000 1.0000 4.0000 1.0000 1.0000 1.0000 5.0000 ( XSI ETA ) ( X Y ) 0.0000 0.0000 0.0000 1.0000 1.0000 1.0000 1.0000 0.0000 0.0000 3.0000 1.0000 1.0000 0.0000 1.0000 0.0000 1.0000 4.0000 1.0000 0.0000 0.0000 1.0000 1.0000 1.0000 5.0000 0.0502 0.2606 0.2903 1.1004 1.7818 2.1614 0.0590 0.0640 0.5822 1.1180 1.1921 3.3288 0.1479 0.0525 0.6989 1.2958 1.1575 3.7957 0.0334 0.7313 0.1529 1.0667 3.1938 1.6116 0.0020 0.3078 0.6805 1.0039 1.9234 3.7221 0.1842 0.2802 0.3544 1.3685 1.8405 2.4175 0.2773 0.3603 0.0075 1.5546 2.0810 1.0302 0.1893 0.0309 0.5782 1.3786 1.0928 3.3126 0.2105 0.4932 0.2652 1.4210 2.4796 2.0610 0.4596 0.2687 0.1402 1.9191 1.8062 1.5608 simplex_unit_volume_test simplex_unit_volume returns the volume of the unit simplex in M dimensions. M Volume 1 1 2 0.5 3 0.166667 4 0.0416667 5 0.00833333 6 0.00138889 7 0.000198413 8 2.48016e-05 9 2.75573e-06 simplex_monte_carlo_test(): Normal end of execution. Tue May 20 22:31:44 2025