Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9673 > unrolled thread

NIntegrate about singular point

Started bybowlderster <bowlderster@gmail.com>
First post2012-04-17 10:05 +0000
Last post2012-04-20 11:49 +0000
Articles 5 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  NIntegrate about singular point bowlderster <bowlderster@gmail.com> - 2012-04-17 10:05 +0000
    Re: NIntegrate about singular point A Retey <awnl@gmx-topmail.de> - 2012-04-18 07:54 +0000
      Re: NIntegrate about singular point bowlderster <bowlderster@gmail.com> - 2012-04-19 07:54 +0000
    Re: NIntegrate about singular point danl@wolfram.com - 2012-04-18 07:56 +0000
    Re: NIntegrate about singular point danl@wolfram.com - 2012-04-20 11:49 +0000

#9673 — NIntegrate about singular point

Frombowlderster <bowlderster@gmail.com>
Date2012-04-17 10:05 +0000
SubjectNIntegrate about singular point
Message-ID<jmjf8p$89v$1@smc.vnet.net>
Hello, all.
I am dealing with an integral as following

h = 1
m = 1
n = 1
t = 1
k = 4.0269
kk = 4.0284
Plot[x^(m + n - 1)/(x*Sinh[x*h] -
     kk*Cosh[x*h])*((x +
       kk)*((-1)^(m + n)*Exp[x*(2.*(-0.2) + h)] - ((-1)^m + (-1)^n)*
        Exp[-x*h]) + (x - kk)*Exp[-x*(2.*(-0.2) + h)]), {x, 0, 40}]
NIntegrate[
 x^(m + n - 1)/(x*Sinh[x*h] -
     kk*Cosh[x*h])*((x +
       kk)*((-1)^(m + n)*Exp[x*(2.*(-0.2) + h)] - ((-1)^m + (-1)^n)*
        Exp[-x*h]) + (x - kk)*Exp[-x*(2.*(-0.2) + h)]), {x, 0,
  Infinity}]

It has a singular point when the denominator is zero.
At begining, I try to solve it in another system, yet with Nan result.

It is the first time for me to use Mathematica.
Can it solve the integral with singular point?

Thanks for your help

[toc] | [next] | [standalone]


#9681

FromA Retey <awnl@gmx-topmail.de>
Date2012-04-18 07:54 +0000
Message-ID<jmls0d$jdp$1@smc.vnet.net>
In reply to#9673
Hi,

> I am dealing with an integral as following
>
> h = 1
> m = 1
> n = 1
> t = 1
> k = 4.0269
> kk = 4.0284
> Plot[x^(m + n - 1)/(x*Sinh[x*h] -
>       kk*Cosh[x*h])*((x +
>         kk)*((-1)^(m + n)*Exp[x*(2.*(-0.2) + h)] - ((-1)^m + (-1)^n)*
>          Exp[-x*h]) + (x - kk)*Exp[-x*(2.*(-0.2) + h)]), {x, 0, 40}]
> NIntegrate[
>   x^(m + n - 1)/(x*Sinh[x*h] -
>       kk*Cosh[x*h])*((x +
>         kk)*((-1)^(m + n)*Exp[x*(2.*(-0.2) + h)] - ((-1)^m + (-1)^n)*
>          Exp[-x*h]) + (x - kk)*Exp[-x*(2.*(-0.2) + h)]), {x, 0,
>    Infinity}]
>
> It has a singular point when the denominator is zero.
> At begining, I try to solve it in another system, yet with Nan result.
>
> It is the first time for me to use Mathematica.
> Can it solve the integral with singular point?

I think that NIntegrate handles many singularities automatically if the 
integral actually converges. I haven't checked, but I suspect that in 
this case the integral is probably simply not converging. It's easy 
enough though to get the cauchy principle value, if that is what you're 
after:

expr = x^(m + n - 1)/(x*Sinh[x*h] -
      kk*Cosh[x*h])*((x +
        kk)*((-1)^(m + n)*Exp[x*(2.*(-0.2) + h)] - ((-1)^m + (-1)^n)*
         Exp[-x*h]) + (x - kk)*Exp[-x*(2.*(-0.2) + h)]);

singularity = x /. FindRoot[Denominator[expr] == 0, {x, 4}]

NIntegrate[expr, {x, 0, Infinity}, Exclusions -> {singularity},
  Method -> "PrincipalValue"]

you might want to have a look at tutorial/NIntegrateOverview in the 
documentation center to learn more details about the various options and 
methods of NIntegrate.

hth,

albert

[toc] | [prev] | [next] | [standalone]


#9694

Frombowlderster <bowlderster@gmail.com>
Date2012-04-19 07:54 +0000
Message-ID<jmogbb$45e$1@smc.vnet.net>
In reply to#9681
On 4=D4=C218=C8=D5, =CF=C2=CE=E73=CA=B154=B7=D6, A Retey <a...@gmx-topmail.de> wrote:
> Hi,
>
>
>
>
>
> > I am dealing with an integral as following
>
> > h = 1
> > m = 1
> > n = 1
> > t = 1
> > k = 4.0269
> > kk = 4.0284
> > Plot[x^(m + n - 1)/(x*Sinh[x*h] -
> >       kk*Cosh[x*h])*((x +
> >         kk)*((-1)^(m + n)*Exp[x*(2.*(-0.2) + h)] - ((-1)^m + (-1)^n)*
> >          Exp[-x*h]) + (x - kk)*Exp[-x*(2.*(-0.2) + h)]), {x, 0, 40}]
> > NIntegrate[
> >   x^(m + n - 1)/(x*Sinh[x*h] -
> >       kk*Cosh[x*h])*((x +
> >         kk)*((-1)^(m + n)*Exp[x*(2.*(-0.2) + h)] - ((-1)^m + (-1)^n)*
> >          Exp[-x*h]) + (x - kk)*Exp[-x*(2.*(-0.2) + h)]), {x, 0,
> >    Infinity}]
>
> > It has a singular point when the denominator is zero.
> > At begining, I try to solve it in another system, yet with Nan result.
>
> > It is the first time for me to use Mathematica.
> > Can it solve the integral with singular point?
>
> I think that NIntegrate handles many singularities automatically if the
> integral actually converges. I haven't checked, but I suspect that in
> this case the integral is probably simply not converging. It's easy
> enough though to get the cauchy principle value, if that is what you're
> after:
>
> expr = x^(m + n - 1)/(x*Sinh[x*h] -
>       kk*Cosh[x*h])*((x +
>         kk)*((-1)^(m + n)*Exp[x*(2.*(-0.2) + h)] - ((-1)^m + (-1)^n)*
>          Exp[-x*h]) + (x - kk)*Exp[-x*(2.*(-0.2) + h)]);
>
> singularity = x /. FindRoot[Denominator[expr] == 0, {x, 4}]
>
> NIntegrate[expr, {x, 0, Infinity}, Exclusions -> {singularity},
>   Method -> "PrincipalValue"]
>
> you might want to have a look at tutorial/NIntegrateOverview in the
> documentation center to learn more details about the various options and
> methods of NIntegrate.
>
> hth,
>
> albert- =D2=FE=B2=D8=B1=BB=D2=FD=D3=C3=CE=C4=D7=D6 -
>
> - =CF=D4=CA=BE=D2=FD=D3=C3=B5=C4=CE=C4=D7=D6 -

Thanks for your help.
I get a lot from you mentioned.

[toc] | [prev] | [next] | [standalone]


#9685

Fromdanl@wolfram.com
Date2012-04-18 07:56 +0000
Message-ID<jmls47$jf6$1@smc.vnet.net>
In reply to#9673
On Tuesday, April 17, 2012 5:05:13 AM UTC-5, bowlderster wrote:
> Hello, all.
> I am dealing with an integral as following
>
> h = 1
> m = 1
> n = 1
> t = 1
> k = 4.0269
> kk = 4.0284
> Plot[x^(m + n - 1)/(x*Sinh[x*h] -
>      kk*Cosh[x*h])*((x +
>        kk)*((-1)^(m + n)*Exp[x*(2.*(-0.2) + h)] - ((-1)^m + (-1)^n)*
>         Exp[-x*h]) + (x - kk)*Exp[-x*(2.*(-0.2) + h)]), {x, 0, 40}]
> NIntegrate[
>  x^(m + n - 1)/(x*Sinh[x*h] -
>      kk*Cosh[x*h])*((x +
>        kk)*((-1)^(m + n)*Exp[x*(2.*(-0.2) + h)] - ((-1)^m + (-1)^n)*
>         Exp[-x*h]) + (x - kk)*Exp[-x*(2.*(-0.2) + h)]), {x, 0,
>   Infinity}]
>
> It has a singular point when the denominator is zero.
> At begining, I try to solve it in another system, yet with Nan result.
>
> It is the first time for me to use Mathematica.
> Can it solve the integral with singular point?
>
> Thanks for your help

That is not an integrable singularity. To see this, rationalize everything,=
 compute the singular point explicitly, and expand the integrand in a serie=
s centered at that point. We'll get a 1/(x-pt) type of term, and this means=
 the Riemann integral does not exist.

h = 1;
m = 1;
n = 1;
t = 1;
k = 40269/10000;
kk = 40284/10000;

In[326]:= expr =
 Rationalize[
  x^(m + n - 1)/(x*Sinh[x*h] -
      kk*Cosh[x*h])*((x +
        kk)*((-1)^(m + n)*Exp[x*(2.*(-0.2) + h)] - ((-1)^m + (-1)^n)*
         Exp[-x*h]) + (x - kk)*Exp[-x*(2.*(-0.2) + h)])]

Out[326]= (x*((-(10071/2500) + x)/
      E^((3*x)/5) + (2/E^x + E^((3*x)/5))*(10071/2500 + x)))/
   (-((10071*Cosh[x])/2500) + x*Sinh[x])

In[327]:= sing = x /. First[Solve[Denominator[expr] == 0 && x >= =
0, x]]

Out[327]= Root[{10071 - 2500*#1 + (10071 + 2500*#1)/E^(2*#1) & ,
     4.0309413727078305519742154202340325203130636422539920318199`20.\
60201996114937}]

In[328]:= N[Normal[Series[expr, {x, sing, 2}]], 20]

Out[328]= \
-0.3554151801476991150413491075955450313832012232822013113183`20. +
   12.9359005198882606437231966513206867737`20./
     (-4.0309413727078305519842918447641817012641557622412458781615`\
20. + x) -
   0.492816984068007502148671038677316080890365779186271576225`20.*
     (-4.0309413727078305519842918447641817012641557622412458781615`\
20. + x) +
   0.0874544334620205088679175508145220699125102673447387653118`20.*
     (-4.0309413727078305519842918447641817012641557622412458781615`\
20. + x)^2

If you are looking to approximate numerically a principal value integral, t=
hat would be a different matter.

Daniel Lichtblau
Wolfram Research

[toc] | [prev] | [next] | [standalone]


#9713

Fromdanl@wolfram.com
Date2012-04-20 11:49 +0000
Message-ID<jmrigf$lep$1@smc.vnet.net>
In reply to#9673
On Tuesday, April 17, 2012 5:05:13 AM UTC-5, bowlderster wrote:
> Hello, all.
> I am dealing with an integral as following
> 
> h = 1
> m = 1
> n = 1
> t = 1
> k = 4.0269
> kk = 4.0284
> Plot[x^(m + n - 1)/(x*Sinh[x*h] -
>      kk*Cosh[x*h])*((x +
>        kk)*((-1)^(m + n)*Exp[x*(2.*(-0.2) + h)] - ((-1)^m + (-1)^n)*
>         Exp[-x*h]) + (x - kk)*Exp[-x*(2.*(-0.2) + h)]), {x, 0, 40}]
> NIntegrate[
>  x^(m + n - 1)/(x*Sinh[x*h] -
>      kk*Cosh[x*h])*((x +
>        kk)*((-1)^(m + n)*Exp[x*(2.*(-0.2) + h)] - ((-1)^m + (-1)^n)*
>         Exp[-x*h]) + (x - kk)*Exp[-x*(2.*(-0.2) + h)]), {x, 0,
>   Infinity}]
> 
> It has a singular point when the denominator is zero.
> At begining, I try to solve it in another system, yet with Nan result.
> 
> It is the first time for me to use Mathematica.
> Can it solve the integral with singular point?
> 
> Thanks for your help

It's not an integrable singularity. To see this, find poles (there is only one, actually), and check the series expansions there.

In[208]:= h = 1; 
m = 1; 
n = 1; 
t = 1; 
k = 40269/10000; 
kk = 40284/10000; 
expr = Rationalize[(x^(m + n - 1)/(x*Sinh[x*h] - kk*Cosh[x*h]))*
       ((x + 
        kk)*((-1)^(m + n)*Exp[x*(2.*-0.2 + h)] - ((-1)^m + (-1)^n)*
         Exp[(-x)*h]) + 
          (x - kk)*Exp[(-x)*(2.*-0.2 + h)])]

Out[214]= (x*((-(10071/2500) + x)/
      E^((3*x)/5) + (2/E^x + E^((3*x)/5))*(10071/2500 + x)))/
   (-((10071*Cosh[x])/2500) + x*Sinh[x])

In[218]:= poles = x /. Solve[Denominator[expr] == 0 && x >= 0, x]

Out[218]= {Root[{10071 - 2500*#1 + (10071 + 2500*#1)/E^(2*#1) & , 
       4.0309413727078305519742154202340325203130636422539920318199`\
20.60201996114937}]}

In[221]:= Quiet[series = (Series[expr, {x, #1, 1}] & ) /@ poles]; 

In[223]:= N[Normal[series]]

Out[223]= {-0.35541518014768414 + 
  12.935900519888259/(-4.03094137270783 + x) - 
     0.49281698406801144*(-4.03094137270783 + x)}

We have a 1/(x-pole) singularity, ergo no convergence.

Daniel Lichtblau
Wolfram Research

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web