Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.3K Views
|
11 Replies
|
1 Total Like
View groups...
Share
Share this post:

NIntegrate::slwcon warning for definite integration

Posted 6 years ago
POSTED BY: Haress Nazary
11 Replies
POSTED BY: Mariusz Iwaniuk
Posted 6 years ago

thanks. this still gives me problems:

alpha = 0.9; (*Absorptionskoeffizient*)
R = 32; (*Stabradius*)
L = 45; (*Stablänge*)
(*a=250;*)
s = Table[(*{x,
   a*10,*)(1 - Exp[-alpha])*
    NIntegrate[
     Exp[-alpha*
        Sqrt[(R^2 - 2*x*R*Cos[theta] + (x)^2) + 
          z^2]]/(Sqrt[(R^2 - 2*x*R*Cos[theta] + (x)^2)]*
        Sqrt[1 + z^2/(R^2 - 2*x*R*Cos[theta] + (x)^2)]^3), {z, -10 a, 
      10*(L - a)}, {theta, 0, 2 Pi}, 
     Method -> "GaussKronrodRule"], {x, 0, 32}, {a, 0, L}];
POSTED BY: Haress Nazary
alpha = 0.04;(*Absorptionskoeffizient*)R = 32;(*Stabradius*)L = \
450;(*Stablänge*)a = 210;
x = 32;
s = NIntegrate[
Exp[-alpha*
 Sqrt[(R^2 - 2*x*R*Cos[theta] + (x)^2) + 
   z^2]]/(Sqrt[(R^2 - 2*x*R*Cos[theta] + (x)^2)]*
 Sqrt[1 + z^2/(R^2 - 2*x*R*Cos[theta] + (x)^2)]^3), {z, -a, 
L - a}, {theta, 0, 2 Pi}, Method -> "GaussKronrodRule"]

(*2.66833*)

Works fine.

POSTED BY: Mariusz Iwaniuk
Posted 6 years ago

what about this one?

alpha = 0.04; (*Absorptionskoeffizient*)
R = 32; (*Stabradius*)
L = 450; (*Stablänge*)
a = 210;
x = 32;
s = NIntegrate[
  Exp[-alpha*
     Sqrt[(R^2 - 2*x*R*Cos[theta] + (x)^2) + 
       z^2]]/(Sqrt[(R^2 - 2*x*R*Cos[theta] + (x)^2)]*
     Sqrt[1 + z^2/(R^2 - 2*x*R*Cos[theta] + (x)^2)]^3), {z, -a, 
   L - a}, {theta, 0, 2 Pi}]

or:

alpha = 0.4; (*Absorptionskoeffizient*)
R = 32; (*Stabradius*)
L = 450; (*Stablänge*)
a = 210;
x = 31;
s = NIntegrate[
  Exp[-alpha*
     Sqrt[(R^2 - 2*x*R*Cos[theta] + (x)^2) + 
       z^2]]/(Sqrt[(R^2 - 2*x*R*Cos[theta] + (x)^2)]*
     Sqrt[1 + z^2/(R^2 - 2*x*R*Cos[theta] + (x)), {z, -a, 
   L - a}, {theta, 0, 2 Pi}]
POSTED BY: Haress Nazary

Code with no warnings:

 $Version
  (* "11.3.0 for Microsoft Windows (64-bit) (March 7, 2018)" *)
 alpha = 1/2;
 R = 32;
 L = 45;
 a = 25;
 s = Table[(1 - Exp[-alpha])*
    NIntegrate[
     Exp[-alpha*Sqrt[(R^2 - 2*x*R*Cos[theta] + (x)^2) + z^2]], {z, 
      10*-a, 10*(L - a)}, {theta, 0, 2 Pi}, 
     Method -> "LocalAdaptive"], {x, 0, 32}(*,{a,0,L}*)]


  (*{5.70737*10^-6, 6.02507*10^-6, 7.03033*10^-6, 
   8.88889*10^-6, 0.0000119095, 0.000016599, 0.0000237522, \
  0.0000345936, 0.0000509949, 0.0000758066, 0.000113361, 0.000170229, \
  0.000256365, 0.000386811, 0.00058424, 0.00088272, 0.00133324, \
  0.00201175, 0.00303073, 0.00455555, 0.00682723, 0.0101931, 0.0151465, \
  0.0223752, 0.0328135, 0.0476838, 0.0684951, 0.0969276, 0.13446, \
  0.181468, 0.235262, 0.286114, 0.309488}*)
POSTED BY: Mariusz Iwaniuk
Posted 6 years ago

Thanks, but this still gives me the same warning..

I don't have this problem anymore because I realized I made a mistake in coming up for the integral for my specific application.

POSTED BY: Haress Nazary

Calculate this integral with NIntegrate?

POSTED BY: Daniel Lichtblau
Posted 6 years ago

Excellent catch. Thank you

I was scraping this before he put his code into a code block which made his multiplication more explicit. I think I correctly saw the switch in italics inside his integrand, but I missed the italic minus signs in his limits of integration.

Thank you again

POSTED BY: Bill Nelson

Your integrals seems in the beginning to be near zero, and NIntegrate seems to not like this. Look at

alpha = 0.5;
R = 32;
L = 45;
a = 25;
s = Table[{x, (1 - Exp[-alpha])*
     NIntegrate[
      Exp[-alpha*Sqrt[(R^2 - 2*x*R*Cos[theta] + (x)^2) + z^2]], {z, 
       10*-a, 10*(L - a)}, {theta, 0, 2 Pi}]}, {x, 0, 32, 1}(*,{a,0,
   L}*)];
ListLinePlot[s, Epilog -> Point /@ s]

Looks reasonable - or?

@Bill Nelson: your integrand is not the same as in the problem.

POSTED BY: Hans Dolhaine
Posted 6 years ago
POSTED BY: Haress Nazary
Posted 6 years ago
POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard