Mixing numerics and maxima in LISP



On 10/11/11, Akshay Srinivasan <akshaysrinivasan at gmail.com> wrote:
> Hello,
> 	I've been going the round-about way for my mechanics problems, doing
> symbolics in Maxima, generating code for solving the thus obtained ODE
> by C through Lisp/Python, then doing visualisation in LISP with cl-opengl.
> 	I'm not all that experienced with Lisp (or Maxima for that matter!)
> yet, but I sense that I can generate code on the fly using macros. I
> know maxima has a lisp mode; but from what I've seen, it
> does not strike me as a particularly clean interface; by "clean", I mean
> something like Sussman and Wisdom's scmutils.
> 	I can probably do something like replace maxima's function tags in the
> expression list with the usual operators and put it inside a function
> definition; but is there a better interface for Lisp ? Is there a better
> way of going about this ? Has someone done something like this before
> with Maxima - so that I can steal their code :) ?

If I understand correctly, by "replace function tags" you mean to
transform stuff like ((MPLUS) 1 2 3) to (+ 1 2 3). Right?
If so then Maxima's compile and translate functions can do that.
With mode_declare, compile & translate will try to apply Lisp functions
to the arguments, but if the translator can't determine that all arguments
will be numbers, then it falls back on general symbolic operations.

Another approach is to use fortran or f90 to translate expressions
to Fortran, and then compile & run that.

best,
Robert Dodier