|
这个积分是发散的,可以用放缩法证明。
事实上,原始积分即使放在maple下用符号解,似乎也很难求解出来。一个可行的办法就是用放缩法证明:
分析被平方的积分项,它应该大于
- int(exp(-1)/(y^2+x^2),x,-1,1)^2
复制代码 于是原始积分整体大于
- int(2*y*exp(-y^2)*int(exp(-1)/(y^2+x^2),x,-1,1)^2,0,1)
复制代码 在MATLAB2008a下运行如下代码:(之所以选择2008a,是因为这是MATLAB和Maple结合的最后一个版本,以后的版本符号计算内核换了mupad,下列代码是得不出结果的,可见mupad比maple还是弱多了)
- syms x y
- a = int(2*y*exp(-y^2)*int(exp(-1)/(y^2+x^2),x,-1,1)^2,0,1)
- double(a)
- Warning: Explicit integral could not be found.
- > In sym.int at 58
- a =
- int(686231412107798092534547949169/633825300114114700748351602688/y*exp(-y^2)*atan(1/y)^2,y = 0 .. 1)
- ans =
- Inf
复制代码 可见结果是无穷的,于是原始积分是无穷的。
所以原始积分不能从0开始积分,下面用我以前给出的方法数值求解下:积分下限分为0.2,0.1,0.01,0.001,0.0001
代码如下:
- tic;f1 = quadl(@(y) arrayfun(@(y)quadl(@(x) exp(-x.^2)./(y.^2+x.^2),-1,1),y).^2,0.2,1),toc
- f1 =
- 17.9174
- Elapsed time is 0.110964 seconds.
- >> tic;f1 = quadl(@(y) arrayfun(@(y)quadl(@(x) exp(-x.^2)./(y.^2+x.^2),-1,1),y).^2,0.1,1),toc
- f1 =
- 53.9235
- Elapsed time is 0.335609 seconds.
- >> tic;f1 = quadl(@(y) arrayfun(@(y)quadl(@(x) exp(-x.^2)./(y.^2+x.^2),-1,1),y).^2,0.01,1),toc
- f1 =
- 891.1743
- Elapsed time is 1.764475 seconds.
- >> tic;f1 = quadl(@(y) arrayfun(@(y)quadl(@(x) exp(-x.^2)./(y.^2+x.^2),-1,1),y).^2,0.001,1),toc
- f1 =
- 9.7203e+003
- Elapsed time is 8.466365 seconds.
- >> tic;f1 = quadl(@(y) arrayfun(@(y)quadl(@(x) exp(-x.^2)./(y.^2+x.^2),-1,1),y).^2,0.0001,1),toc
- f1 =
- 9.8493e+004
- Elapsed time is 21.919113 seconds.
复制代码 随着下限逐渐靠近0,所需计算时间也会逐渐增长,这是因为积分是发散的,下限越靠近0,积分步长会分得越细,以期获得足够的精度,当然计算量也会上去。
楼主酌情让y的积分下限取个合适的值吧。 |
评分
-
1
查看全部评分
-
|