home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / sci / math / numanal / 2575 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  1.3 KB

  1. Path: sparky!uunet!gatech!psuvax1!hsdndev!cfa203!job
  2. From: job@head-cfa.harvard.edu (Jeffrey Oliver Breen)
  3. Newsgroups: sci.math.num-analysis
  4. Subject: Re: Integration of Step function algorithm/code any?
  5. Summary: The answer is 1!
  6. Message-ID: <1992Aug28.011918.22579@harlow.harvard.edu>
  7. Date: 28 Aug 92 01:19:18 GMT
  8. References: <1992Aug14.040957.16304@Princeton.EDU>
  9. Organization: Smithsonian Astrophysical Observatory, Cambridge, MA,  USA
  10. Lines: 33
  11.  
  12. In article <1992Aug14.040957.16304@Princeton.EDU> muyu@burn.Princeton.EDU (Muyu Guo) writes:
  13. >I am having trouble doing the integral using either qtrap
  14. >or qsimp from Numerical Recipes:
  15. >
  16. >    b
  17. >    /
  18. >    | f(x)dx,          with a < 1, b > 2
  19. >    /
  20. >    a
  21. >               and f(x) = 1 (1 <= x <= 2)
  22. >                 = 0  otherwise
  23. >
  24. >For example a=0, b=4 or the like the results were nonsense.
  25. >
  26. >Does anyone know if there is a good way to get thru this?
  27. >Thanks a million for your attention.
  28.  
  29. Since f(x) will be one from x=1 to x=2, and this range is included by
  30. the a<1 and b>2 guarantee, and the function is zero everywhere else,
  31. then the integral just becomes:
  32.  
  33.   2
  34.  /
  35.  | 1 dx, otherwise known as 1.  Is there a reason you were trying to
  36.  /
  37.  1
  38.  
  39. solve this numerically?
  40. -- 
  41. +-----------
  42. | Jeffrey Oliver Breen   Harvard-Smithsonian Center for Astrophysics,
  43. | (617) 495-7252         60 Garden St., Room B-340, MS 6, Cambridge, MA  02138
  44. |
  45.