1 ;;; -*- Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*- ;;;;
5 (defmfun $desolve
(eqns vars
)
6 (let (teqns tvars ovar
(lvar ($gensym
)) (flag nil
) ($dispflag nil
))
7 (declare (special $dispflag
))
9 (setq eqns
(list '(mlist) eqns
))
10 (setq vars
(list '(mlist) vars
))
12 (setq ovar
(maref vars
1))
13 (unless (= ($length ovar
) 1)
14 (merror (intl:gettext
"desolve: more than one independent variable: ~M") ovar
))
15 (setq ovar
(simplify ($inpart ovar
1)))
17 (simplify (map1 (getopr (m-tlambda&env
(($z
) (ovar lvar
))
19 (simplify ($laplace $z ovar lvar
))))
22 (simplify (map1 (getopr (m-tlambda&env
(($z
) (ovar lvar
))
24 (simplify `((%laplace
) ,$z
,ovar
,lvar
))))
27 (let ((errcatch (cons bindlist loclist
))
28 (ret (errset (simplify ($solve teqns tvars
)) lisperrprint
)))
32 (when (or (like teqns
'((mlist)))
33 (like teqns
(list '(mlist) '((mlist)))))
34 ;; NOT CLEAR WHAT IS THE PROBLEM. SHOULD BE MORE EXPLICIT.
35 (merror (intl:gettext
"desolve: can't handle this case.")))
36 (setq teqns
(simplify ($first teqns
)))
38 (setq teqns
(simplify ($first teqns
))))
40 (simplify (map1 (getopr (m-tlambda&env
(($z
) (lvar ovar
))
42 (simplify ($ilt $z lvar ovar
))))
44 (if (and flag
(= ($length tvars
) 1))
48 (add2lnc '$desolve $props
)