Wed Oct 8 08:55:12 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.32694 0.0364073 1.28893 1.76078 0.0483105 1.71034 0.00132549 0.0469267 1.66135 2 1 1.19357 0.28241 0.899385 1.42528 0.340795 1.05738 0.100464 0.164359 1.19688 4 1 1.2377 0.326834 0.718679 1.57446 0.403631 0.840157 0.129499 0.258897 0.722295 8 1 1.24043 0.46351 0.757913 1.58377 0.527239 0.925421 0.409481 0.305308 0.687796 16 1 1.31579 0.352325 0.810016 1.76731 0.449689 1.0437 0.177453 0.2668 0.860119 32 1 1.23292 0.612731 0.705229 1.55205 0.740319 0.823942 0.541049 0.318595 0.828411 64 1 1.25712 0.594373 0.697102 1.62146 0.707551 0.839832 0.555478 0.304973 0.855463 128 1 1.23301 0.508717 0.753059 1.55003 0.607734 0.900814 0.42222 0.299646 0.865907 256 1 1.26174 0.533692 0.716266 1.63145 0.646546 0.867263 0.442962 0.300533 0.858401 512 1 1.24382 0.533413 0.742912 1.58017 0.637348 0.895026 0.455455 0.30637 0.885034 1024 1 1.25742 0.500437 0.709128 1.62009 0.603859 0.853726 0.395177 0.291637 0.80343 2048 1 1.24909 0.502173 0.750901 1.5982 0.600891 0.900271 0.395394 0.311477 0.892743 4096 1 1.2537 0.494147 0.748613 1.60897 0.596022 0.899459 0.390901 0.299482 0.892564 8192 1 1.25209 0.5002 0.741325 1.60576 0.5999 0.890242 0.40057 0.300483 0.875561 16384 1 1.25357 0.498496 0.743466 1.60938 0.600016 0.89391 0.396348 0.29802 0.886148 32768 1 1.24974 0.499423 0.75033 1.5997 0.598824 0.899984 0.398781 0.300569 0.899788 65536 1 1.25087 0.498209 0.74636 1.60226 0.597967 0.896221 0.398219 0.297939 0.89324 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 2 1 1 0.000393823 0.000396825 3e-06 2 3 1 3.36855e-05 3.30688e-05 6.2e-07 0 1 2 0.00280419 0.00277778 2.6e-05 3 4 0 4.21365e-05 3.96825e-05 2.5e-06 4 2 4 1.66363e-07 1.85e-07 1.9e-08 0 4 1 0.000577277 0.000595238 1.8e-05 2 0 3 0.000286367 0.000297619 1.1e-05 3 2 0 0.000309807 0.000297619 1.2e-05 2 3 1 3.36855e-05 3.30688e-05 6.2e-07 3 4 3 1.3093e-07 1.3875e-07 7.8e-09 0 0 3 0.00828568 0.00833333 4.8e-05 1 4 3 3.50946e-06 3.6075e-06 9.8e-08 0 3 4 4.18026e-05 3.96825e-05 2.1e-06 1 0 2 0.00269481 0.00277778 8.3e-05 4 2 2 2.35024e-06 2.405e-06 5.5e-08 3 2 4 5.38984e-07 6.01251e-07 6.2e-08 1 1 4 6.36775e-05 6.61376e-05 2.5e-06 3 1 2 3.18847e-05 3.30688e-05 1.2e-06 2 4 2 2.3697e-06 2.405e-06 3.5e-08 0 2 3 0.000306262 0.000297619 8.6e-06 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.635531 0.256855 0.0584367 1 : 0.0455644 0.136997 0.118841 2 : 0.358947 0.0424347 0.59814 3 : 0.688322 0.192977 0.0395373 4 : 0.00165945 0.112394 0.722843 5 : 0.646876 0.211014 0.0227099 6 : 0.0266862 0.288497 0.566108 7 : 0.20319 0.000311883 0.53227 8 : 0.125852 0.102768 0.464643 9 : 0.0416231 0.293759 0.0237619 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.0682974 0.0354417 0.021937 0.0279872 0.0145234 0.00898943 0.00753668 0.0046649 0.00288739 2 0.166667 0.0640327 0.022802 0.0295061 0.0382343 0.00656499 0.00369405 0.00347312 0.00526743 0.00950741 4 0.166667 0.0545244 0.0171136 0.0555846 0.0219194 0.00667853 0.0167732 0.00258042 0.00479292 0.019571 8 0.166667 0.0476902 0.0345585 0.0519443 0.0189295 0.00788917 0.0109748 0.0100019 0.0103281 0.0233487 16 0.166667 0.0442457 0.0548825 0.0286641 0.0163826 0.0123354 0.00617866 0.024827 0.00922147 0.00722631 32 0.166667 0.0452957 0.0318126 0.0407213 0.0190348 0.00643996 0.00968496 0.0132345 0.00522671 0.0144368 64 0.166667 0.0411963 0.039881 0.0413001 0.0161958 0.00865123 0.00900589 0.0144052 0.00797491 0.0156349 128 0.166667 0.0402855 0.0426922 0.0416377 0.0160104 0.00811322 0.00853984 0.0174314 0.0088715 0.015728 256 0.166667 0.0406581 0.041072 0.0431997 0.0156825 0.00817651 0.00854725 0.0162604 0.00837331 0.0174853 512 0.166667 0.0398397 0.0408136 0.0428071 0.0150864 0.00804303 0.00829319 0.0165369 0.00800299 0.0172974 1024 0.166667 0.0419177 0.0422314 0.0402312 0.0170024 0.00837988 0.0083233 0.017249 0.00798559 0.0156283 2048 0.166667 0.0418319 0.0410036 0.0412154 0.0171314 0.00818035 0.00824974 0.0162893 0.00809172 0.0164127 4096 0.166667 0.0414795 0.0423519 0.0412826 0.0166899 0.00840493 0.00815409 0.0172572 0.00837015 0.0163466 8192 0.166667 0.0410796 0.0423536 0.0417749 0.0163567 0.0082838 0.00823318 0.0172598 0.00840575 0.0168179 16384 0.166667 0.0417335 0.0423126 0.0410921 0.0166737 0.00845621 0.00826569 0.0170902 0.00837527 0.016256 32768 0.166667 0.0415358 0.0419659 0.0418501 0.0165972 0.00836534 0.00832391 0.0168777 0.00840426 0.0167954 65536 0.166667 0.041414 0.0417671 0.0418191 0.0165239 0.00830997 0.00827076 0.0167108 0.00839177 0.0167694 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.000148104 0.000517098 1.60449e-07 1.92774e-07 3.79074e-10 3.47547e-10 2 0.00138889 0.000139915 2.76862e-05 3.02668e-08 5.67104e-06 9.66671e-09 2.43835e-10 4 0.00138889 0.000278079 4.84983e-05 2.56258e-06 2.76547e-07 1.06468e-08 4.521e-08 8 0.00138889 0.000264263 2.05628e-05 5.71206e-07 1.14827e-05 3.95592e-09 4.82459e-09 16 0.00138889 0.000163358 2.49179e-05 4.91697e-07 2.65919e-06 7.34438e-09 5.51233e-07 32 0.00138889 0.000224041 5.1131e-05 1.44061e-06 1.50416e-05 1.36659e-08 6.41502e-08 64 0.00138889 0.000203367 5.34949e-05 1.03173e-06 6.39992e-06 1.1851e-08 2.31133e-06 128 0.00138889 0.000198871 5.60582e-05 1.29401e-06 7.44476e-06 2.36679e-08 2.24869e-06 256 0.00138889 0.000208067 4.81203e-05 1.10813e-06 7.7735e-06 2.10597e-08 1.76381e-06 512 0.00138889 0.000194654 5.50297e-05 1.31186e-06 5.45276e-06 1.59359e-08 1.17177e-06 1024 0.00138889 0.000202536 5.02406e-05 1.06004e-06 6.36283e-06 1.8563e-08 1.99703e-06 2048 0.00138889 0.000202919 4.93541e-05 1.0354e-06 6.67175e-06 1.60293e-08 1.33203e-06 4096 0.00138889 0.00019988 4.79215e-05 1.05821e-06 6.72307e-06 1.67141e-08 1.57284e-06 8192 0.00138889 0.000196497 4.89601e-05 1.08974e-06 6.54454e-06 1.6376e-08 1.39088e-06 16384 0.00138889 0.00019884 4.96302e-05 1.10662e-06 6.62014e-06 1.66659e-08 1.49819e-06 32768 0.00138889 0.000198209 5.00278e-05 1.11658e-06 6.58121e-06 1.6974e-08 1.43366e-06 65536 0.00138889 0.000199299 4.96211e-05 1.09933e-06 6.56133e-06 1.6705e-08 1.52099e-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.3885 0.2747 2.0517 2.0988 0.0643 0.9128 2.0414 4.6513 0.1081 0.0562 1.2724 1.2246 0.2895 0.0927 1.6717 1.3710 0.0113 0.1206 1.1432 1.4824 0.4166 0.0640 1.8972 1.2560 0.2999 0.5193 2.1190 3.0770 0.0496 0.5019 1.6010 3.0075 0.5108 0.1871 2.2088 1.7485 0.7162 0.1905 2.6229 1.7620 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.0738 0.1510 0.6977 1.1477 1.4530 3.7908 0.0292 0.2390 0.5969 1.0585 1.7169 3.3877 0.3907 0.1236 0.3665 1.7814 1.3708 2.4661 0.3185 0.0395 0.1560 1.6369 1.1186 1.6241 0.0487 0.6330 0.2093 1.0974 2.8990 1.8370 0.3278 0.4240 0.2320 1.6556 2.2720 1.9278 0.3629 0.0650 0.5159 1.7258 1.1950 3.0635 0.3915 0.0080 0.0857 1.7830 1.0241 1.3430 0.1539 0.0394 0.2129 1.3079 1.1183 1.8515 0.0144 0.2053 0.3409 1.0289 1.6158 2.3634 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. Wed Oct 8 08:55:18 2025