Message Boards Message Boards

GROUPS:

Understand Integrate differences between V12 and V11.3?

Posted 1 month ago
565 Views
|
5 Replies
|
1 Total Likes
|

-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}

5 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 1 month 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...

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 1 month ago

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

Posted 1 month 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 ?

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract