On Fri, 3 Sep 2010, Barton Willis wrote:
< I think Maxima doesn't have a way to declare a function to be multioutative. If
< you are willing to experiment, try making a file multioutative.lisp (given below)
< and let me know if it works. Example
<
< (%i12) load("multioutative.lisp")$
< (%i13) declare(f,multioutative);
< (%o13) done
<
< (%i15) f(6*x, 7*y,p-q);
< (%o15) 42*(f(x,y,p)-f(x,y,q))
This is not consistent with the behaviour of outative,
it is more akin to multilinear. Also, your code appears
to only fish out numeric constants using numfactor, which
is not desirable.
Leo
<
< If all is well, I'll commit the multioutative code to the file /share/contrib/multiadditive.lisp
<
< ;;---------------start of multioutative.lisp
< (setq $opproperties ($cons '$multioutative $opproperties))
<
< (setq opers (cons '$multioutative opers)
< *opers-list (cons '($multioutative . multioutative) *opers-list))
<
< (defun multioutative (e z)
< (let ((op (car e))
< (args (margs e))
< (w 1))
< (setq args (mapcar #'(lambda (s)
< (let ((k ($numfactor s)))
< (setq w (mul w k))
< (div s k))) args))
<
< (if (or (eq w 1) ($subvarp e)) (protected-oper-apply e z)
< (mul w (protected-oper-apply (simplifya (cons op args)) z)))))
< ;;-----------------end of multioutative.lisp
<
< --Barton
<
< -----maxima-bounces at math.utexas.edu wrote: -----
<
<
< >Hi,
< >I?have?an?operator?F?of?two?arguments.?How?to?declare?in?maxima?that?
< >constants?should?be?pulled?out?also?in?the?second?argument??The?command?
< >declare(F,outative)?removes?constants?only?from?the?first?one.
< >Marek?Pietrow.
< >_______________________________________________
< >Maxima?mailing?list
< >Maxima at math.utexas.edu
< >http://www.math.utexas.edu/mailman/listinfo/maxima
< _______________________________________________
< Maxima mailing list
< Maxima at math.utexas.edu
< http://www.math.utexas.edu/mailman/listinfo/maxima
<
<
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.