home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / sci / math / symbolic / 3402 < prev    next >
Encoding:
Text File  |  1993-01-07  |  3.9 KB  |  116 lines

  1. Newsgroups: sci.math.symbolic
  2. Path: sparky!uunet!wri!spider.wri.com!withoff
  3. From: withoff@spider.wri.com (David Withoff)
  4. Subject: Re: more on mma big bad bug 
  5. Message-ID: <1993Jan8.013931.24919@wri.com>
  6. Summary: Technical explanation
  7. Sender: news@wri.com
  8. Nntp-Posting-Host: spider.wri.com
  9. Organization: Wolfram Research, Inc.
  10. References: <15373.2b4c73d5@ohstpy.mps.ohio-state.edu>
  11. Date: Fri, 8 Jan 1993 01:39:31 GMT
  12. Lines: 102
  13.  
  14. In article <15373.2b4c73d5@ohstpy.mps.ohio-state.edu> vandesande@ohstpy.mps.ohio-state.edu writes:
  15. >
  16. >Pi Sqrt[Pi]/(2 2 Sqrt[2])
  17. >
  18. >The explanation for the "big bad bug" from Wolfram is that 
  19. >the Simplification rules for Power conflict.  The expression
  20. >is "simplified" back and forth between two different forms.
  21. >Will fix in another release, they say.  There is no really 
  22. >satisfactory fix.
  23. >
  24. >Here is another big bad bug:
  25. >
  26. >Integrate[E^( - k1*r[1]),{k1, 0, Infinity}]
  27. >
  28. >Note that this expression correctly evaluates in version 2.0.
  29. >
  30. >Brett
  31.  
  32. I'd like to offer a few thoughts about each of these problems.
  33.  
  34. First of all, registered users who have encountered these (or any other)
  35. problems with Mathematica are encouraged to contact Technical Support
  36. (support@wri.com) at Wolfram Research for assistance in finding
  37. appropriate solutions.  Both of the above problems are soluble.
  38.  
  39. The second problem (with Integrate[E^( - k1*r[1]),{k1, 0, Infinity}])
  40. is fairly simple, and there is a simple fix.
  41.  
  42. The problem shows up in the thin version of the kernel, and is caused
  43. by a conflict between the variable r and a corresponding variable
  44. in the integration packages.  There are a number of solutions, such
  45. as using a different variable the first time the integral is evaluated,
  46. evaluating another integral first (anything that loads the integration
  47. packages will do -- try Integrate[x, {x, 0, 1}]), loading the
  48. integration packages manually (<< Integrate`main`) before doing the
  49. integral, using the full version of the kernel, or editing a few lines
  50. in the integration packages to correct the problem at its source.
  51. The problem will be fixed in the next release.
  52.  
  53. The other problem, with Pi Sqrt[Pi]/(2 2 Sqrt[2]), was detected and
  54. fixed late last year.  This fix will also be included in the next
  55. release.
  56.  
  57. In addition to the upcoming fix, it is fairly easy to add
  58. workarounds that will work in Version 2.0 and in Version 2.1, and
  59. that handle all of the examples I have seen.
  60.  
  61. The bug is present in Version 2.0 and Version 2.1, and is not
  62. machine-dependent.
  63.  
  64. The fact that the bug has been part of the released product for
  65. several years and was not reported until recently suggests that
  66. it probably doesn't come up very often in practical situations.
  67. I suspect that very few people are affected by it.
  68.  
  69. As others have already noted, Times and Power perform a number
  70. of automatic transformations.  The infinite loop described here
  71. is caused by a conflict between two such transformations.  The
  72. details of what is going on have also already been posted by
  73. other users.
  74.  
  75. The loop occurs for the product of a rational number with a
  76. numerator of 1, and a rational power of the product of Pi (or
  77. other numerical constants, like E) and another rational number
  78. with a numerator of 1.
  79.  
  80. One workaround is to intercept the pattern that leads to the problem
  81. and arrange for it to evaluate to something else.
  82.  
  83. In[1]:= Unprotect[Times]
  84.  
  85. Out[1]= {Times}
  86.  
  87. In[2]:= (Pi*(x_Rational)?(Numerator[#1] == 1 & ))^(y_Rational)*
  88.            (z_Rational)?(Numerator[#1] == 1 & ) := rootPi[y] x^y z
  89.  
  90. In[3]:= Format[rootPi[y_]] := Pi^y
  91.  
  92. In[4]:= N[rootPi[y_]] := N[Pi^y]
  93.  
  94. In[5]:= Pi Sqrt[Pi]/(2 3 Sqrt[2])
  95.  
  96.           3/2
  97.         Pi
  98. Out[5]= ------
  99.            3/2
  100.         3 2
  101.  
  102. In[6]:= N[%]
  103.  
  104. Out[6]= 0.656234
  105.  
  106. There are a number of other approaches.
  107.  
  108. Again, registered users who have questions about these or other technical
  109. issues related to their use of Mathematica are encouraged to contact
  110. Wolfram Research Technical Support for assistance.
  111.  
  112. Dave Withoff
  113. Technical Development
  114. Wolfram Research
  115.  
  116.