Message Boards Message Boards

0
|
6628 Views
|
9 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Understand Integrate differences between V12 and V11.3?

Posted 5 years ago

-Result in mathematica 11.3:

In[1]:= F[n_] := 
 Integrate[Exp[I n x] Sin[x] x^-1 Log[x] , {x, 0, 2 Pi}] 
F[1.] // Timing

Out[2]= {25.6563, -1.07069 + 0.649257 I}

-Result in mathematica 12:

In[1]:= F[n_] := 
 Integrate[Exp[I n x] Sin[x] x^-1 Log[x] , {x, 0, 2 Pi}] 
F[1.] // Timing

During evaluation of In[1]:= Infinity::indet: Indeterminate expression (0. +0. I) (-[Infinity]) encountered.

During evaluation of In[1]:= Infinity::indet: Indeterminate expression (0. +0. I) (-[Infinity]) encountered.

During evaluation of In[1]:= Power::infy: Infinite expression 1/0. encountered.

During evaluation of In[1]:= Power::infy: Infinite expression 1/0. encountered.

During evaluation of In[1]:= Infinity::indet: Indeterminate expression ComplexInfinity+ComplexInfinity encountered.

During evaluation of In[1]:= Infinity::indet: Indeterminate expression -[Infinity]+[Infinity] encountered.

During evaluation of In[1]:= Infinity::indet: Indeterminate expression -[Infinity]+[Infinity]-1. ExpIntegralEi[(0. -2. I) (3.14159 +ArcSin[x])]+1. ExpIntegralEi[(0. +2. I) (3.14159 +ArcSin[x])] encountered.

During evaluation of In[1]:= General::stop: Further output of Infinity::indet will be suppressed during this calculation.

During evaluation of In[1]:= Power::infy: Infinite expression 1/0. encountered.

During evaluation of In[1]:= General::stop: Further output of Power::infy will be suppressed during this calculation.

Out[2]= {222.344, -1.07069 + 0.649257 I}

POSTED BY: santiago peris
9 Replies

Integrate is a symbolic solver,then use a exact numbers not numeric one.

For me calculating time is almost the same.

Mathematica 10.2

 F[n_] := Integrate[Exp[I n x] Sin[x] x^-1 Log[x], {x, 0, 2 Pi}]; 
 F[1] // N // AbsoluteTiming
 (* {16.2086,-1.07069+0.649257 \[ImaginaryI]}*)

Mathematica 12.0

 F[n_] := Integrate[Exp[I n x] Sin[x] x^-1 Log[x], {x, 0, 2 Pi}]; 
 F[1] // N // AbsoluteTiming
 (* {17.1023,-1.07069+0.649257 \[ImaginaryI]}*)

Regards M.I.

POSTED BY: Mariusz Iwaniuk
Posted 5 years ago

Thanks Mariusz. I know "Integrate" is symbolic and the result of this integral is most efficiently obtained with "NIntegrate" instead, but here is an example of exactly the same commands involving "Integrate" which goes much faster in mathematica 11.3 than in mathematica 12.0. It doesn't seem to me like a step forward...

POSTED BY: santiago peris

It is difficult to tell what exactly caused the degraded performance. Some debugging evidence suggests it might be from a change to an internal time constraint, causing an attempt to give up too soon, but that is far from certainty.

In this particular instance the mix of approximate numbers and symbolic methods is somewhat toxic. I will experiment with a couple of changes intended to improve the behavior of this example, but it is by no means a given that they will survive stress-testing on our integration suite.

POSTED BY: Daniel Lichtblau
Posted 5 years ago

Thanks Daniel. To me, this smells like some kind of bug to be fixed. I look forward to your solution.

POSTED BY: santiago peris
Posted 5 years ago

So Mr. Lichtblau, you're saying Wolfram Research may NOT fix this? In the case that it doesn't "...survive stress-testing on our integration suite." Really ?

POSTED BY: Russ Ravella
Posted 4 years ago

Today, I tried the same example and, 6 months later, the problem still persists. Will you ever take care of this ? Bad, bad, bad...

POSTED BY: santiago peris
Posted 4 years ago

In the meantime, are you aware that you can use FourierCoefficient[] to evaluate this integral?

Ff[n_Integer] := (-1)^n FourierCoefficient[Sinc[x + ?] Log[x + ?], x,
                                           n, FourierParameters -> {-1, -1}]

N[Ff[1]]
   -1.0706908375028643 + 0.6492569703685498*I
POSTED BY: J. M.
Posted 4 years ago

Dear J.M., Thanks for your message. Yes, I do know. My point is that there seems to be a glitch in the code relative to the previous version of mathematica, and nobody seems to take care of it. I find that rather unusual.

POSTED BY: santiago peris

Probably this will all get deleted, but I will point out that there has not been a release of version 12.1, ergo no rationale for the claims that nothing has been done to address the issue.

POSTED BY: Daniel Lichtblau

Group Abstract Group Abstract