Tue Oct 19 11:53:24 2021 hypercube_monte_carlo_test(): Python version: 3.6.9 Test hypercube_monte_carlo(). hypercube01_monomial_integral_test Python version: 3.6.9 hypercube01_monomial_integral returns the integral of a monomial over the interior of the unit hypercube in 3D. Compare with a Monte Carlo estimate. Using M = 3 Number of sample points used is 4192 Ex Ey Ez MC-Estimate Exact Error 0 3 1 0.128202 0.125 0.0032 3 0 4 0.0514355 0.05 0.0014 1 0 2 0.166504 0.166667 0.00016 4 3 0 0.0548274 0.05 0.0048 2 0 1 0.168942 0.166667 0.0023 4 2 4 0.015097 0.0133333 0.0018 3 4 3 0.0142335 0.0125 0.0017 4 0 0 0.205993 0.2 0.006 0 4 3 0.0524222 0.05 0.0024 4 2 4 0.015097 0.0133333 0.0018 3 0 4 0.0514355 0.05 0.0014 3 2 1 0.0448358 0.0416667 0.0032 1 4 0 0.107714 0.1 0.0077 4 0 4 0.041658 0.04 0.0017 1 2 2 0.0581126 0.0555556 0.0026 4 2 1 0.0362253 0.0333333 0.0029 3 0 0 0.256809 0.25 0.0068 1 0 3 0.124614 0.125 0.00039 0 2 3 0.0847434 0.0833333 0.0014 3 1 1 0.0659202 0.0625 0.0034 hypercube01_monomial_integral_test: Normal end of execution. hypercube01_monte_carlo_test01 Python version: 3.6.9 Use hypercube01_sample to estimate integrals along the interior of the unit hypercube in 3D. N 1 X Y Z X^2 XY XZ Y^2 YZ Z^2 1 1 0.837401 0.691217 0.656537 0.701241 0.578826 0.549785 0.477781 0.453809 0.431041 2 1 0.204979 0.458666 0.398297 0.046245 0.0827113 0.0782174 0.240599 0.191842 0.161415 4 1 0.702814 0.733099 0.501996 0.559963 0.533662 0.3867 0.554428 0.3627 0.287991 8 1 0.585139 0.538918 0.674699 0.436344 0.365229 0.392373 0.401921 0.370157 0.476958 16 1 0.555069 0.412229 0.474909 0.364505 0.228969 0.257711 0.240082 0.203323 0.291943 32 1 0.446664 0.493163 0.492236 0.286011 0.234034 0.226395 0.33134 0.239396 0.326882 64 1 0.438892 0.503752 0.467446 0.275778 0.238896 0.186313 0.344882 0.240854 0.312466 128 1 0.498375 0.522531 0.457357 0.331412 0.252624 0.22515 0.371105 0.241995 0.291604 256 1 0.511785 0.458537 0.507368 0.348661 0.237417 0.259159 0.293747 0.242638 0.34398 512 1 0.486689 0.512548 0.488243 0.319735 0.245353 0.239987 0.346921 0.248459 0.320658 1024 1 0.492103 0.488506 0.484422 0.325882 0.239362 0.234081 0.31954 0.233626 0.317005 2048 1 0.503634 0.497964 0.492744 0.335038 0.250699 0.24937 0.326473 0.242634 0.325012 4096 1 0.503061 0.495839 0.495487 0.335327 0.250293 0.249006 0.328967 0.248148 0.32814 8192 1 0.494872 0.498927 0.502769 0.327562 0.24736 0.248584 0.331132 0.250367 0.336434 16384 1 0.499252 0.49757 0.500687 0.333724 0.24679 0.24962 0.332139 0.248706 0.333649 32768 1 0.502272 0.499761 0.500264 0.336197 0.251024 0.251753 0.333334 0.250788 0.333486 65536 1 0.499231 0.500376 0.500656 0.332958 0.249993 0.249813 0.333943 0.25075 0.334103 Exact 1 0.5 0.5 0.5 0.333333 0.25 0.25 0.333333 0.25 0.333333 hypercube01_monte_carlo_test01 Normal end of execution. hypercube01_monte_carlo_test02 Python version: 3.6.9 Use hypercube01_sample to estimate integrals along the interior of the unit hypercube in 6D. N 1 U V^2 V^2W^2 X^4 Y^2Z^2 Z^6 1 1 0.122495 0.00611689 0.00117263 0.000165486 0.000298114 0.217247 2 1 0.329618 0.694155 0.287887 0.170718 0.00652402 0.199986 4 1 0.398639 0.253433 0.164517 0.0164159 0.0633772 0.20548 8 1 0.389879 0.556886 0.226614 0.214815 0.0359451 0.03431 16 1 0.525637 0.288991 0.0970938 0.209215 0.0286652 0.143043 32 1 0.452949 0.295863 0.0850989 0.277532 0.0278158 0.215907 64 1 0.495688 0.324615 0.123195 0.193732 0.0362931 0.134516 128 1 0.502178 0.295152 0.0899929 0.190511 0.0365086 0.1345 256 1 0.512309 0.322152 0.0960268 0.18157 0.0352306 0.152804 512 1 0.501767 0.321423 0.106651 0.218787 0.0365577 0.157734 1024 1 0.503537 0.309075 0.110176 0.200993 0.0384418 0.140674 2048 1 0.494869 0.344757 0.120614 0.195347 0.0374786 0.137021 4096 1 0.497852 0.334156 0.109556 0.201955 0.0348885 0.137248 8192 1 0.501697 0.331326 0.110112 0.195855 0.0385036 0.146195 16384 1 0.501135 0.330541 0.110806 0.201123 0.0374049 0.144775 32768 1 0.501644 0.334834 0.110971 0.201487 0.037279 0.142229 65536 1 0.499058 0.332355 0.111053 0.199728 0.0371172 0.143386 Exact 1 0.5 0.333333 0.111111 0.2 0.037037 0.142857 hypercube01_monte_carlo_test02 Normal end of execution. hypercube01_sample_test Python version: 3.6.9 hypercube01_sample samples the unit hypercube in M dimensions. Sample points in the unit hypercube. Row: 0 1 2 Col 0 : 0.737646 0.154844 0.985817 1 : 0.245043 0.698221 0.620491 2 : 0.86921 0.916688 0.316043 3 : 0.73747 0.503725 0.971188 4 : 0.880212 0.0887618 0.0735523 5 : 0.178087 0.16712 0.721948 6 : 0.143702 0.649982 0.514753 7 : 0.491443 0.120706 0.386625 8 : 0.372352 0.879966 0.0381386 9 : 0.133663 0.830965 0.727137 hypercube01_sample_test Normal end of execution. hypercube01_volume_test Python version: 3.6.9 hypercube01_volume returns the volume of the unit hypercube in M dimensions. hypercube01_volume(3) = 1 hypercube01_volume_test Normal end of execution. hypercube_monte_carlo_test(): Normal end of execution. Tue Oct 19 11:53:26 2021