From: Cliff Yapp <starseeker@us...>  20030722 22:19:02

Update of /cvsroot/maxima/htdocs/faq In directory sc8prcvs1:/tmp/cvsserv25477 Added Files: faq.html Log Message: Sample faq page  NEW FILE: faq.html  <html><head><! Change this title to something more appropriate for your FAQ. You do NOT need to leave the reference to makefaq.py in there. ><title>Maxima FrequentlyAsked Questions</title> <meta name="keywords" content="mathematics, symbolic mathematics, Maxima, Macsyma, Mathematica, Maple, Pythonica, GPL, Open Source"><! If you do not want to use a CSS stylesheet, remove this next line. > <link type="text/css" rel="stylesheet" href="faq_files/faq.txt"></head> <body bgcolor="#ffffff"> <img src="faq_files/maxima.gif"> <h1> <! Change this text line below to something more appropriate > FrequentlyAsked Questions <p> This FAQ resides at <a href="http://glue.umd.edu/%7Emilgram/maxima/faq.html">; http://glue.umd.edu/~milgram/maxima/faq.html</a>;. Maxima version at last update: 5.9.0. </p></h1> <! Change this line to have your contact information in it. > <p>For more information about this faq, please contact Judah Milgram, email address formed by last name, at eng dot umd dot edu. </p><hr> <p><i>FAQ Revised: Friday 21 March 2003 15:21:23</i></p> <hr><h2>Table of Contents</h2> <dl><dt><b>1. General</b></dt><dd><ul> <li><a href="#General0">1.1. Acknowledgements</a></li> <li><a href="#General1">1.2. Did anybody really ask any of these questions?</a></li> <li><a href="#General2">1.3. What is Maxima?</a></li> <li><a href="#General3">1.4. Macsyma vs. DOEMacsyma vs. Symbolics Macsyma vs. Maxima?</a></li> <li><a href="#General4">1.5. Who wrote it?</a></li> <li><a href="#General5">1.6. Who's maintaining it now?</a></li> <li><a href="#General6">1.7. Is it free?</a></li> <li><a href="#General7">1.8. What about other symbolic manipulation packages?</a></li> </ul></dd><dt><b>2. Documentation</b></dt><dd><ul> <li><a href="#Documentation0">2.1. Where can I read about it?</a></li> <li><a href="#Documentation1">2.2. Why two "Reference Manuals"?</a></li> <li><a href="#Documentation2">2.3. What about the page at utexas.edu? It only shows versions up to 5.6.0?</a></li> <li><a href="#Documentation3">2.4. What about Lisp?</a></li> </ul></dd><dt><b>3. Installing Maxima</b></dt><dd><ul> <li><a href="#Installing%20Maxima0">3.1. Where do I get it?</a></li> <li><a href="#Installing%20Maxima1">3.2. What do I need to run it?</a></li> <li><a href="#Installing%20Maxima2">3.3. What Linux Distributions come with Maxima?</a></li> </ul></dd><dt><b>4. Lisp</b></dt><dd><ul> <li><a href="#Lisp0">4.1. What LISP implementations will Maxima work with?</a></li> <li><a href="#Lisp1">4.2. CLISP</a></li> <li><a href="#Lisp2">4.3. CMUCL</a></li> <li><a href="#Lisp3">4.4. GCL</a></li> </ul></dd><dt><b>5. Emacs</b></dt><dd><ul> <li><a href="#Emacs0">5.1. How do I enable maxima mode in emacs?</a></li> </ul></dd><dt><b>6. Bugs and other problems</b></dt><dd><ul> <li><a href="#Bugs%20and%20other%20problems0">6.1. Why do trivial bugs still exist on a program this old?</a></li> <li><a href="#Bugs%20and%20other%20problems1">6.2. What's the preferred way to report bugs?</a></li> <li><a href="#Bugs%20and%20other%20problems2">6.3. Transcripts in bug reports</a></li> <li><a href="#Bugs%20and%20other%20problems3">6.4. What about compilation problems?</a></li> <li><a href="#Bugs%20and%20other%20problems4">6.5. maxima5.9.0 won't compile with gcl 2.4.0</a></li> </ul></dd><dt><b>7. Additional Packages</b></dt><dd><ul> <li><a href="#Additional%20Packages0">7.1. (Hyper)graphs</a></li> </ul></dd><dt><b>8. Beginner Questions</b></dt><dd><ul> <li><a href="#Beginner%20Questions0">8.1. inchar and outchar</a></li> <li><a href="#Beginner%20Questions1">8.2. Solving simultaneous equations.</a></li> <li><a href="#Beginner%20Questions2">8.3. How to extract a column from a matrix?</a></li> <li><a href="#Beginner%20Questions3">8.4. Why doesn't 'return' work in loops?</a></li> <li><a href="#Beginner%20Questions4">8.5. DESOLVE doesn't work!?</a></li> <li><a href="#Beginner%20Questions5">8.6. Quote needed?</a></li> <li><a href="#Beginner%20Questions6">8.7. Substitution</a></li> </ul></dd><dt><b>9. TeX Output</b></dt><dd><ul> <li><a href="#TeX%20Output0">9.1. How do I customize the Tex output for individual Maxima variables?</a></li> </ul></dd></dl> <hr><h2>1. General</h2> <dl><dt><b><a name="General0">1.1. Acknowledgements</a></b></dt><dd><p>Numerous people have contributed material to this FAQ and/or to the Maxima mailing list (from which much of the FAQ material is snarfed :) Notably: Jay Belanger, Richard Fateman, David Holmgren, Nikolaos Ioakimidis, Stavros Macrakis, Martin Rubey, Raymond Toy, Barton Willis, and many others,  above all: William Schelter. (if you know of someone I've forgotten, please drop me a line). </p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="General1">1.2. Did anybody really ask any of these questions?</a></b></dt><dd><p>Many of them :) </p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="General2">1.3. What is Maxima?</a></b></dt><dd><p>From the README: Maxima is a full symbolic computation program. It is full featured doing symbolic manipulation of polynomials, matrices, rational functions, integration, Toddcoxeter, graphing, bigfloats. It has a symbolic debugger source level debugger for maxima code. Maxima is based on the original Macsyma developed at MIT in the 1970's. It is quite reliable, and has good garbage collection, and no memory leaks. It comes with hundreds of self tests. </p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="General3">1.4. Macsyma vs. DOEMacsyma vs. Symbolics Macsyma vs. Maxima?</a></b></dt><dd><p> The system developed at MIT was called Macsyma (although the nicknames MACSYM and MAXIMA were sometimes used since filenames were limited to six uppercaseonly characters in sixbit character code). </p> <p> Symbolics licensed Macsyma from M.I.T. and registered "Macsyma" as a trademark at some point (presumably with M.I.T.'s permission). </p> <p> When Macsyma source ceased to be freely available, pressure was put on M.I.T. (mostly by Fateman) to transfer the code which had been developed largely with Department of Energy (DOE) funding to the DOE, which then released it to others under certain conditions. </p> <p> That codebase was called DOE Macsyma. I don't know what legal rights the DOE had to the *name* Macsyma as opposed to the codebase, but presumably the noncommercial users of DOE Macsyma wanted to avoid any legal wrangling around the name, and started using the name Maxima at some point (but I don't know when that was). </p> <p> So the short answer as I understand it is that Maxima is simply the most recent name for the branch that started under the name DOE Macsyma. </p><em> Stavros</em><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="General4">1.5. Who wrote it?</a></b></dt><dd><p> (From the <a href="http://maxima.sourceforge.net/">home page</a>: Maxima is a descendant of DOE Macsyma, which had its origins in the late 1960s at MIT. It is the only system based on that effort still publicly available and with an active user community, thanks to its open source nature. Macsyma was the first of a new breed of computer algebra systems, leading the way for programs such as Maple and Mathematica. This particular variant of Macsyma was maintained by William Schelter from 1982 until he passed away in 2001. In 1998 he obtained permission to release the source code under <a href="http://www.gnu.org/licenses/licenses.html#GPL">GPL</a>;. It was his efforts and skill which have made the survival of Maxima possible, and we are very grateful to him for volunteering his time and skill to keep the original Macsyma code alive and well. </p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="General5">1.6. Who's maintaining it now?</a></b></dt><dd><p> Since William Schelter's passing a group of users and developers has formed to keep Maxima alive and kicking. We are currently in a transitional state, deciding what directions to go in next and seeing what our abilities and resources are. Maxima itself is reasonably feature complete at this stage, with abilities such as symbolic integration, 3D plotting, and an ODE solver, but there is a lot of work yet to be done in terms of bug fixing, cleanup, and documentation. This is not to say there will be no new features, but there is much work to be done before that stage will be reached, and for now new features are not likely to be our focus. </p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="General6">1.7. Is it free?</a></b></dt><dd><p> Yes. Maxima is distributed under the <a href="http://www.gnu.org/licenses/licenses.html#GPL">GNU General Public License</a>, with some export restrictions from the U.S. Department of Energy. </p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="General7">1.8. What about other symbolic manipulation packages?</a></b></dt><dd><p> There are several, although not all are opensource or otherwise free. </p><ul> <li> <a href="http://wwwswiss.ai.mit.edu/%7Ejaffer/JACAL.html">JACAL</a>;, GPL'd, based on Scheme </li><li><a href="http://yacas.sourceforge.net/yacas.html">YACAS</a>;, GPL'd </li><li><a href="http://www.synaptics.com/people/daveg/">Calc</a>;, the GNU Emacs Calculator. GPL'd. </li><li> <a href="http://www.strout.net/python/pythonica.html">Pythonica</a>; (License unknown; source available at that link) </li><li> <a href="http://www.scientek.com/macsyma/main.htm">Macsyma</a>; </li><li> <a href="http://www.wolfram.com/products/mathematica/index.html">Mathematica</a>; </li><li> <a href="http://www.maplesoft.com/">Maple</a>; </li></ul> <p></p> <p> David Holmgren writes: "I've tried [Jacal, Yacas, and Calc] with Windows and Linux. Jacal and Yacas don't have the range of commands that Maxima does, but Calc is a bit more extensive (i.e., has a fairly general integrator)." </p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd></dl> <hr><h2>2. Documentation</h2> <dl><dt><b><a name="Documentation0">2.1. Where can I read about it?</a></b></dt><dd><p> </p><ul> <li> The impatient should start with <a href="http://maxima.sourceforge.net/referencemanual/maxima_1.html#SEC1">Introduction to Maxima</a>, Section 1 of the Maxima Reference Manual (q.v., below). </li><li> The Maxima <a href="http://maxima.sourceforge.net/">home page</a> </li><li> The UT <a href="http://www.math.utexas.edu/mailman/listinfo/maxima">Maxima mailing list</a>. There are also lists established on sourceforge, but as yet they see very little traffic. Most of the action is on the UT list. </li><li> Mike Clarkson's <a href="http://starship.python.net/crew/mike/maxima/html/macref/">DOEMaxima Reference Manual</a> </li><li> The Maxima Reference Manual (apparently no longer maintained but has useful information) <ul><li> <a href="http://maxima.sourceforge.net/referencemanual/maxima_toc.html">HTML Version</a> </li><li> <a href="http://maxima.sourceforge.net/referencemanual/maxima.pdf">PDF Version</a> </li></ul> </li><li>Michel Gosse's excellent Maxima page at <a href="http://www.maxima.fr.st/">; http://www.maxima.fr.st/</a>;. Another good reason to learn French. </li></ul> <p></p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Documentation1">2.2. Why two "Reference Manuals"?</a></b></dt><dd><p> The original Maxima Reference Manual by William Schelter is no longer maintained. Mike Clarkson's manual is not exactly a replacement of WS's manual, but rather, a separate manual prepared by Michael Clarkson for DOEMacsyma in the past and now adapted to Maxima with a change in the title: DOEMaxima instead of DOEMacsyma. </p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Documentation2">2.3. What about the page at utexas.edu? It only shows versions up to 5.6.0?</a></b></dt><dd><p> <a href="http://www.ma.utexas.edu/maxima.html">; http://www.ma.utexas.edu/maxima.html</a>; was William Schelter's old home page and is no longer maintained. It does have some screenshots, however, as well as other useful information. </p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Documentation3">2.4. What about Lisp?</a></b></dt><dd><p> Some web sites with good information on Common Lisp: </p><ul> <li>The <a href="http://clcookbook.sourceforge.net/">Common Lisp Cookbook</a> </li><li><a href="http://clisp.cons.org/resources.html">; http://clisp.cons.org/resources.html</a>;, with general info (emphasis on CLISP) </li><li><a href="http://www.apl.jhu.edu/%7Ehall/lisp.html">An Introduction and Tutorial for Common Lisp</a> </li><li><a href="http://www2.cs.cmu.edu/afs/cs.cmu.edu/user/dst/www/LispBook/index.html">Common Lisp: A Gentle Introduction to Symbolic Computation</a> by David Touretzky </li><li><a href="http://www2.cs.cmu.edu/Groups/AI/html/cltl/cltl2.html">Common Lisp the Language</a> </li></ul> <p></p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd></dl> <hr><h2>3. Installing Maxima</h2> <dl><dt><b><a name="Installing Maxima0">3.1. Where do I get it?</a></b></dt><dd>[to be added]<br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Installing Maxima1">3.2. What do I need to run it?</a></b></dt><dd>[to be added]<br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Installing Maxima2">3.3. What Linux Distributions come with Maxima?</a></b></dt><dd>Vadim Zhytnikov writes: "AFAIK the only two Linux distros which come with Maxima are: <ul> <li> Debian (unstable branch) <a href="http://glue.umd.edu/%7Emilgram/maxima/www.debian.org">; http://www.debian.org</a>; </li><li> ALT Linux (Master 2.0, Master 2.2) <a href="http://glue.umd.edu/%7Emilgram/maxima/www.altlinux.com">; http://www.altlinux.com</a>"; </li></ul><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd></dl> <hr><h2>4. Lisp</h2> <dl><dt><b><a name="Lisp0">4.1. What LISP implementations will Maxima work with?</a></b></dt><dd>clisp, CMUCL and GCL are fully supported by Maxima; previous versions of Maxima only fully supported GCL. Ports to other ANSI lisps should be straightforward and are welcome; please contact the developers if you are interested in working on a port.<br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Lisp1">4.2. CLISP</a></b></dt><dd>clisp includes GNU readline support, so Maxima will have advanced commandline editing facilities when built with it. Get it from <a href="http://clisp.cons.org/">; http://clisp.cons.org</a>;. Maxima will fail to build with 2.26 because of a bug in clisp. 2.28 and 2.29 are known to work. There are currently unresolved problems with floating point numbers in Maxima with clisp 2.30. 2.29 is recommended.<br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Lisp2">4.3. CMUCL</a></b></dt><dd>Get it from <a href="http://cmucl.cons.org/">; http://cmucl.cons.org</a>;. CMUCL is the fastest option for Maxima on platforms where it is available. Unfortunately, it does not include readline support. However, readline support can be added by wrapping maxima with the ledit executable. See <a href="ftp://ftp.inria.fr/INRIA/Projects/cristal/Daniel.de_Rauglaudre/Tools/">; ftp://ftp.inria.fr/INRIA/Projects/cristal/Daniel.de_Rauglaudre/Tools/</a>; for ledit. Maxima will build with CMUCL 18c, but will hang on some runtime operations. 18d is known to work.<br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Lisp3">4.4. GCL</a></b></dt><dd>Get it at <a href="http://savannah.gnu.org/projects/gcl">; <http://savannah.gnu.org/projects/gcl></a>;. 2.4.4 and 2.5.0 should work. 2.5.0 has not yet been released as of this writing. The cvs version of 2.5.0 has been used to successfully build Maxima. GCL versions starting with 2.4.3 can be built with readline support, so Maxima will have advanced commandline editing facilities when build with it.<br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd></dl> <hr><h2>5. Emacs</h2> <dl><dt><b><a name="Emacs0">5.1. How do I enable maxima mode in emacs?</a></b></dt><dd>Put something like these in your ~/.emacs: <pre>(setq automodealist (cons '("\\.max" . maximamode) automodealist)) (setq loadpath (cons "/usr/share/maxima/5.9.0/emacs" loadpath )) (autoload 'maxima "maxima" "Running Maxima interactively" t) (autoload 'maximamode "maxima" "Maxima editing mode" t) </pre> Instead of modifying the load path, you could copy all the .el files from /usr/share/maxima/5.9.0/emacs (or wherever) to a sitelisp directory in your load path.<br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd></dl> <hr><h2>6. Bugs and other problems</h2> <dl><dt><b><a name="Bugs and other problems0">6.1. Why do trivial bugs still exist on a program this old?</a></b></dt><dd><p></p> <em>I just submitted a bug on sourceforge and was just wondering, why do trivial bugs still exist on a program this old? These are things my calculator can do right now, while this program has apparently been around for 30+ years.</em> <p> </p><p> <strong>Answer:</strong> </p><ol> <li> You may have reported something which is not a bug [comment: it wasn't] but represents a misunderstanding of what the program is supposed to do. (This is very common, though it may not apply to your report of course). </li><li> The particular feature you exercised was not written 30 years ago, but was written by a user  much like yourself, perhaps  and since it was not central to the system's operation, has not been tested. It may have been written in the late 1970s. </li><li> Much of this system has not been revised since 1982, so that the last 20 years (when only the commercial version was under development) don't exactly count. </li><li> Hopefully the bug will get fixed now that it has been identified. </li></ol> <p></p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Bugs and other problems1">6.2. What's the preferred way to report bugs?</a></b></dt><dd><p> Bugs should be entered directly into the bug database at <a href="https://sourceforge.net/tracker/?group_id=4933&atid=104933">; https://sourceforge.net/tracker/?group_id=4933&atid=104933</a>;. This is a better way of tracking them than reporting them to the mailing list. If of course you'd like to discuss some issue, then mailing to the list is useful. </p> <p> The cgi interface to the bug database will allow you to submit files that may be useful in documenting the problem. </p> <p> A basic bug report includes enough information to reproduce the problem, including the version information given by bug_report(). </p> <p> A fuller, better better bug report includes: </p><ul> <li>A good title summarizing the problem. </li><li>A clear procedure for reproducing the problem. Please verify that your procedure actually recreates the problem in a fresh Maxima. If you can't reproduce it, still file it, but try to include as much information about what you did before. The simpler and shorter the procedure, the better. It's always appreciated when the discoverer of a bug narrows it down to a simple case. Differentials are always good, too  that is, cases which are almost the same but DO work. </li><li>If it's not completely obvious, an explanation of why this is the wrong answer and what the right answer is. </li><li>The exact version number you're running under, as shown by bug_report(). </li><li>A brief statement of why it's important to solve this problem (to help prioritize maintenance work), e.g. "almost every user will run into this insidious bug sooner or later and lose all his work" or "this bug keeps my group from using Maxima, since this class of matrix is ubiquitous in population genetics" or "the workaround is fine for now" or "this is an artifically constructed case, and I'm pretty sure that it will never affect an ordinary user" (though often bugs in complicated cases turn out to show up in simple cases as well). </li><li>If you have a workaround (a procedure for avoiding the problem) or a patch (code to fix the problem), that's nice, but not essential. If you have a patch, put FIX in the title of the bug report so that maintainers can incorporate it quickly. </li><li>Some problems may not be bugs, but functional limitations. In this case, it's interesting to know what other systems do, notably commercial Macsyma. If you know why this limitation might be there, say so ("Kratov theory says that this problem is intractable in general"). Also interesting if you know an algorithm for handling them e.g. "the ODE package doesn't handle the seventhorder triexponential case, but muPad 29.23 does; I believe the modified PhuocMa`fuz method as implemented by Odibwa (J.Sym.Alg. 23:5:230) handles this correctly". Even better, "...and I am implementing it for Maxima 6.0" :) . </li></ul> <p></p> <em>  Stavros Macrakis</em><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Bugs and other problems2">6.3. Transcripts in bug reports</a></b></dt><dd><p> Email and bug reports often include transcripts of Maxima sessions (a good thing). Unfortunately, the layout often gets garbled because Tabs are not treated consistently across mail programs, HTML, etc. Even for mail programs that display tabs correctly, everything gets screwed up as soon as the original mail is indented for quoting (">" at the beginning of the line). </p> <p> So if you include transcripts in mail or bug reports, please either </p><ul> <li> Change the tabs to spaces (e.g. using Unix expand or Emacs untabify). This is better if it is important to be able to read the expression, or... </li><li> Turn off Display2D when generating the transcript. This is better if it would be useful to cut and paste the expression back into an input line. </li></ul> <p></p> <p> Example: </p><pre>(C47) taylor(erf(x),x,0,5); 3 5 (2 SQRT(%PI)) x (2 SQRT(%PI)) x SQRT(%PI) x (D47)/T/    +  + . . . %PI 3 %PI 5 %PI What that looks like in some mail readers: 3 5 (2 SQRT(%PI)) x (2 SQRT(%PI)) x SQRT(%PI) x (D47)/T/    +  + . . . %PI 3 %PI 5 %PI Same thing after untabify: (C47) taylor(erf(x),x,0,5); 3 5 (2 SQRT(%PI)) x (2 SQRT(%PI)) x SQRT(%PI) x (D47)/T/    +  + . . . %PI 3 %PI 5 %PI Using display2d:false: (C48) display2d:false; (D48) FALSE (C49) d47; (D49) 2*SQRT(%PI)*x/%PI2*SQRT(%PI)*x^3/(3*%PI)+SQRT(%PI)*x^5/(5*%PI) </pre> <p></p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Bugs and other problems3">6.4. What about compilation problems?</a></b></dt><dd><p> Submit a description of the problem to <a href="https://sourceforge.net/tracker/?group_id=4933&atid=104933">; https://sourceforge.net/tracker/?group_id=4933&atid=104933</a>; </p><ul> <li>If you suspect GCL, please cc <a href="mailto:gcldevel@..."><gcldevel@...></a> </li><li>I advise everyone to stay away from gcc2.96  if it works, its an accident. The compiler is known to be broken. gcc2.95, gcc3.0, gcc3.1 and gcc3.2 all should work with GCL cvs or the latest stable. </li><li>Submit the full configure and build output, together with the versions of the libraries on the system in question upon which GCL depends (ldd saved_gcl) and the compiler and binutils versions: <ul> <li> binutils: <code>ld v</code> </li><li> gcc: <code>gcc v</code> </li></ul> </li></ul> <em>  Camm Maguire</em> <p></p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Bugs and other problems4">6.5. maxima5.9.0 won't compile with gcl 2.4.0</a></b></dt><dd><p> You need a more recent version of gcl. 2.4.0 is known not to work. 2.4.x for some x works I think. 2.5.x should work too. </p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd></dl> <hr><h2>7. Additional Packages</h2> <dl><dt><b><a name="Additional Packages0">7.1. (Hyper)graphs</a></b></dt><dd><p> </p><ul> <li> Martin Rubey's package <a href="http://www.mat.univie.ac.at/%7Erubey/Maxima/graphs.lisp">graphs.lisp</a>; enables maxima to generate various (hyper)graphs, calculate some of their properties and provides an interface to <a href="http://pigale.sourceforge.net/">PIGALE</a>;, which tries to embed them nicely on the screen. </li></ul> <p></p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd></dl> <hr><h2>8. Beginner Questions</h2> <dl><dt><b><a name="Beginner Questions0">8.1. inchar and outchar</a></b></dt><dd><p> <em> When I enter this equation: <pre>(C1) eq1:v1=(1/(z1))*(b1*vin  g1*v2  c1*fb); </pre> I get an output line entirely different than what I expected</em> </p> <p> <strong>Answer:</strong> "c1" is your input statement. Note the input and output line numbers have labels like (C1) and (D1). Try it with another variable name, for example c_1. </p> <p> Or, you can change the characters used to form the label by setting "inchar" and "outchar": </p><pre>(C1) inchar; (D1) C (C2) outchar; (D2) D (C3) inchar : c_; (D3) c_ (c_3) outchar : d_; (d_3) d_ (c_4) 5!; (d_4) 120 </pre> <p></p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Beginner Questions1">8.2. Solving simultaneous equations.</a></b></dt><dd><p> <em>I want to deduce n[v]=2*nn[c]2 from <pre>n[e]=1/2*(3*n[v]+n[c]) and nn[e]+n[v]=1 </pre> In other words: I want to express n[v] in terms of other variables. But solve does't work this for me. What function should I use? </em> </p> <p> <strong>Answer:</strong> You need to solve for the <strong>two</strong> variables: </p><pre>(C1) n[e]=1/2*(3*n[v]+n[c]); 3 n + n v C (D1) n =  e 2 (C2) nn[e]+n[v]=1; (D2) n + n  n = 1 v e (C3) solve([d1,d2],[n[v],n[e]]); (D3) [[n = 2 n  n  2, n = 3 n  n  3]] v C e C </pre> Another possibility: <pre>(C1) eliminate([n[e]=1/2*(3*n[v]+n[c]),nn[e]+n[v]=1],[n[e]]); (D1) [ n + 2 n  n  2] v c (C2) solve(%,n[v]); (D2) [n = 2 n  n  2] v c </pre> <p></p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Beginner Questions2">8.3. How to extract a column from a matrix?</a></b></dt><dd><p> <em>For matrix 'm' 'm[i]' is the ith row of 'm'. Is there any way to get a column? I know about 'col(m,i)' but 'col' returns matrix and it's not possible to assign a value to it. It's convinient to write 'm[i]:[1,2,3]'. Why can't I do that with columns?</em> </p> <p> <strong>Answer:</strong> try transposing m then transposing it again. </p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Beginner Questions3">8.4. Why doesn't 'return' work in loops?</a></b></dt><dd><p> <em>For example:</em> </p><pre>(C1) block([],for i:1 thru 5 do return(1), 0); (D1) 0 </pre> <p></p> <p> <strong>Answer:</strong> It returned 1 from the forloop. Then the block returned 0. </p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Beginner Questions4">8.5. DESOLVE doesn't work!?</a></b></dt><dd><p> <em>desolve(diff(y(x),x)=(42*x)/(3*y^25),y(x)) produces the wrong answer.</em> </p> <p> <strong>Answer:</strong> As the documentation says, "the functional relationships must be explicitly indicated". That is, for Desolve, you can't write 'diff(y(x),x)=y+x; you must write 'diff(y(x),x)=y(x)+x. As it happens, Desolve can't solve that, but ODE2 can  though ODE2 takes a different input form (yes, I agree this is annoying and illogical): depends(y,x)$ 'diff(y,x)=y+x. Transcript: </p><pre>(C1) depends(y,x); (D1) [y(x)] (C2) 'diff(y,x)=(42*x)/(3*y^25); dy 4  2 x (D2)  =  dx 2 3 y  5 (C3) ode2(%,y,x); 3 2 y  5 y x  4 x (D3)   =  + %C 2 2 /* Now let's check the answer */ (C4) diff(d3,x); 2 dy dy 3 y   5  dx dx 2 x  4 (D4)   =  2 2 (C5) solve(d4,'diff(y,x)); dy 2 x  4 (D5) [ =  ] dx 2 3 y  5 (C6) subst(d5,d2); 2 x  4 4  2 x (D6)   =  2 2 3 y  5 3 y  5 (C7) ratsimp(lhs(d6)rhs(d6)); (D7) 0 </pre> <p></p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Beginner Questions5">8.6. Quote needed?</a></b></dt><dd><p> <em>In the DESOLVE example above, if you tell maxima that y depends on x, then you do not need to quote the diff operator. The quote is needed when depends(y,x) is not typed.</em> </p> <p> <strong>Answer:</strong> True. In the ODE example, you could omit the Depends and quote the diff, or include the Depends and either quote the diff or not.<br> </p> <p> The quote is stylistic, emphasizing that you're talking *about* the differential rather than actually carrying out the differentiation.<br> </p> <p> Of course, the discussion about desolve and ode2 needs to be put in a broader context of "how to solve differential equations". Here, it is just contrasting desolve's approach to dependency (use explicit functions like f(x)) vs. ode2's (declare that y depends on x or simply quote the differentials). </p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd><dt><b><a name="Beginner Questions6">8.7. Substitution</a></b></dt><dd><p> <em> I have the following function call in a more complicated expression: <pre>erf((((64800 * %i + 64800) * t + 37 * %i + 35)/72)) </pre> I have another function acref, which takes 2 arguments, the first is the argument of the error function and the second is a approximation order. I want to substitute the call to acerf in place of erf in my more complicated expression, for example: <pre>acerf((((64800 * %i + 64800) * t + 37 * %i + 35)/72), 2) </pre> Is there a easy way to do this in maxima? </em> </p> <p> <strong>Answer:</strong> </p><pre>matchdeclare(any, true)$ defrule(r1,erf(any), acerf(any,order))$ order:2$ apply1(expression, r1); </pre> or some variation of that. <p></p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd></dl> <hr><h2>9. TeX Output</h2> <dl><dt><b><a name="TeX Output0">9.1. How do I customize the Tex output for individual Maxima variables?</a></b></dt><dd><p> Create a file "foo.lisp" (or whatever) with lisp statements like </p><pre>(defprop $cla "c_{l_\alpha}" texword) </pre> then load it in your script, for example: <pre>(C1) load("foo.lisp"); (D1) foo.lisp (C2) tex(cla); $$c_{l_alpha}$$ </pre> Maxima 5.9.0 and later has a utility function <code>texput</code> that allows you to customize TeX output. Here is the same example as before <pre>(C1) texput(cla, "c_{l_\\alpha}")$ (C3) tex(cla); $$c_{l_\alpha}$$ </pre> Notice that here we must use the double slash on alpha to get a single slash on the TeX output. <p></p><br><br></dd><dd><p><a href="#top">Return to top of page</a></p></dd></dl> <hr> <p>Copyright (c) 2003 Judah Milgram. <b>Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.</b></p> <! You do NOT have to keep this line below in here. I have no issue if you wish to remove it. > <p><i>This list of questions and answers was generated by <a href="http://www.makefaq.org/">makefaq</a>.</i>; </p></body></html> 