MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Trivial integral freezes 3.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg9800] RE: [mg9755] Trivial integral freezes 3.
  • From: Ersek_Ted%PAX1A at mr.nawcad.navy.mil
  • Date: Fri, 28 Nov 1997 05:35:13 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Carlos wrote:
 -------------------------------------------------------- |The following
trivial Integrate statement (from a class example) appears |to freeze
Mathematica 3.0 running under Mac OS 7.5.5. |
|ClearAll[alpha,phi]; alpha=Pi/3;
|q=(Cos[alpha]-Cos[alpha+phi])/(-alpha+Pi+Cos[alpha]*Sin[alpha]);
|Print["q=",q//InputForm];
|r1=Integrate[q,{phi,0,2*Pi-2*alpha}]; Print["r1=",r1//InputForm]; |
|Same freeze happens for other values of alpha, e.g alpha=Pi/6.
|Mathematica 2.2 has no problems.
|
|I am curious as to whether the freeze happens on non-Mac versions. |

Below is the result of what happens doing this on my 90 Mhz Pentium. The
Pentium was still working on it after 30 minutes, so I Aborted.

It seems the algorithm ends up trying to evaluate 
(2-2(-1)^(1/3)+2(-1)^(2/3))
using numerical approximations, and can never get enough Precision
because the value is actually zero.  I don't know why numerical
approximations are  needed in this problem.  Anyway, once it became
apparent numerical  approximations are giving us problems,   I think
the algorithm should try  FullSimplify[2-2(-1)^(1/3)+2(-1)^(2/3)] which
evaluates to zero.  Once this  hurdle is overcome, the result might
come out OK.

 ------------------------------------- Also notice the following gives a
result that has a tiny imaginary part,  even though the integrand is
real along the integrating interval.

In[1]:=
Integrate[(1/2.0 - Cos[phi + Pi/3.0])/(Sqrt[3.0]/4 + (2.0*Pi)/3), {phi,
0,  5.0 Pi/3}]

Out[1]=
1.3785\[InvisibleSpace]+0. I

 ------------------------------------- I think we will hear from Wolfram
Research on this one.

     Ted Ersek


 ------------------------------------

In[2]:=
Integrate[(1/2 - Cos[phi + Pi/3])/(Sqrt[3]/4 + (2*Pi)/3), {phi, 0, 5
Pi/3}]//Timing

\!\($MaxExtraPrecision::"meprec" \( : \ \)
    "In increasing internal precision while attempting to evaluate \!\(2
- \ \(2\\ \((-1)\)\^\(1/3\)\) + \(2\\ \((-1)\)\^\(2/3\)\)\), the limit
\ $MaxExtraPrecision = \!\(49.9999999999999911`\) was reached.
Increasing the  \
value of $MaxExtraPrecision may help resolve the uncertainty."\) \!\(\*
  RowBox[{
  \(\[Infinity]::"indet"\), \( : \ \),
    "\<"Indeterminate expression \!\(\((\(-0``16.7608\) + \(0``16.7441\\
I\))\
\)\\ \*InterpretationBox[\"ComplexInfinity\", DirectedInfinity[]]\) \
encountered."\>"}]\)

\!\($MaxExtraPrecision::"meprec" \( : \ \)
    "In increasing internal precision while attempting to evaluate \!\(2
- \ \(2\\ \((-1)\)\^\(1/3\)\) + \(2\\ \((-1)\)\^\(2/3\)\)\), the limit
\ $MaxExtraPrecision = \!\(49.9999999999999911`\) was reached.
Increasing the  \
value of $MaxExtraPrecision may help resolve the uncertainty."\) \!\(\*
  RowBox[{
  \(\[Infinity]::"indet"\), \( : \ \),
    "\<"Indeterminate expression \!\(\((\(-0``16.7608\) + \(0``16.7441\\
I\))\
\)\\ \*InterpretationBox[\"ComplexInfinity\", DirectedInfinity[]]\) \
encountered."\>"}]\)

\!\($MaxExtraPrecision::"meprec" \( : \ \)
    "In increasing internal precision while attempting to evaluate \!\(2
- \ \(2\\ \((-1)\)\^\(1/3\)\) + \(2\\ \((-1)\)\^\(2/3\)\)\), the limit
\ $MaxExtraPrecision = \!\(49.9999999999999911`\) was reached.
Increasing the  \
value of $MaxExtraPrecision may help resolve the uncertainty."\)

General::"stop":
    "Further output of \!\($MaxExtraPrecision :: \"meprec\"\) will be \
suppressed during this calculation." \!\(\*
  RowBox[{
  \(\[Infinity]::"indet"\), \( : \ \),
    "\<"Indeterminate expression \!\(\((\(-0``16.7608\) + \(0``16.7441\\
I\))\
\)\\ \*InterpretationBox[\"ComplexInfinity\", DirectedInfinity[]]\) \
encountered."\>"}]\)

General::"stop":
    "Further output of \!\(\\[Infinity] :: \"indet\"\) will be
suppressed \ during this calculation."


Out[2]=
$Aborted



  • Prev by Date: Re: computer modern plot tick labels
  • Next by Date: Control Systems with Mathematica
  • Previous by thread: ReadSoundfile problems on NT?
  • Next by thread: Re: RE: Trivial integral freezes 3.