Mathematica is a widely-used computer algebra system originally conceived by Stephen Wolfram, developed by a team of mathematicians and programmers that he assembled and led, and sold by his company Wolfram Research. Mathematica is also a powerful programming language emulating multiple paradigms on top of term-rewriting.
The Mathematica programming language is based on term-rewriting and supports both functional and procedural programming (though functional code is much more efficient in general). It is implemented in an object-oriented variant of C, but the bulk of the extensive code library is actually written in the Mathematica language that can be used to extend the system. Typically, new code is added in the form of Mathematica "packages", i.e., text files written in the Mathematica language.
In the Mathematica system, the core language is interpreted by a kernel that performs the actual computations. The results are usually communicated to one of several front ends. Communication between the kernel and the front end (or any other client, like user-written programs) uses the MathLink protocol, often over a network. It is possible for several front end processes to connect to the same kernel, and for one front end to be connected to several kernels.
Unlike some other computer algebra systems, for example Maxima or Maple, Mathematica tries to apply the currently stored transformation rules as long as possible, looking for a fixed point. For this to be meaningful, absence of side-effects is beneficial (though not enforced), hence the similarity to functional programming. Functions and code are first-class and not opaque. Scoping is dynamic, but there are also some constructs that try to simulate lexical scope (all of these can easily be broken).
Mathematica built on the ideas in Cole and Wolfram's earlier Symbolic Manipulation Program (SMP).
Wolfram has released the following versions:
So the determinant of such a matrix is 0.
The following numerically calculates the root of the equation ex = x2 + 2, starting at the point x = -1.
InFindRoot* Out*= {x -> 1.3190736768573652}
See List of hello world programs for the prototypical Hello World program.
The most concise approach is to use one of the many specialized functions:
InArray[GCD, {5, 5} Out*=
There are at least three other approaches to this: InTable* Out*=
An APL-style approach: InOuter*] Out*= Outer corresponds to the outer product operator, Range corresponds to the iota operator. The Outer function permits any function, whether it be named, or anonymous, which are functions specified on the fly by using #n to specify the function argument and appending an &. The above function could be equivalently specified as Outer#2 &, Range*," target="_blank" >Range*, but Mathematica permits the above shortcut as well.
An iterative approach: In*:= l1 = {}; (* initialize as empty list, since we want a list in the end *) For[i = 1, i <= 5, i++, l2 = {}; For[j = 1, j <= 5, j++, l2 = AppendGCD* ]; l1 = Appendl2; (* append the sublist, that is, the row *) ]; l1 Out*= Observe that this solution is considerably larger than the previous ones.
If the FullForm command is used on this expression however: InFullForm[x^4 + 1 OutPlus*
Nearly all objects in Mathematica have the basic form heade2, ... (which may be displayed or entered in some other fashion). For example, the head of the above example is Plus, and symbols such as x have form Symbol*. Lists have this structure too, where the head is List.
The principle permits ordinary expressions unrelated to lists to be operated on with list operators:
InExpand*)/13]
Because of this equivalence between a regular mathematical object represented in Mathematica to that of a simple list structure, some built-in Mathematica functions permit threading, where functions map themselves over lists without much further specification. Indeed, Apply threads itself over lists when invoked as InApply[Log, , 1 Out{Log*," target="_blank" >Log*," target="_blank" >Log*} where the third argument being a 1 specifies that Apply replaces the heads of its argument only at the first level in the list, which is what we want, and is equivalent to the above example.
The default Mathematica front end features extensive layout and graphical capabilities, performs prettyprinting and offers a notebook metaphor - user input (both text and Mathematica input) as well as results sent by the kernel (including graphics and sound) are placed in a hierarchy of cells (as is the case for Maple), which also allows for outlining and sectioning of a document. Starting with version 3.0 of the software, notebooks are represented as expressions that can be manipulated by the kernel.
To allow those without Mathematica licenses to view Mathematica notebooks dedicated reader software was made available. This software, called MathReader can be downloaded free of charge. This does not use a Mathematica kernel, so new results cannot be computed.
All UNIX/Linux versions of Mathematica, include addtionally a command line front-end. An example of this is shown below.
% math Mathematica 5.2 for Sun Solaris (UltraSPARC) Copyright 1988-2005 Wolfram Research, Inc. -- Terminal graphics initialized -- InSolve[x^2 + 2 x - 9 == 0, x
Out*=
Old versions of Mathematica which run on MS-DOS had only a command line front end.
WITM, which is an acronym for Web Interface to Mathematica, is a web browser front end which is compatible with virtually any networked computer which has a web browser. This allows Mathematica to be used on devices like PDA's (e.g. Pocket PC or similar) for which there is no version of Mathematica available. A screenshot of an HP iPAQ PDA accessing a Mathematica kernel is shown.
Several other front ends are also available, e.g., JMath or MASH, but the standard Mathematica front end is the most popular.
Using J/Link, a Java program can ask Mathematica to perform computations; also, a Mathematica program can load any Java class, manipulate Java objects and perform method calls, making it possible, for instance, to build Java graphical user interfaces from Mathematica. Similarly, a .NET software can invoke the kernel to perform calculations and send results back, and Mathematica developers can easily have access to .NET's functionality.
On Sloane's Online Encyclopedia of Integer Sequences, Mathematica and Maple are the two most often used CASs for which commands are provided with which to calculate the sequences; both of them have their own database fields on the OEIS.
Many of the Wolfram Reseach forums, as well as the comp.soft-sys.math.mathematica newsgroup are all moderated, which some argue slows down the speed at which assistance can be obtained from the community. Moreover, even mentioning the name of another computer algebra system is prohibited, a policy some find draconian.
Mathematica is a proprietary system, and Wolfram Research charges a relatively high price for the software.
Array programming languages | Computer algebra systems | Domain-specific programming languages | Formula manipulation languages | Functional languages | IRIX software | Numerical programming languages | Term-rewriting programming languages | Java platform
Mathematica | Mathematica | متمتیکا | Mathematica | Mathematica | Mathematica | Mathematica | Mathematica | Mathematica | Mathematica | Mathematica | Mathematica | Mathematica | Mathematica
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Mathematica".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world