Tue May 20 22:32:20 2025 sphere_monte_carlo_tests(): python version: 3.10.12 numpy version: 1.26.4 Test sphere_monte_carlo(). sphere01_area_test sphere01_area returns the volume of the unit sphere. sphere01_area() = 12.5664 sphere01_monomial_integral_test(): sphere01_monomial_integral() returns the integral of a monomial over the surface of the unit sphere in 3D. Compare with a Monte Carlo estimate. If any exponent is odd, the integral is zero. We will restrict this test to randomly chosen even exponents. Ex Ey Ez MC-Estimate Exact Error 0 2 6 0.204785 0.199466 0.0053 0 2 6 0.204785 0.199466 0.0053 2 0 6 0.202461 0.199466 0.003 2 2 6 0.018272 0.0181333 0.00014 8 0 0 1.36234 1.39626 0.034 2 8 2 0.00957838 0.00976408 0.00019 0 8 2 0.122632 0.126933 0.0043 6 0 8 0.00986041 0.00976408 9.6e-05 2 2 2 0.120033 0.11968 0.00035 4 6 0 0.0542115 0.0543999 0.00019 6 0 8 0.00986041 0.00976408 9.6e-05 4 0 2 0.362845 0.359039 0.0038 6 2 4 0.00430522 0.00418461 0.00012 0 0 0 12.5664 12.5664 1.8e-15 8 0 0 1.36234 1.39626 0.034 0 6 0 1.77471 1.7952 0.02 6 0 2 0.201195 0.199466 0.0017 2 4 6 0.00418095 0.00418461 3.7e-06 6 2 6 0.001438 0.00139487 4.3e-05 4 8 8 3.00075e-05 3.02293e-05 2.2e-07 sphere01_monte_carlo_test Use sphere01_sample to estimate integrals over the surface of the unit sphere. N 1 X^2 Y^2 Z^2 X^4 X^2Y^2 Z^4 1 12.566371 0.007340 0.281024 12.278006 0.000004 0.000164 11.996259 2 12.566371 3.821051 3.200734 5.544586 2.013793 0.141348 2.446876 4 12.566371 6.027210 1.388245 5.150915 4.090374 0.632637 3.432867 8 12.566371 8.267228 2.444276 1.854867 6.038552 1.238070 0.561098 16 12.566371 4.292690 5.036017 3.237664 2.544546 0.972492 1.611650 32 12.566371 4.041725 4.698238 3.826407 2.219129 0.941456 2.275900 64 12.566371 4.765785 4.390636 3.409949 3.102703 0.895261 1.891548 128 12.566371 3.668575 4.761404 4.136391 2.170540 0.803021 2.575187 256 12.566371 4.018769 4.678618 3.868984 2.270358 0.914343 2.133854 512 12.566371 4.283171 4.241879 4.041320 2.576587 0.835591 2.344730 1024 12.566371 4.078818 4.441682 4.045871 2.388481 0.894478 2.399478 2048 12.566371 4.177511 4.218352 4.170508 2.533934 0.841010 2.510101 4096 12.566371 4.158704 4.184228 4.223439 2.514943 0.810816 2.548204 8192 12.566371 4.189312 4.163756 4.213303 2.515580 0.834207 2.531545 16384 12.566371 4.162385 4.206183 4.197802 2.484207 0.843261 2.524200 32768 12.566371 4.181712 4.182222 4.202436 2.505631 0.836980 2.521658 65536 12.566371 4.193426 4.182582 4.190363 2.522095 0.836038 2.516624 Exact 12.566371 4.188790 4.188790 4.188790 2.513274 0.837758 2.513274 sphere01_sample_test sphere01_sample samples the unit sphere. Sample points on the unit sphere. Row: 0 1 2 Col 0 : -0.54492 0.513746 -0.662667 1 : -0.118907 0.879265 0.461253 2 : -0.719694 -0.527497 -0.451428 3 : -0.458876 -0.11461 0.881077 4 : -0.25102 0.0947745 -0.963331 5 : 0.191345 -0.653891 -0.731993 6 : -0.996936 0.00416389 0.0781097 7 : 0.901873 0.310686 -0.300166 8 : -0.723839 -0.515142 0.459006 9 : -0.666029 -0.62434 -0.408172 sphere_monte_carlo_tests(): Normal end of execution. Tue May 20 22:32:21 2025