Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## maxima-commits

 [Maxima-commits] CVS: maxima/src hypgeo.lisp,1.51,1.52 From: Dieter Kaiser - 2009-03-21 22:32:00 ```Update of /cvsroot/maxima/maxima/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13776 Modified Files: hypgeo.lisp Log Message: Improving \$specint to get the Laplace transforms for gen_laguerre, laguerre and hermite 1. Add support for the Laplace transform of the noun forms of the laguerre, gen_laguerre and hermite function. (The verb forms of this functions automatically expand when the indizes are integers). 2. Add the transformation to a hypergeometric 1F1 function for the Hermite function. These transformations work for an even or odd integer order and give the expected Laplace transforms of the Hermite function. Tested with CLISP 2.44 and GCL 2.6.8. No problems with the testsuite. Index: hypgeo.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/src/hypgeo.lisp,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- hypgeo.lisp 21 Mar 2009 14:53:47 -0000 1.51 +++ hypgeo.lisp 21 Mar 2009 22:31:48 -0000 1.52 @@ -677,6 +677,26 @@ ((coeffpp) (a zerp))) nil)) +;; Recognize gen_laguerre(v1,v2,w), Generalized Laguerre function +(defun one-gen-laguerre (expr) + (m2 expr + '((mplus) + ((coeffpt) + (u nonzerp) + ((%gen_laguerre) (v1 true) (v2 true) (w true))) + ((coeffpp) (a zerp))) + nil)) + +;; Recognize laguerre(v1,w), Laguerre function +(defun one-laguerre (exr) + (m2 exr + '((mplus) + ((coeffpt) + (u nonzerp) + ((%laguerre) (v1 true) (w true))) + ((coeffpp) (a zerp))) + nil)) + ;; Recognize %c[v1,v2](w), Gegenbauer function (defun onec (exp) (m2 exp @@ -753,6 +773,16 @@ ((coeffpp) (a zerp))) nil)) +;; Recognize hermite(v1,w), Hermite function +(defun one-hermite (expr) + (m2 expr + '((mplus) + ((coeffpt) + (u nonzerp) + ((%hermite) (v1 true) (w true))) + ((coeffpp) (a zerp))) + nil)) + ;; Recognize %q[v1,v2](w), Associated Legendre function of the second kind (defun oneq (exp) (m2 exp @@ -1226,7 +1256,7 @@ e (cdras 'e l) f (cdras 'f l)) (return (ltscale u var *par* c a e f)))) - (return 'other-trans-to-follow))) + (return (setq *hyp-return-noun-flag* 'other-trans-to-follow)))) (defun substl (p1 p2 p3) (cond ((eq p1 p2) p3)(t (maxima-substitute p1 p2 p3)))) @@ -1925,6 +1955,8 @@ arg1 (cdras 'w l) rest (cdras 'u l)) (return (lt1m rest arg1 index1 index11)))) + + ;; Laplace transform for the Generalized Laguerre function, %l[v1,v2](w) (cond ((setq l (onel u)) (setq index1 (cdras 'v1 l) index11 (cdras 'v2 l) @@ -1935,6 +1967,25 @@ index1 index11 'l)))) + + ;; Laplace transform for the Generalized Laguerre function + ;; We call the routine for %l[v1,v2](w). + (cond ((setq l (one-gen-laguerre u)) + (setq index1 (cdras 'v1 l) + index11 (cdras 'v2 l) + arg1 (cdras 'w l) + rest (cdras 'u l)) + (return (integertest rest arg1 index1 index11 'l)))) + + ;; Laplace transform for the Laguerre function + ;; We call the routine for %l[v1,0](w). + (cond ((setq l (one-laguerre u)) + (setq index1 (cdras 'v1 l) + index11 0 + arg1 (cdras 'w l) + rest (cdras 'u l)) + (return (integertest rest arg1 index1 index11 'l)))) + (cond ((setq l (onec u)) (setq index1 (cdras 'v1 l) index11 (cdras 'v2 l) @@ -1963,15 +2014,37 @@ index1 nil 'u)))) + + ;; Laplace transform for the Hermite function, %he[index1](arg1) (cond ((setq l (onehe u)) (setq index1 (cdras 'v1 l) arg1 (cdras 'w l) rest (cdras 'u l)) - (return (integertest rest - arg1 - index1 - nil - 'he)))) + (return + (cond ((maxima-integerp index1) + ;; When index1 is an integer, we transform directly + ;; to a hypergeometric function. For this case we + ;; get a Laplace transform when the arg is the + ;; square root of the variable. + (sendexec rest (hermite-to-hypergeometric index1 arg1))) + (t + (integertest rest + arg1 + index1 + nil + 'he)))))) + + ;; Laplace transform for the Hermite function, hermite(index1,arg1) + (cond ((setq l (one-hermite u)) + (setq index1 (cdras 'v1 l) + arg1 (cdras 'w l) + rest (cdras 'u l)) + (return + (cond ((maxima-integerp index1) + (sendexec rest (hermite-to-hypergeometric index1 arg1))) + (t + (integertest rest arg1 index1 nil 'he)))))) + (cond ((setq l (hyp-onep u)) (setq index1 (cdras 'v1 l) index11 (cdras 'v2 l) @@ -2845,6 +2918,48 @@ (div (numjory v sort z 'y) (sin% (mul v '\$%pi)))))) +;; The algorithm of the implemented Hermite function %he does not work for +;; the known Laplace transforms. For an even or odd integer order, we +;; can represent the Hermite function by the Hypergeometric function 1F1. +;; With this representations we get the expected Laplace transforms. +(defun hermite-to-hypergeometric (order arg) + (cond + ((and (maxima-integerp order) + (or (and (integerp order) (evenp order)) + (and (symbolp order) (kindp order '\$even)))) + ;; Transform to 1F1 for order an even integer + (mul + (power 2 order) + (power '\$%pi (div 1 2)) + (inv (simplify (list '(%gamma) (div (sub 1 order) 2)))) + (list '(mqapply) (list '(\$%f array) 1 1) + (list '(mlist) (div order -2)) + (list '(mlist) (div 1 2)) + (mul arg arg)))) + + ((and (maxima-integerp order) + (or (and (integerp order) (oddp order)) + (and (symbolp order) (kindp order '\$odd)))) + ;; Transform to 1F1 for order an odd integer + (mul -2 arg + (power 2 order) + (power '\$%pi (div 1 2)) + (inv (simplify (list '(%gamma) (div order -2)))) + (list '(mqapply) (list '(\$%f array) 1 1) + (list '(mlist) (div (sub 1 order) 2)) + (list '(mlist) (div 3 2)) + (mul arg arg)))) + (t + ;; The general case, transform to 2F0 + ;; For this case we have no Laplace transform. + (mul + (power (mul 2 arg) order) + (list '(mqapply) (list '(\$%f array) 2 0) + (list '(mlist) (div order 2) + (div (sub 1 order) 2)) + (list '(mlist)) + (div -1 (mul arg arg))))))) + ;;; LT functions are various experts on Laplace transforms of the ;;; function . The expression being transformed is ;;; r*(args). The first arg of each expert is r, The remaining ```