Add symbol checks to translators for MCALL, MARRAYREF, and MARRAYSET
[maxima.git] / share / contrib / diffequations / odeutils.lisp
blob1429d62093f67e212b0ae96aa08ddd6c9b8d3ae8
1 ;; Author Barton Willis
2 ;; University of Nebraska at Kearney
3 ;; Copyright (C) 2004, Barton Willis
5 ;; Brief Description: Maxima code for linear homogeneous second order
6 ;; differential equations.
8 ;; Maxima odelin is free software; you can redistribute it and/or
9 ;; modify it under the terms of the GNU General Public License,
10 ;; http://www.gnu.org/copyleft/gpl.html.
12 ;; Maxima odelin has NO WARRANTY, not even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 ($put '$odeutils 1 '$version)
17 ;; Map the function f onto a mbag and simplify the result. When the
18 ;; bag is an equality, list, or matrix, simplification isn't needed;
19 ;; however, new types of bags (say sets) may need simplification after
20 ;; the mapping.
22 ;; Maxima is hit-or-miss about mapping functions over mbags. I suggest
23 ;; we develop that a function similar to this one and that we use it
24 ;; everywhere a function is mapped over a mbag.
26 ;; If the arguments of bag are in CRE form, margs changes them to general
27 ;; form---and mbag-map may return an expression in general form. Maybe this
28 ;; behavior is impolite?
30 (defun mbag-map (f bag)
31 (simplify `((,(mop bag)) ,@(mapcar f (margs bag)))))
33 (defun number-of-unks (p unks)
34 (let (($listconstvars nil))
35 ($cardinality ($intersection ($setify ($listofvars p)) unks))))