EE 382C Embedded Software Systems

Prof. Brian L. Evans, Spring 2004, Unique #14955

Computer assignments will be mixed in with the homework assignments. You can use the software of your choice. To work problems that require algebra calculations, Mathematica is often a good choice. There are versions of Mathematica for public use available at the Learning Resource Center in ENS 507 (on and the Computation Center facilities (which includes UNIX systems). The following Mathematica packages are available with every version of Mathematica:

Algebra Graphics ProgrammingExamples
Calculus LinearAlgebra Statistics
DiscreteMath Miscellaneous Utilities
Examples NumberTheory  
Geometry NumericalMath  

For example, if you wanted to do symbolic summations, you can load the Algebra extensions in Mathematica:

Needs[ "Algebra`Master`" ]

Be sure that the single quote is a backquote (`) here and not an apostrophe ('). Once loaded, a package does not have to be reloaded. To sum $a^n$ for $n = 0, 1, \ldots \infty$, use

Sum[ a^i, {i, 0, Infinity} ]

which returns $1 / (1 - a)$.

Support: 475-9400
Examples: /usr/local/packages/mathematica/FrontEnd/SampleNotebooks/*.ma
Newsgroup: comp.soft-sys.math.mathematica
Web page:
Unix help: man mathematica

It is strongly suggested that you take the short courses that the UT Computation Center will be offering.

If you use Mathematica at the Computer Center, then be sure to read the usage note, ``Mathematical Software on Computation Center Systems,'' which is at:

Please note that the latter document contains one serious typo, which Documentation has not yet been able to find time to correct. This typo occurs in the discussion of the ``appuser'' script. To run the ``appuser'' script, type the following command at the UNIX shell prompt:

eval `/usr/local/etc/appuser`

where the delimiter is a back quote (`), not an apostrophe (') or quotation marks (").

Mathematica on Unix

Mathematica manipulates algebraic expressions. It also crunches numbers, performs arbitrary-precision calculations, and supports sound, 2-D/3-D graphics, and animation. Its programming language is similar to Lisp but has many C constructs. It comes with its own word processing notebook interface. Its syntax is a bit unusual in that Mathematica uses square brackets to denote function calls, e.g.

which returns 1. Mathematica has many commands and operators that are similar to C such as ++, -, +=, -=, and ==, e.g.
thesum = 0;
For[ i = 0, i < 100, i++, thesum += i ];
which sets thesum to the integer 4950. Lists, vectors, and sets are represented as
vec = {0, 1, 2, 3};
Matrices are simply lists of lists:
mat = {{0, 1}, {2, 3}};
defines the matrix $\left[ \matrix{0 & 1 \cr 2 & 3} \right]$. The following line would find the matrix C that is the inverse of the transpose of the product of the two matrices A and B:
C = Inverse[Transpose[A . B]]

Running Mathematica

On the Unix machines in the Learning Resource Center, Mathematica is installed in the directory /usr/local/packages/mathematica on brando. The Mathematica executable programs are installed in the /usr/local/bin directory, which should already be on your path. The X windows version of the notebook interface can be run by typing


To evaluate expressions, hit SHIFT-RETURN. If you are not running X windows, then you should run the terminal (tty) interface by typing math. There is an Emacs interface accessible by typing ESC-x load-library math.el in Emacs. Use ESC-x math to start the Mathematica kernel. Use ESC-RETURN to evaluate commands.

Mathematica Documentation

The best on-line documentation about Mathematica is available from the function browser in the X windows notebook interface. The Unix manual pages, accessed by typing man math and man mathematica, only provide help about the different ways to start Mathematica. The Computation Center has Mathematica manuals available for study or checkout in the Reference Room, WCH 9.

Technical Support

Support is provided by Mathematical Services,, 471-3359.

Brian L. Evans