Subject: Assistance requested with basic Maxima commands.
From: Robert Dodier
Date: Wed, 13 Jul 2005 23:57:53 -0600
Hello,
> (1) Is it possible to synthesize a command to convert a string into a
> valid expression, and then evaluate this using ev() ? The command
> string(expr) does the opposite, converts an expression to a string.
Copy this stuff to a file, say "parse_string.lisp", --
------------- cut here -------------
(defun $parse_string (s) (cond ((mstringp s) (really-parse-string s))
(t (merror "parse_string: ~M is a ~M, not a string." s (type-of s)))))
(defun really-parse-string (s) (with-input-from-string (ss
(ensure-terminator (print-invert-case (stripdollar s)))) (third (mread
ss))))
(defun ensure-terminator (s) (cond ((or (search "$" s :test
#'char-equal) (search ";" s :test #'char-equal)) s) (t (concatenate
'string s "$"))))
------------- cut here -------------
and then execute load ("parse_string.lisp")$ in Maxima.
Then try parse_string ("x + y + z"); parse_string ("aa/bb + cc/dd");
If that seems more or less in the right direction,
we can iterate on it some more here.
> (3) Is it possible to plot a matrix x versus a vector t as in Matlab:
> plot(t,x) ?
Well, this capability was recently added. So it is in the version
of plot.lisp in cvs but not in any official release yet.
I'm guessing you're using either 5.9.0 or 5.9.1 official release,
and I'm also guessing you're not a Lisp hacker.
In this case see http://maxima.sf.net/wiki/index.php/Maxima%20helpful%20hints
under "How do I plot a list of points?" which describes an ugly but
hopefully effective solution.
If I've guessed wrong, let me know and we'll go from there.
> (4) There does not seem to be a pause function as in Matlab ?
None that I know of. But see the demo function -- execute
? demo
or
describe ("demo");
> (5) I wrote a function which runs for quite some time. Just before the
> function exits I want to use a command to save all the computed
> variables into a file and load them later into Maxima for
> inspection. Is there such a command (?).
I think save ("myfile", all); is what you want.
There is a note about this on the aforementioned wiki page.
> (6) Some functions do not seem to be defined (?):
>
> (%i1) fullratsubst([x1=1,x2=2],x1^2-x2);
> 2
> (%o1) fullratsubst([x1 = 1, x2 = 2], x1 - x2)
> (%i2)
Try this --
load ("lrats");
fullratsubst([x1=1,x2=2],x1^2-x2);
I get -1 as the result.
> (7) From where can I buy Macsyma ?
Apparently you can buy it from the website http://www.symbolics.com/.
According to the website, they acquired Macsyma, etc., from Symbolics, Inc.
hope this helps,
Robert Dodier