Maxima (software)

Revision as of 22:14, 11 March 2025 by imported>QMeqGR (Minor updates to wxMaxima description.)
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Template:Short description {{#invoke:Infobox|infobox}}Template:Template other{{#invoke:Check for unknown parameters | check | showblankpositional=1 | unknown = Template:Main other | preview = Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y | AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo upright | logo size | logo title | logo_alt | logo_caption | logo_upright | logo_size | logo_title | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot upright | screenshot size | screenshot title | screenshot_alt | screenshot_upright | screenshot_size | screenshot_title | service_name | size | standard | title | ver layout | website | qid }}Template:Main other

Maxima (Template:IPAc-en) is a powerful software package for performing computer algebra calculations in mathematics and the physical sciences. It is written in Common Lisp and runs on all POSIX platforms such as macOS, Unix, BSD, and Linux, as well as under Microsoft Windows and Android. It is free software released under the terms of the GNU General Public License (GPL).

HistoryEdit

Maxima is based on a 1982 version of Macsyma, which was developed at MIT with funding from the United States Department of Energy and other government agencies. A version of Macsyma was maintained by Bill Schelter from 1982 until his death in 2001. In 1998, Schelter obtained permission from the Department of Energy to release his version under the GPL. That version, now called Maxima, is maintained by an independent group of users and developers. Maxima does not include any of the many modifications and enhancements made to the commercial version of Macsyma during 1982–1999. Though the core functionality remains similar, code depending on these enhancements may not work on Maxima, and bugs which were fixed in Macsyma may still be present in Maxima, and vice versa. Maxima participated in Google Summer of Code in 2019 under International Neuroinformatics Coordinating Facility.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

Symbolic calculationsEdit

Like most computer algebra systems, Maxima supports a variety of ways of reorganizing symbolic algebraic expressions, such as polynomial factorization, polynomial greatest common divisor calculation, expansion, separation into real and imaginary parts, and transformation of trigonometric functions to exponential and vice versa. It has a variety of techniques for simplifying algebraic expressions involving trigonometric functions, roots, and exponential functions. It can calculate symbolic antiderivatives ("indefinite integrals"), definite integrals, and limits. It can derive closed-form series expansions as well as terms of Taylor-Maclaurin-Laurent series. It can perform matrix manipulations with symbolic entries.

Maxima is a general-purpose system, and special-case calculations such as factorization of large numbers, manipulation of extremely large polynomials, etc. are sometimes better done in specialized systems.

Numeric calculationsEdit

Maxima specializes in symbolic operations, but it also offers numerical capabilities<ref name="MaximaSpringer">Template:Cite book</ref> such as arbitrary-precision integer, rational number, and floating-point numbers, limited only by space and time constraints.

ProgrammingEdit

Maxima includes a complete programming language with ALGOL-like syntax but Lisp-like semantics. It is written in Common Lisp and can be accessed programmatically and extended, as the underlying Lisp can be called from Maxima. It uses gnuplot for drawing.

For calculations using floating point and arrays heavily, Maxima has translators from the Maxima language to other programming languages (notably Fortran), which may execute more efficiently.

InterfacesEdit

File:WxMaxima 0.7.1 screenshot.png
Screenshot of the wxMaxima interface for Maxima

Various graphical user interfaces (GUIs) are available for Maxima:

  • wxMaxima<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref> is high-quality graphical front-end using the wxWidgets framework. wxMaxima provides a cell structure similar to the Mathematica notebook as shown in the figure to the right. Sessions in wxMaxima can be saved in a variety of file formats for later use.

|CitationClass=web }}</ref>

|CitationClass=web }}</ref>

  • The GNU TeXmacs and LyX mathematical editor programs can be used to provide an interactive GUI for Maxima, as can SageMath. Other options include the Imaxima front end, as well as an Emacs and XEmacs interaction mode which is activated by Imaxima.
  • Climaxima,<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref> a CLIM-based front-end.<ref>Template:Citation</ref>

Examples of Maxima codeEdit

Basic operationsEdit

Arbitrary-precision arithmeticEdit

<syntaxhighlight lang="maxima"> bfloat(sqrt(2)), fpprec=40; </syntaxhighlight><math>1.41421356237309504880168872420969807857 \cdot 10^0</math>

FunctionEdit

<syntaxhighlight lang="maxima" line="1"> f(x):=x^3$ f(4); </syntaxhighlight><math>64</math>

ExpandEdit

<syntaxhighlight lang="maxima"> expand((a-b)^3); </syntaxhighlight><math>-b^3+3 ab^2-3a^2b+a^3</math>

FactorEdit

<syntaxhighlight lang="maxima"> factor(x^2-1); </syntaxhighlight><math>(x-1)(x+1)</math>

Solving equationsEdit

<math>x^2+a \ x + 1=0</math><syntaxhighlight lang="maxima"> solve(x^2 + a*x + 1, x); </syntaxhighlight><math>[x=-\Biggl(\frac{\sqrt{a^2-4}+a}{2}\Biggr),x=\frac{\sqrt{a^2-4}-a}{2}]</math>

Solving equations numericallyEdit

<math>\cos x = x</math><syntaxhighlight lang="maxima"> find_root(cos(x) = x, x, 0, 1); </syntaxhighlight><math>0.7390851332151607</math><syntaxhighlight lang="maxima"> bf_find_root(cos(x) = x, x, 0, 1), fpprec = 50; </syntaxhighlight><math>7.3908513321516064165531208767387340401341175890076 \cdot 10^{-1}</math>

Indefinite integralEdit

<math>\int x^2+\cos x\ d x</math><syntaxhighlight lang="maxima"> integrate(x^2 + cos(x), x); </syntaxhighlight><math>\sin x + \frac{x^3}{3}</math>

Definite integralEdit

<math>\int_{0}^{1}\frac{1}{x^3+1}\, dx</math><syntaxhighlight lang="maxima"> integrate(1/(x^3 + 1), x, 0, 1), ratsimp; </syntaxhighlight><math>\frac{\sqrt3 \log2+\pi}{3^{\frac{3}{2}}}</math>

Numerical integralEdit

<math>\int_{0}^{2} \sin(\sin (x)) \, dx</math><syntaxhighlight lang="maxima"> quad_qags(sin(sin(x)), x, 0, 2)[1]; </syntaxhighlight><math>1.247056058244003</math>

DerivativeEdit

<math>{d^3 \over d x^3} \cos^2 x</math><syntaxhighlight lang="maxima"> diff(cos(x)^2, x, 3); </syntaxhighlight><math>8 \cos{x}\sin{x}</math>

LimitEdit

<math>\lim_{x \to \infty} \frac{1+\sinh{x}}{e^{x}}</math><syntaxhighlight lang="maxima"> limit((1+sinh(x))/exp(x), x, inf); </syntaxhighlight><math>\frac{1}{2}</math>

Number theoryEdit

<syntaxhighlight lang="maxima"> primes(10, 20); </syntaxhighlight><math>[11,13,17,19]</math><syntaxhighlight lang="maxima"> fib(10); </syntaxhighlight><math>55</math>

SeriesEdit

<math>\sum_{x=1}^\infty \frac{1}{x^2} </math><syntaxhighlight lang="maxima"> sum(1/x^2, x, 1, inf), simpsum; </syntaxhighlight><math>\frac{\pi^2}{6}</math>

Series expansionEdit

<syntaxhighlight lang="maxima"> taylor(sin(x), x, 0, 9); </syntaxhighlight><math>x-\frac{x^3}{6}+\frac{x^5}{120}-\frac{x^7}{5040}+\frac{x^9}{362880}</math><syntaxhighlight lang="maxima"> niceindices(powerseries(cos(x), x, 0)); </syntaxhighlight><math>\sum_{i=0}^\infty \frac{(-1)^ix^{2i}}{(2i)!}</math>

Special functionsEdit

<syntaxhighlight lang="maxima"> bessel_j(0, 4.5); </syntaxhighlight><math>-0.3205425089851214</math><syntaxhighlight lang="maxima"> airy_ai(1.5); </syntaxhighlight><math>0.07174949700810543</math>

See alsoEdit

Template:Portal

ReferencesEdit

Template:Reflist

Further readingEdit

External linksEdit

Template:Sister project Template:Sister project

Template:Computer algebra systems Template:Numerical analysis software Template:Authority control