三重积分对球面积分,​报“已达到函数计算的​最大数目”。

代码如下,为对球面的三重积分
clear all;clc;
x= -1:10^(-3):1;y= -1:10^(-3):1;z= -1:10^(-3):1; %积分范围,一个球
f=@(x,y,z) 1./((x.^4+y.^4+2*x.^2.*y.^2+x.^2.*z.^2+y.^2.*z.^2).^(0.5));%被积分的函数
xmin = -1; %以下为积分过程
xmax = 1;
ymin = @(x)-sqrt(1 - x.^2);
ymax = @(x) sqrt(1 - x.^2);
zmin = @(x,y)-sqrt(1 - x.^2 - y.^2);
zmax = @(x,y) sqrt(1 - x.^2 - y.^2);
q=integral3(f,xmin,xmax,ymin,ymax,zmin,zmax,'Method','tiled')
报错信息:
警告: 已达到函数计算的最大数目(10000)。这个结果将使全局误差测试失败。
> In integral2Calc>integral2t (line 129)
In integral2Calc (line 9)
In integral3/innerintegral (line 146)
In integralCalc/iterateScalarValued (line 314)
In integralCalc/vadapt (line 132)
In integralCalc (line 75)
In integral3 (line 121)
In gaicuo4_6 (line 12)
警告: 积分未成功。
> In integral3 (line 125)
In gaicuo4_6 (line 12)
我的理解是,可能是积分区域包括了零点,导致函数有了无穷大点,请教诸位有没有什么解决方案或者对这个错误的其他见解,跪谢

 Accepted Answer

0点,无穷大。比较难积分、或者发散不存在。
可以试试不计算0附近的区间。不知道对结果影响大不大。
因为原积分不能计算,很难判断是否收敛。
对称的函数,所以:
f=@(x,y,z)1./((x.^4+y.^4+2*x.^2.*y.^2+x.^2.*z.^2+y.^2.*z.^2).^(0.5));
f1=@(x,y)integral(@(z)f(x,y,z),-sqrt(1 - x.^2 - y.^2),sqrt(1 - x.^2 - y.^2),'ArrayValued',true);
f2=@(x)integral(@(y)f1(x,y),-sqrt(1 - x.^2),sqrt(1 - x.^2),'ArrayValued',true);
result=2*integral(f2,1e-4,1,'ArrayValued',true)

More Answers (0)

Categories

Find more on 特殊函数 in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!