Subject: Help to get started with the code of Maxima
From: Samuel Lê
Date: Tue, 25 Jun 2013 01:08:55 +0000
Thanks for the explanations,
So I guess (meval '(($DIFF SIMP) ((%SIN SIMP) $X) $X) ) should enable me to
access to the symbolic maths functions from Common Lisp? Unfortunately
meval is not recognized, even after I compile and load maxima into my SBCL
repl. Am I missing something?
On Mon, Jun 24, 2013 at 11:31 PM, Richard Fateman <fateman at gmail.com> wrote:
> On 6/24/2013 4:02 PM, Samuel L? wrote:
>
>> Hi!
>>
>> I'd like to start playing with Maxima's code. I suppose the maxima's
>> software is organized as follow:
>> 1. the maxima prompt takes the input from the user
>> 2. it is passed to a lisp function that translates it into some LISP
>> sexpr ( something like "derivative (x^2,x);" ->
>> (some-function-for-derivative '(^x 2) 'x) )
>> 3. it is evaluated (i.e (* 2 x))
>> 4. it is translated back into standard notation (i.e "2*x") and passed
>> back to the prompt.
>>
>> Please correct me if I am wrong. Now, what I'd like to do is to call the
>> maths functions directly from Common Lisp (i.e access directly to
>> "some-function-for-derivative" in my example). Is it possible to do so?
>>
>> Many thanks,
>> Sam
>>
>>
>> yes. You should, however start thinking more "functionally" e.g.
> (loop (display (evaluate (parse (readline)))))
> not "taking stuff" or "passing stuff".
>
>
> To see what that lisp sexpr is do this..
>
> (%i1) diff(sin(x),x);
> (%o1) cos(x)
> (%i2) ?print(%i1)
>
>
> note that ?print is the lisp print function.
>
> You will see
>
> (($DIFF SIMP) ((%SIN SIMP) $X) $X)
>
> to see how lisp works on this, type on a command line..
>
> (%i3) :lisp (meval '(($DIFF SIMP) ((%SIN SIMP) $X) $X) )
>
> see also to_lisp().
>
> meval is like lisp eval except it works on maxima expressions.
>
> There is more info in this 1979 paper..
> http://www.cs.berkeley.edu/~**fateman/papers/simplifier.txt<http://www.cs.berkeley.edu/~fateman/papers/simplifier.txt>
>
>
>