Interfacing to maxima



> Does this mean that the math engine could be called as follows:
> (loop
>   (print (simplify (meval expr))))

That's certainly one way of doing it.  Note that you have not reset the
Asksign database, though (meval* takes care of that for you -- don't you
love the descriptive function name?).  Also remember that Maxima is
basically an interactive system, so there are issues if the evaluation
requires Asksign's etc.  Take a look at Continue (in macsys.lisp) to see
more gory details.

Also, it depends what you mean by the "math engine".  If your control
structure is in Lisp, you might not use MEval at all, just call the
various functions explicitly, e.g.  ($integrate MyFavoriteIntegrand '$x)
and then call Simplify.  Of course, this means you will have to worry
about some issues such as noun forms explicitly.  Consider for example:

   (setq intsini ($integrate '((%sin) ((mexpt) x i)) 'x))
     => ((%integrate) ...)   ;; No closed form

Now substitute 2 for i in this:

   (setq intsin2 ($substitute 2 'i intsini))
      ;; Note that you must use $substitute, not Lisp's subst, here

     => ((%integrate) ...)

If you were programming in Maxima, you could now ask for the integral to
be reevaluated using ev(...,integrate).  But this is not available to
you in Lisp.  Worse, $EV is defined as an mfexpr*, and is a pain to call
from Lisp (though of course it can be done)....

      -s