dos batch files idea



James Jarrell <jrjarrell3 at gmail.com> wrote:

>Could someone please tell me if this is possible.  Creating a dos batch 
>file that opens and runs maxima is easy to do.  What I was wondering if 
>I could create a dos batch file that opens maxima, has it execute a few 
>commands and then closes maxima?  

Yes, indeed this is possible.  I did that recently in a Makefile for a document I was creating in LaTeX.  Here's how it works.   I wanted to create a polar plot and so I had a Maxima file like this:

g:exp(%i*2*%pi*t)+0.5*exp(%i*6*%pi*t)$
plot2d([parametric, realpart(g), imagpart(g), [t, 0, 1], [nticks, 100]],
 [x,-2,2], [y,-2,2], [xlabel, "real"], [ylabel, "imaginary"],
 [plot_format, gnuplot],
 [gnuplot_preamble, "set grid polar; set size square"], [gnuplot_term, ps],
 [gnuplot_out_file, "c:/ece301/notes/plot2d.ps"]) $

Which was then driven using the maxima.bat file that you get when you install Maxima.  (Look in your c:\Program Files\Maxima-5.16.1\bin directory.)

Ed