Why I got inumr??
- To: mathgroup at smc.vnet.net
- Subject: [mg80987] Why I got inumr??
- From: "hj.gegewu" <chiron1201 at 163.com>
- Date: Fri, 7 Sep 2007 02:03:46 -0400 (EDT)
Hi all!
I have a problem when I try to Nintegrate following code:
a = 0; b = 2;
P = (Max[0, (Min[b, #2*Cos[#3] + Sqrt[#1^2 - (#2*Sin[#3])^2]] -
Max[a, #2*Cos[#3] - Sqrt[#1^2 - (#2*Sin[#3])^2]])/(b -
a)]) &;
ProbR1 = (NIntegrate[
P[(-#1*Cos[z] + Sqrt[#2^2 - (#1 *Sin[z])^2])/#3, x,
y]/(4*Pi^2*(b - a)), {z, Pi - ArcSin[#2/#1],
Pi + ArcSin[#2/#1]}, {y, 0, 2*Pi}, {x, a,
Min[b, (-#1*Cos[z] + Sqrt[#2^2 - (#1 *Sin[z])^2])/(#3*
Abs[Sin[y]])]},
Method -> {"GlobalAdaptive",
"SingularityHandler" -> "DuffyCoordinates"}]) &;
ProbR2 = (NIntegrate[
P[(-#1*Cos[z] - Sqrt[#2^2 - (#1 *Sin[z])^2])/#3, x,
y]/(4*Pi^2*(b - a)), {z, Pi - ArcSin[#2/#1],
Pi + ArcSin[#2/#1]}, {y, 0, 2*Pi}, {x, a,
Min[b, (-#1*Cos[z] + Sqrt[#2^2 - (#1 *Sin[z])^2])/(#3*
Abs[Sin[y]])]},
Method -> {"GlobalAdaptive",
"SingularityHandler" -> "DuffyCoordinates"}]) &;
ProbR1[130, 125, 50]
ProbR2[130, 125, 50]
while the line of "ProbR1[130, 125, 50]" can be caculated correctly, the line of "ProbR2[130, 125, 50]" keeps giving me the warning of
NIntegrate::inumr: "The integrand \
Max[0,1/2\(-Max[0,Times[<<2>>]+Times[<<2>>]]+Min[2,x\Cos[<<1>>]+Sqrt[\
Plus[<<2>>]]])]/(8\\[Pi]^2) has evaluated to non-numerical values for \
all sampling points in the region with boundaries \
{{0.5,0.75},{0.125,0.0625},{0.5,0.25}}."
The only difference of these two sentence is the sign of "Sqrt[#2^2 - (#1 *Sin[z])^2])". Why this happened?
Thanks!