Go to Home Page
You are here
Go to Reference Section
Go to Directories Section
Go to Community Section
Go to Fun Section
Go to Science Store
Go to About PhysLink.com
Top Destinations Menu
 Ask the ExpertsAsk the
Experts

 Physics Job BoardPhysics
Job Board

 Physics and Astronomy Departments DirectoryUniversity
Departments

 FREE Einstein eCardsEinstein
eGreetings

 PhysLink.com Science eStoreScience
eStore


Local in California?
Visit one of our retail stores.
XUMP - Science Toys





  
  Mathematica 4.0 Software Review

Title: Mathematica 4
Made by: Wolfram Research, Inc.
Platform: Windows 95/98/NT, MacOS, Unix, Linux
Category: Tools: Math Engine
Price: $139.95 student version, $1,495 professional
Screen Shots Mathematica 4 Screen Examples
Ordering Info: Click here to order

Description:

Mathematica is a powerful program for doing mathematics. You can use it simply as a calculator :

[Graphics:Images/final_gr_1.gif]
[Graphics:Images/final_gr_2.gif]

or to execute course level calculations :

[Graphics:Images/final_gr_3.gif]
[Graphics:Images/final_gr_4.gif]
[Graphics:Images/final_gr_5.gif]
[Graphics:Images/final_gr_6.gif]
[Graphics:Images/final_gr_7.gif]
[Graphics:Images/final_gr_8.gif]

all the way to complex evaluations like solving differential equations :

[Graphics:Images/final_gr_9.gif]
[Graphics:Images/final_gr_10.gif]

As evident from the few examples above, Mathematica has a syntax to be learned : commands and built-in functions start with a capitalized letter, the arguments of functions are enclosed in square brackets, there is a special use of braces etc. This is unavoidable for a program of such a completeness; nonetheless users come to appreciate its consistency. What we mean is that once you learn that the command to plot sin(x) in the range [-pi;,pi;] in a frame is

[Graphics:Images/final_gr_11.gif]

[Graphics:Images/final_gr_12.gif]

[Graphics:Images/final_gr_13.gif]

you can then successfully guess that the command to plot [Graphics:Images/final_gr_14.gif] in the range [-5,5]x[-7,7] with no box enclosing the figure is

[Graphics:Images/final_gr_15.gif]

[Graphics:Images/final_gr_16.gif]

[Graphics:Images/final_gr_17.gif]

that the command to make a parametric plot of (x=sin(theta;) cos(phi;),sin(theta;) sin(phi;),cos(theta;)) in the range theta;isin;[0,pi;], phi;isin;[0,2 pi;] is

[Graphics:Images/final_gr_18.gif]

[Graphics:Images/final_gr_19.gif]

[Graphics:Images/final_gr_20.gif]

and so on. Note that you can use Greek characters, that a blank between two expressions means multiplication i.e. you enter expressions in Mathematica exactly the same way you would write them down on a sheet of paper.
Mathematica has built-in all the standard and special math functions : trigonometric, logarithm, hyperbolic, elliptic, Bessel, Legendre, Hermite, Spherical Harmonics, dilogarithmic, hypergeometric and many many more. In addition to that, and this is one of the most powerful capabilities of Mathematica, you can define your own functions and perform on them any operation you need. Here are few examples :

(This defines the function: f(x) = x3+ 2x + 3)

[Graphics:Images/final_gr_21.gif]
[Graphics:Images/final_gr_22.gif]

(This expands the polynomial to the fourth power)

[Graphics:Images/final_gr_23.gif]
[Graphics:Images/final_gr_24.gif]

(The % symbol stands for the previous output)

[Graphics:Images/final_gr_25.gif]
[Graphics:Images/final_gr_26.gif]

(This gives the indefinite intergral of the function)

[Graphics:Images/final_gr_27.gif]
[Graphics:Images/final_gr_28.gif]

(This function plots the above polynomial)

[Graphics:Images/final_gr_29.gif]
[Graphics:Images/final_gr_30.gif]

[Graphics:Images/final_gr_31.gif]

[Graphics:Images/final_gr_32.gif]

Built-in in Mathematica are also constructs common to programming languages such has C or Fortran :

(DO loop)

[Graphics:Images/final_gr_33.gif]
[Graphics:Images/final_gr_34.gif]
[Graphics:Images/final_gr_35.gif]
[Graphics:Images/final_gr_36.gif]
[Graphics:Images/final_gr_37.gif]
[Graphics:Images/final_gr_38.gif]

(IF condition: If[condition, then, else])

[Graphics:Images/final_gr_39.gif]
[Graphics:Images/final_gr_40.gif]

If a complex numerical calculation is being performed, Mathematica gives you the possibility to compile your code, so that it will evaluate much quicker. Here is a simple example :

(This creates a list of 100,000 random numbers in range [1, 1000], computes the sum of the squares of random numbers and defines the compiled version of the same function)

[Graphics:Images/final_gr_41.gif]
[Graphics:Images/final_gr_42.gif]
[Graphics:Images/final_gr_43.gif]
[Graphics:Images/final_gr_44.gif]
[Graphics:Images/final_gr_45.gif]

In this particular example the compiled version of the function is 10 times faster than the uncompiled one.

The last thing we would like to mention in this review is that Mathematica is capable to link to external programs. This is done via MathLink , a package included in the standard distribution of Mathematica . It allows you to use compiled subroutines (from C or Fortran source codes for instance) in a Mathematica calculation, or to invoke Mathematica from within external programs such as a C or Fortran source files. This expands considerably the utility of Mathematica, especially when heavy numerical computations need to be performed.

To say a few words about version 4 in particular, the most useful additions in our opinion are the possibility to save a whole notebook with formulae, graphics and text in LaTeX and the inclusion of a spellcheck; that makes it very easy to go from a working document to a publication-ready draft. Moreover, it is now possible to save a whole notebook in the HTML format as well, to import and export pictures in almost any format and to export formatted set of data in a simple multicolumn ASCII file among other things. Version 4 is considerably faster than the previous release (Mathematica 3.0), especially in numerical applications and in graphics rendering. For example, the above noted calculation for the non-compiled sum of the squares of 100,000 random numbers was approximately 5 times faster on version 4.0 than on version 3.0.

Finally, we would like to recommend this program to all science-oriented students and professionals; with a little effort one can get much help out of it. Investing few additional hours learning advanced techniques of programming in Mathematica does pay off.

A source of interesting and useful Mathematica related material is the Web site http://www.mathsource.com. Also worth mentioning is the Mathematica newsgroup comp.soft-sys.math.mathematica. Anyone can post a message asking for help at any level of difficulty and get hints and solutions from expert users and from people at Wolfram Research.

Click here to download this review/example in a mathematica notebook format


ORDERING INFO

Reviewer: Francesco Siano.



go to the top  
All rights reserved. © Copyright '1995-'2008 PhysLink.com