rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

specint(gammaincomplete(v,a*t)*exp(-p*t),t) seems wrong #1575

Closed rtoy closed 2 days ago

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 20:15:17 Created by rtoy on 2005-12-09 03:53:24 Original: https://sourceforge.net/p/maxima/bugs/833


(%i12) assume(v>0,p>0);

(%o12) [v>0,p>0] (%i13) specint(gammaincomplete(v,a*t)*exp(-p*t),t);

SIMP2F1-WILL-CONTINUE-IN (%o13) a^v*(p+a)^(-v-1)*gamma(v+1)*%f[2,1]([v+1,3/2],[2],p/(p+a))

Compare this with

(%i14) specint(gammagreek(v,a*t)*exp(-p*t),t); (%o14) a^v*p^(-v-1)*gamma(v+1)/((a/p+1)^v*v)

This matches formula 34, p 179 in Tables of Transforms. Considering gammaincomplete = gamma(n)-gammagreek, the expression for gammaincomplete seems wrong.

It might still be right if the hypergeometric function simplifies, but maxima can't, and I can't think of any way to simplify it either.

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 20:15:19 Created by rtoy on 2006-02-12 19:15:59 Original: https://sourceforge.net/p/maxima/bugs/833/#41a0


Logged In: YES user_id=28849

The fix for transforming %w causes this return the result in terms of the associated Legendre function Q. Somewhat better, but I do not know if this is equivalent.

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 20:15:22 Created by robert_dodier on 2006-08-15 02:48:40 Original: https://sourceforge.net/p/maxima/bugs/833/#18f6


rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 20:15:26 Created by crategus on 2008-07-18 22:17:09 Original: https://sourceforge.net/p/maxima/bugs/833/#9715


Logged In: YES user_id=2039760 Originator: NO

I have suggested to use a representation as a Hypergeometric 1F1 for a<>0 for the Gammaincomplete function to get more simple results for the Laplace transform of the Gammaincomplete function.

Because $specint has no code to do the Laplace transform for the Hypergeometric function itself ($specint knows only an intern representation for the Hypergeometric function) it is more easy to transform to the Gammagreek function. The Gammagreek function will be transformed to the Hypergeometric 1F1 function.

The following changes produce the correct results shown in this thread:

=================================================================== RCS file: /cvsroot/maxima/maxima/src/hypgeo.lisp,v retrieving revision 1.40 diff -u -r1.40 hypgeo.lisp --- hypgeo.lisp 4 Jul 2008 14:12:52 -0000 1.40 +++ hypgeo.lisp 18 Jul 2008 22:03:29 -0000 @@ -2301,7 +2302,7 @@ ((eq flg 'kbateman) (kbatemantw i1 a1)) ((eq flg 'gammaincomplete) - (gammaincompletetw a1 i1)) + (gammaincomplete-to-gammagreek a1 i1)) ((eq flg 'kti) (kti i1 a1)) ((eq flg 'erfc) @@ -2582,6 +2583,28 @@ (power '$%e (div x -2)) (wwhit x (div (sub a 1) 2)(div a 2))))

+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Only for a=0 we use the general representation as a Whittaker W function. +;;; In all other cases we transform to a Gammagreek function. The Gammagreek +;;; function will be further transformed to a Hypergeometric 1F1 representation. +;;; With this change we get more simple and correct results for the Laplace +;;; transform of the Gammaincomplete function. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun gammaincomplete-to-gammagreek (a x) + (if (eq (asksign a) '$zero) + ;; The representation as a Whittaker W function for a=0 + (mul + (power x (div (sub a 1) 2)) + (power '$%e (div x -2)) + (wwhit x (div (sub a 1) 2) (div a 2))) + ;; In all other cases the representation as a Gammagreek function + (sub + (list '(%gamma) a) + (list '($gammagreek) a x)))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defun distrexecinit (fun) (cond ((and (consp fun) (consp (car fun))

===================================================================

The testsuite has no problems with this algorithm. With this changes this bug report could be closed. Should I commit this change of the code?

Dieter Kaiser

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 20:15:30 Created by crategus on 2008-08-06 11:11:34 Original: https://sourceforge.net/p/maxima/bugs/833/#034a


Logged In: YES user_id=2039760 Originator: NO

The code is changed as suggested. Closing the bug report.

Dieter Kaiser

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 20:15:33 Created by crategus on 2008-08-06 11:11:34 Original: https://sourceforge.net/p/maxima/bugs/833/#1f34