home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / compress / 3860 < prev    next >
Encoding:
Internet Message Format  |  1992-11-16  |  3.6 KB

  1. Path: sparky!uunet!ogicse!news.u.washington.edu!ns1.nodak.edu!plains.NoDak.edu!compton
  2. From: compton@plains.NoDak.edu (Curtis M. Compton)
  3. Newsgroups: comp.compression
  4. Subject: Re: Math question
  5. Message-ID: <BxtHEp.F36@ns1.nodak.edu>
  6. Date: 16 Nov 92 16:20:49 GMT
  7. Article-I.D.: ns1.BxtHEp.F36
  8. Sender: usenet@ns1.nodak.edu (News login)
  9. Organization: University of North Dakota, Grand Forks
  10. Lines: 88
  11. Nntp-Posting-Host: plains.nodak.edu
  12.  
  13. In article <24005@hacgate.SCG.HAC.COM>
  14.     abirenbo@rigel.cel.scg.hac.com (Aaron Birenboim) writes:
  15.  
  16. >While working on an optimization problem related to compression
  17. >I bumped into the following nasty little problem :
  18.  
  19. >   evaluate:
  20. >
  21. >                {           [(i+1)q                                      }
  22. >             d  {           [                                            }
  23. >            --- {  Integral [      (x - (i + 0.5) q)^2 * exp(-c * x) dx  }
  24. >             dq {           [                                            }
  25. >                {           [i*q                                         }
  26.  
  27. >  I have evaluated the integral..... and it is terribly nasty.  Even if I
  28. >didn't goof on the evaluation, i would surely goof on the differentiation.
  29.  
  30. >  c and i are constants.  I'm trying to minimize error for q.
  31.  
  32. >  I seem to remember some terribly nasty formulas for handling the
  33. >differentiation before evaluating any integral.
  34.  
  35. >  I think it involved the bounds, derivitives of the bounds, the integrand
  36. >and the derivitave of the integrand.
  37.  
  38. Well, I ran your problem through Macsyma and here goes...
  39.  
  40. [Macsyma header deleted]
  41.  
  42. (C1) (x - (i + 0.5) * q)^2 * exp(-c * x);
  43.  
  44.                                             2   - C X
  45. (D1)                       (X - (I + 0.5) Q)  %E
  46. (C2) integrate (%,x,i*q,(i+1)*q);
  47.  
  48. Is   Q   zero or nonzero?
  49. nonzero;
  50.  
  51. /* Just a guess on my part. */
  52.  
  53. [Macsyma garbage deleted]
  54.  
  55. Is   Q   positive or negative?
  56. positive;
  57.  
  58. /* Just another guess. */
  59.  
  60. [stuff deleted]
  61.  
  62.         2  2                - C I Q     2  2                - C I Q - C Q
  63.       (C  Q  - 4 C Q + 8) %E          (C  Q  + 4 C Q + 8) %E
  64. (D2)  ----------------------------- - -----------------------------------
  65.                      3                                  3
  66.                   4 C                                4 C
  67. (C3) diff (%,q);
  68.  
  69.                      2  2                - C I Q - C Q
  70.        (- C I - C) (C  Q  + 4 C Q + 8) %E
  71. (D3) - -----------------------------------------------
  72.                                3
  73.                             4 C
  74.  
  75.        2            - C I Q - C Q       2  2                - C I Q
  76.    (2 C  Q + 4 C) %E                I (C  Q  - 4 C Q + 8) %E
  77.  - ------------------------------ - -------------------------------
  78.                    3                                2
  79.                 4 C                              4 C
  80.  
  81.        2            - C I Q
  82.    (2 C  Q - 4 C) %E
  83.  + ------------------------
  84.                 3
  85.              4 C
  86. (C4) fullratsimp (%);
  87.  
  88.           2    2                                  C Q       2      2   2
  89. (D4) - ((C  I Q  + (- 4 C I - 2 C) Q + 8 I + 4) %E    + (- C  I - C ) Q
  90.  
  91.                                                             - C I Q - C Q     2
  92.                            + (- 4 C I - 2 C) Q - 8 I - 4) %E             /(4 C )
  93.  
  94. There's your answer!  I hope it helps.
  95. -- 
  96. Curtis M. Compton           | Future home of Rookerie Software |
  97. compton@plains.NoDak.edu    +----------------------------------+
  98. 560 Carleton Court, Apt #11 | "I am the Walrus"               - John Lennon
  99. Grand Forks, ND 58203       | "I am the Keeper of the Cheese" - Ren Hoek
  100. (701) 795-5099              | "I am the Master of Penguins"   - Curt Compton
  101.