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 (merror (intl:gettext
"desolve(<eqn>,<depvar>): dependant variable <depvar> cannot be a mapatom, found: ~M") vars
))
11 (setq eqns
(list '(mlist) eqns
))
12 (setq vars
(list '(mlist) vars
))
14 (setq ovar
(maref vars
1))
15 (unless (= ($length ovar
) 1)
16 (merror (intl:gettext
"desolve: more than one independent variable: ~M") ovar
))
17 (setq ovar
(simplify ($inpart ovar
1)))
19 (simplify (map1 (getopr (m-tlambda&env
(($z
) (ovar lvar
))
21 (simplify ($laplace $z ovar lvar
))))
24 (simplify (map1 (getopr (m-tlambda&env
(($z
) (ovar lvar
))
26 (simplify `((%laplace
) ,$z
,ovar
,lvar
))))
29 (let ((errcatch (cons bindlist loclist
))
30 (ret (errset (simplify ($solve teqns tvars
)))))
34 (when (or (like teqns
'((mlist)))
35 (like teqns
(list '(mlist) '((mlist)))))
36 ;; NOT CLEAR WHAT IS THE PROBLEM. SHOULD BE MORE EXPLICIT.
37 (merror (intl:gettext
"desolve: can't handle this case.")))
38 (setq teqns
(simplify ($first teqns
)))
40 (setq teqns
(simplify ($first teqns
))))
42 (simplify (map1 (getopr (m-tlambda&env
(($z
) (lvar ovar
))
44 (simplify ($ilt $z lvar ovar
))))
46 (if (and flag
(= ($length tvars
) 1))