       Re: Integration problem

• To: mathgroup at smc.vnet.net
• Subject: [mg35528] Re: Integration problem
• From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
• Date: Thu, 18 Jul 2002 03:06:10 -0400 (EDT)
• Organization: Universitaet Leipzig
• References: <ah24r0\$r3u\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Hi,

can you simply stop to mix numerical values like 81. with
analytical calculations ? Your problem is, that the integration
must find the roots of 1 - t^2 - 81 t^4

If you wish to use analytical calculations avoid inexact
numerical data like 0. or 81.

Regards
Jens

Arnold Gregory Civ AFRL/SNAT wrote:
>
> On Mathematica 4.1 w/ Win2000, I'm having the following problem with an integral:
> In:= expr1 = (t)^2* UnitStep[1 - t^2 - 81. t^4]
> Out= t^2 UnitStep[1 - t^2 - 81. t^4]
>
> In:= expr2 = (0.+ t)^2 UnitStep[1 - t^2 - 81. * t^4]
> Out= (0.+ t)^2 UnitStep[1 - t^2 - 81. * t^4]
>
> In:= Integrate[Evaluate[expr1],{t,-1,1}]
> Out= 0.0227181
>
> In:= Integrate[Evaluate[expr2],{t,-1,1}]
> Out=0.666667
>
> In:= Integrate[Evaluate[Rationalize[expr2]],{t,-1,1}]
> Out= (10*Sqrt[26*(-1 + 5*Sqrt)] -
>   2*Sqrt[-2 + 10*Sqrt])/8748
>
> In:= N[%]
> Out= 0.0227181
>
> In:= NIntegrate[Evaluate[Rationalize[expr2]],{t,-1,1}]
> NIntegrate::slwcon: Numerical integration converging too slowly; suspect one \
> of the following: singularity, value of the integration being 0, oscillatory \
> integrand, or insufficient WorkingPrecision. If your integrand is oscillatory \
> try using the option Method->Oscillatory in NIntegrate.
> NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after \
> 7 recursive bisections in t near t = -0.320313.
> Out= 0.0225802
>
> It doesn't matter if I put the expression directly into the integrals.  I can remove the difference by rationalizing either the expression t+0. or UnitStep[...] & both cases give the correct result.  I can also change to (t+eps) and then evaluate eps->0. and get the correct result.  In short, it looks like this particular form yields an unstable result & I'm looking for advice on approaches to mitigate this happening within a sequence of long & complex calculations.  It isn't clear to me that Rationalize is the best approach or that it will always guarantee correcting the problem.
>
> Thanks!
> Greg

```

• Prev by Date: Re: Problems with simulating society ch4 section 4.3
• Next by Date: RE: Re: help in generating a gaussian random variable
• Previous by thread: Integration problem
• Next by thread: How to select all polynomials which have degree greater than a give number out of a list of polynomials!