为了计算由定义的固体的体积
在哪里
我使用了以下代码(在 MATLAB 中)
f = @(x, y, z) double(1 + cos(x) + cos(y) + cos(z) + 0.51*(cos(x).*cos(y) + cos(x).*cos(z) + cos(y).*cos(z))<=0)
q = 8*integral3(f, 0, pi, 0, pi, 0, pi)
但给出警告信息和NaN:
Warning: Reached the maximum number of function evaluations (10000). The result fails the global error test.
如何以尽可能高的精度获得所需的结果?
更新:
Gauss-Kronrod 规则似乎正确地解决了这个问题;进一步的变量替换,涉及雅可比行列式可能会导致计算效率。
