Subject: denominator of really complicated expression
From: Ryan Krauss
Date: Wed, 23 Nov 2005 10:17:38 -0500
So, Robert was very much correct about the speed of save vs. stringout:
save takes 0.14 seconds
stringout takes roughly 300 seconds
So that's about a 2000 times speed up.
But, this leaves me with a bit of a daunting parsing task. There are
some people who have written python programs for parsing lisp and I
have a little lisp experience from writing scheme scripts for the
gimp. So, I am going to give this a try. I do need some help though
with getting started. I may try a simpler problem at first and that
may clear some things up.
How do I interpret this (the start of my lisp output):
;;; -*- Mode: LISP; package:maxima; syntax:common-lisp; -*-
(in-package "MAXIMA")
(DSKSETQ |$bv3|
'((MTIMES SIMP)
((MPLUS SIMP)
((MTIMES SIMP) |$s|
((MPLUS SIMP)
((MTIMES SIMP) 2 |$abeam|
((MEXPT SIMP RATSIMP) |$betabeam| 3) |$c4beam| |$Kact|
|$kbase| |$kj1| |$kj2| ((MEXPT SIMP RATSIMP) |$Lbeam| 2)
|$ml2| |$rl2| $TAU)
To convert this to a string that would be placed in a program for
python or fortran or whatever, are all the MTIMES SIMP operators
basically multiplication signs so that this nested lisp expression is
something like (* (+ (* s (+ (* 2 abeam (....
Does ((MEXPT SIMP RATSIMP) |$betabeam| 3) =>betabeam^3?
Are all the |var| really absolute values or is that a lisp/maxima delimiter?
Thanks for you help,
Ryan
On 11/22/05, Robert Dodier wrote:
> On 11/22/05, Ryan Krauss wrote:
>
> > Is there a faster way to pass the output to Python or to save it to a
> > file that can be read by other programs?
>
> It's likely that the "save" function will be faster, since save
> stores Lisp expressions instead of Maxima expressions
> (so formatting the output is probably faster).
> Lisp expressions might be easier for Python to handle, too.
>
> For what it's worth,
> Robert Dodier
>