From: Thomas Dye Date: Tue, 9 Oct 2012 17:15:18 +0000 (-1000) Subject: Documentation for Maxima source code blocks. X-Git-Tag: release_7.9.3~80 X-Git-Url: http://orgmode.org/w/?p=worg.git;a=commitdiff_plain;h=3d450fa624cfd8c17a15005ff67d244c02809dac Documentation for Maxima source code blocks. --- diff --git a/org-contrib/babel/languages/images/maxima-3d.png b/org-contrib/babel/languages/images/maxima-3d.png new file mode 100644 index 0000000..eff0f7a Binary files /dev/null and b/org-contrib/babel/languages/images/maxima-3d.png differ diff --git a/org-contrib/babel/languages/ob-doc-maxima.org b/org-contrib/babel/languages/ob-doc-maxima.org new file mode 100644 index 0000000..c513dac --- /dev/null +++ b/org-contrib/babel/languages/ob-doc-maxima.org @@ -0,0 +1,170 @@ +#+OPTIONS: H:3 num:nil toc:2 \n:nil @:t ::t |:t ^:{} -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc +#+STARTUP: align fold nodlcheck hidestars oddeven lognotestate hideblocks +#+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) +#+TAGS: Write(w) Update(u) Fix(f) Check(c) noexport(n) +#+TITLE: Maxima Source Code Blocks in Org Mode +#+AUTHOR: Thomas S. Dye +#+EMAIL: tsd[at]tsdye[dot]com +#+LANGUAGE: en +#+STYLE: +#+LINK_UP: ../languages.html +#+LINK_HOME: http://orgmode.org/worg/ +#+EXPORT_EXCLUDE_TAGS: noexport + +#+name: banner +#+begin_html +
+

+ Org Mode support for Maxima +

+

+ + + +

+
+#+end_html + +* Template Checklist [8/12] :noexport: + - [X] Revise #+TITLE: + - [X] Indicate #+AUTHOR: + - [X] Add #+EMAIL: + - [X] Revise banner source block [3/3] + - [X] Add link to a useful language web site + - [X] Replace "Language" with language name + - [X] Find a suitable graphic and use it to link to the language + web site + - [X] Write an [[Introduction]] + - [X] Describe [[Requirements%20and%20Setup][Requirements and Setup]] + - [X] Replace "Language" with language name in [[Org%20Mode%20Features%20for%20Language%20Source%20Code%20Blocks][Org Mode Features for Language Source Code Blocks]] + - [ ] Describe [[Header%20Arguments][Header Arguments]] + - [ ] Describe support for [[Sessions]] + - [ ] Describe [[Result%20Types][Result Types]] + - [ ] Describe [[Other]] differences from supported languages + - [X] Provide brief [[Examples%20of%20Use][Examples of Use]] +* Introduction +Maxima is a computer algebra system descended from Macsyma, which was +originally released in 1982. It is released under the terms of the +GNU General Public License. + +Maxima is written in Common Lisp. It can be accessed and extended in +Lisp. + +* Requirements and Setup +Maxima binaries are available for Windows and Linux. These either +require a compatible Common Lisp or an executable Lisp image. Mac OS +X users can install via brew or MacPorts. The combinations of +operating system and Lisp implementation known to run Maxima can be +found on [[http://maxima-project.org/wiki/index.php?title%3DMaxima_ports][the Maxima ports page]]. + +There are several versions of Maxima, some with different names. The +variable =org-babel-maxima-command= can be set to the name of your +Maxima executable. The default value is "maxima". + +Maxima ships with =Emacs= modes. Instructions for configuring them +can be found on [[http://emacswiki.org/emacs/MaximaMode][emacswiki]]. =imaxima= is an =Emacs= front end with +image that displays fully typeset math in your =Emacs= window. + +You must activate Maxima by adding a line to +=org-babel-load-languages=: + +#+BEGIN_SRC emacs-lisp + (org-babel-do-load-languages + 'org-babel-load-languages + '((maxima . t))) ; this line activates maxima +#+END_SRC + + +* Org Mode Features for Maxima Source Code Blocks +** Header Arguments +There are no Maxima-specific default header argument values. + +The header argument, =:cmdline=, can be used to pass command line +arguments to Maxima. + +** Sessions +Org-mode support for Maxima does not include sessions. + +** Result Types +Maxima produces the full range of result types. + +* Examples of Use + +The following source code block uses =maxima= as a calculator for +powers of 12, where the powers are passed with a variable. + +#+begin_example +,#+name: test-maxima +,#+header: :exports results +,#+header: :var x=1.3121254 +,#+begin_src maxima + programmode: false; + print(12^x); +,#+end_src +#+end_example + +#+name: test-maxima +#+header: :exports results +#+header: :var x=1.3121254 +#+begin_src maxima + programmode: false; + print(12^x); +#+end_src + +#+results: test-maxima +: 26.06280316745402 + +Of course, =maxima= is more than a calculator. + +#+begin_example +,#+name: solve-maxima +,#+header: :exports results +,#+begin_src maxima :results output + programmode: false; + eq: x**2-16 = 0; + solution: solve(eq, x); + print(solution); +,#+end_src +#+end_example + +#+name: solve-maxima +#+header: :exports results +#+begin_src maxima :results output + programmode: false; + eq: x**2-16 = 0; + solution: solve(eq, x); + print(solution); +#+end_src + +#+results: solve-maxima +: solve: solution: +: x = - 4 +: x = 4 +: [%t1, %t2] + +With =gnuplot= installed (4.0 or higher), 3D graphics are possible. +This example is from [[http://maxima.sourceforge.net/maxima-gnuplot.html][a tutorial on the maxima/gnuplot interface]]. + +#+begin_example +,#+name: 3d-maxima +,#+header: :file images/maxima-3d.png +,#+header: :exports results +,#+header: :results graphics +,#+begin_src maxima + programmode: false; + plot3d(atan(-x^2+y^3/4),[x,-4,4],[y,-4,4],[grid,50,50],[gnuplot_pm3d,true]); +,#+end_src +#+end_example + +#+name: 3d-maxima +#+header: :file images/maxima-3d.png +#+header: :results graphics +#+header: :exports results +#+begin_src maxima + programmode: false; + plot3d(atan(-x^2+y^3/4),[x,-4,4],[y,-4,4],[grid,50,50],[gnuplot_pm3d,true]); +#+end_src + +#+results: 3d-maxima +[[file:images/maxima-3d.png]] +