公告:1)网站程序升级:Q2A升级到1.8.6,Wordpress升级到5.7.2
2)修复了头像加载慢与提交问题反应慢等问题
2021-06-16

欢迎来到 Mathematica 问答社区

提问时请贴上文本代码

语法高亮:在编辑器中点击

被禁止的话题:广告破解

请阅读:《提问的智慧》

备用域名:mma.ooo

支持LaTex数学公式
行内公式标识符:\$ 或“$\backslash ($”+“$\backslash )$”,
行间公式标识符:\$\$ 或 “$\backslash [$”+“$\backslash ]$”

社区建议QQ群:365716997

分类

0 投票
356 浏览

代码如下:
 

j1 = 1;
j2 = 0.5;
d1 = 0.3;
d2 = 0.4;
sa = 1/2;
sb = 1;
j3 = 1;
j4 = 0.5;
z = 4;
jz = 0;

r1 = 1/2 (Cos[x] + Cos[y]);
r2 = Cos[x]*Cos[y];
a = 2*(j1 - j2 + j2*r2 - j1*r1)*z*sa + d1*(2*sa - 1) + jz*sb;
b = 2*(j3 - j4 + j4*r2 - j3*r1)*z*sb + d2*(2*sb - 1) + jz*sa;
c = jz*Sqrt[sa*sb];
w1 = (a - b - Sqrt[(a + b)^2 - 4*c^2])/2;
w2 = (-a + b - Sqrt[(a + b)^2 - 4*c^2])/2;
q1 = 1/(Exp[w1/t] - 1);
q2 = 1/(Exp[w2/t] - 1);

t = 0.2;

sa - sb + (1/(2*Pi)^2)*NIntegrate[q2 - q1, {x, -Pi, Pi}, {y, -Pi, Pi}]



1,改变jz的值,其他不变的情况下,除了jz=0,外,jz=0.01,0.2,0.5时都能计算出来。

2,我查看了相关帮助和提示,好像是有奇点之类的问题,需要排除奇点再计算,但不知如何排除,尝试用Exclusions,好像不行。

所以请问如何计算jz=0时该函数值?

PS:提示错误:NIntegrate::slwcon: Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small.

NIntegrate::inumri: The integrand -(1/(-1+E^(2.5 (-0.4+Times[<<2>>]+Times[<<2>>]))))+1/(-1+E^(2.5 (0.4 +4 Plus[<<3>>]-Power[<<2>>]))) has evaluated to Overflow, Indeterminate, or Infinity for all sampling points in the region with boundaries {{1.83736*10^-14,1.13446*10^-8},{2.35619,3.14159}}.

NIntegrate::slwcon: Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small.

NIntegrate::inumri: The integrand -(1/(-1+E^(2.5 (-0.4+Times[<<2>>]+Times[<<2>>]))))+1/(-1+E^(2.5 (0.4 +4 Plus[<<3>>]-Power[<<2>>]))) has evaluated to Overflow, Indeterminate, or Infinity for all sampling points in the region with boundaries {{1.83736*10^-14,1.13446*10^-8},{2.35619,3.14159}}.

用户: 535 (36 分)
修改于 用户:野鹤

1个回答

+1 投票
 
已采纳

jz=0时,被积函数在 x y==0 处不存在,不可积(应该是超奇异的),不是编程的问题。

因此,即使排除掉这两条线也不行的,比如:

j1 = 1;
j2 = 0.5;
d1 = 0.3;
d2 = 0.4;
sa = 1/2;
sb = 1;
j3 = 1;
j4 = 0.5;
z = 4;
jz = 0;

r1 = 1/2 (Cos[x] + Cos[y]);
r2 = Cos[x]*Cos[y];
a = 2*(j1 - j2 + j2*r2 - j1*r1)*z*sa + d1*(2*sa - 1) + jz*sb;
b = 2*(j3 - j4 + j4*r2 - j3*r1)*z*sb + d2*(2*sb - 1) + jz*sa;
c = jz*Sqrt[sa*sb];
w1 = (a - b - Sqrt[(a + b)^2 - 4*c^2])/2;
w2 = (-a + b - Sqrt[(a + b)^2 - 4*c^2])/2;
q1 = 1/(Exp[w1/t] - 1);
q2 = 1/(Exp[w2/t] - 1);

t = 0.2;

sa - sb + (1/(2*Pi)^2)*
  NIntegrate[q2 - q1, {x, -Pi, Pi}, {y, -Pi, Pi}, 
   Exclusions -> (x y == 0)]

用户: 野鹤 (4.9k 分)
采纳于 用户:535
谢谢!~
...