home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / sci / math / symbolic / 2102 < prev    next >
Encoding:
Text File  |  1992-07-28  |  1.8 KB  |  54 lines

  1. Newsgroups: sci.math.symbolic
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!mips!sdd.hp.com!caen!umeecs!umn.edu!cda.mrs.umn.edu!naras
  3. From: naras@cda.mrs.umn.edu (B. Narasimhan)
  4. Subject: Need to evaluate an integral in Maple.
  5. Message-ID: <1992Jul28.195617.10851@news2.cis.umn.edu>
  6. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  7. Nntp-Posting-Host: sci234e.mrs.umn.edu
  8. Organization: University of Minnesota - Morris
  9. Date: Tue, 28 Jul 1992 19:56:17 GMT
  10. Lines: 42
  11.  
  12. Here is a maple session: (Maple V release 1.1, MSDOS 486 PC.)
  13.  
  14. > f:=proc(x) local y; y:=x; if y <= 0 then 0 elif y <= 1/2 then y;
  15. else 1; fi; end;
  16. > int('f(x)',x=0..1); 
  17.  
  18. ******** Returns the integral expression without evaluating it ***
  19.  
  20. > evalf(int('f(x)',x=0..1));
  21. Error, (in evalf/int) unable to handle singularity
  22. >
  23.  
  24. Now, what is the singularity that evalf/int imagines?
  25. A clue can be got by making the last piece of the function 1/2 instead
  26. of 1. Maple gives the correct answer 0.375 then. So it is the 
  27. discontinuity that throws evalf/int off.  Here is another funny thing:
  28. After this, I redefined f to be a totally different function and
  29. did the same evalf/int on it. It gave me the same answer .375.
  30. Try this:
  31.  
  32. > f:=proc(x) 0 end;
  33. > int('f(x)',x=0..1);
  34.                      0
  35. > f:=proc(x) if x < 1/2 then 0 else 1/2; fi; end;
  36. > int('f(x)',x=0..1);
  37.                      0                     # Still zero!
  38.  
  39.  
  40. Of course, the main question is: How does one force Maple to evaluate 
  41. an integral of the first kind? I am not interested in solutions
  42. that add up the various pieces of the integral, since I need to
  43. convolute such functions and plot them.
  44.  
  45. I looked and looked in my two new books from Springer on Maple.
  46. No clue.
  47.  
  48.  
  49. -- 
  50. B. Narasimhan                             naras@cda.mrs.umn.edu
  51. Division of Science and Math.
  52. The University of Minnesota at Morris
  53. Morris, MN 56267
  54.