Volume 9, Issue 1

In and Out
Trott's Corner
New Products
New Publications
Calendar
News Bulletins
New Resources
Classifieds

Editorial Policy
Staff
Submissions
Subscriptions
Back Issues
Contact Information

Mathematica 4.2: A Technical Review

Kernel Enhancements

LinearProgramming

Mathematica 4.2 provides a completely new implementation of the LinearProgramming solver, bringing significant enhancements and increased performance. LinearProgramming also provides new functionality. Users can now directly specify equality constraints and bound constraints making typical problems easier to specify (e.g., as one equality instead of two inequalities).

Robustness

In Mathematica 4.2, a scaling technique is introduced so that LinearProgramming is able to solve very badly scaled problems. For example, consider the following Klee–Minty problem of dimension 5.

In general, the Klee–Minty problem of dimension , expressed in the LinearProgramming syntax, is:

It is known that the use of the simplex algorithm with a naive pivot rule on this example would make the number of iterations increase exponentially with the dimension of the problem. However, due to the scaling technique introduced, this can be solved quite fast. For example, in Mathematica 4.1:

Mathematica 4.2 applies scaling by default. This means that the simplex algorithm converges very quickly.

Ease of Use

The syntax of LinearProgramming has been extended so that it can handle problems with bound and free variables easily, while at the same time being backward compatible.

For example, consider the following problem with both equality and inequality constraints as well as with bound variables () and a free variable ().

Here is how to solve this problem.

In the above example, the third argument {{10,-1},{11,0},{12,1}} can be explained as follows. For each pair of numbers, the first number represents the value of the right side of the equation, while the second number represents the Boolean test being performed: represents a “less than” relationship; 0 represents an “equal to” relationship; and 1 represents a “greater than” relationship.

NSolve

Improved NSolve Robustness and Speed

Robustness enhancements in NSolve let Mathematica find the correct number of solutions and at a higher precision in many cases. For example, eigenvalue computations are now performed to isolate the individual roots numerically.

The solution accuracy described here is the worst residual error in p. NSolve gives a set of solutions that, when put back into the original equations, should all give zero. SolutionAccuracy checks for the value that is farthest from zero. This results in the number of digits to the right of the decimal point that are zero.

The corresponding list of accuracies in Version 4.1 is .

This is a system of polynomial equations.

All of the above solutions are equal to 0, at least up to the given accuracy, as shown below. The following code generates the residual errors for the previous calculation.

More precisely, this is the accuracy with which the polynomials are satisfied for each solution.

Simplify

New Simplifier: ProductLog

Mathematica 4.2 allows you to simplify the output of the ProductLog function. This capability is useful when solving certain classes of exponential polynomial equations.

Improved Simplifier: Mod

We can now simplify modular expressions, leading also to improvements for functions such as Floor and Ceiling.

Improved Simplifier: Log

FullSimplify now knows when it can use the distribution rule in logarithmic expressions.

Improved Simplifiers: Erf, InverseErf, Erfc, InverseErfc

Mathematica 4.2 also improves the capabilities for simplifying expressions involving the error function and related functions.

Miscellaneous

Continuing the tradition of better performance and functionality with each new version. Mathematica 4.2 featured many other improvements to previously existing technology. The following are some examples of the additional improvements in the kernel.

Improved PackedArray Implementation

Mathematica 4.2 introduces improved packed array implementation over earlier versions. This improvement leads to speedups for functions such as Dot and Transpose. The speedups affect operations such as separating the colors in a two-dimensional image with three color planes.

FactorInteger

The speed of FactorInteger has been improved by a new implementation.

For comparison, Mathematica 4.1 took almost 50 times as long to do the same computation.

The FactorInteger function now implements the quadratic sieve algorithm for large integers. This results in significant speed improvements for certain calculations. For example, the following command factors the 7th Fermat number, a notoriously large calculation that was done for the first time in 1970.

NotElement and InvisibleTimes

For simplicity, Mathematica 4.2 introduced a new Boolean test function that makes it easier to determine if an expression is not a member of a family of expressions or numbers.

InvisibleTimes is also a new operator. The expression below is actually multiplying 2 and 3 together due to the presence of the InvisibleTimes operator between them.

New Cellular Automata Function

Cellular automata are useful computational tools for describing and modeling natural systems. They have wide applications in science, engineering, and computer science. The new CellularAutomaton[rnum,init, t] function generates a list representing the evolution of cellular automaton rule rnum from initial condition init for t steps. This function makes it easy to experiment with cellular automata, such as the ones covered in Stephen Wolfram’s A New Kind of Science. For more information on the book, visit www.wolframscience.com.

This generates the first 100 steps in the evolution of the rule 30 cellular automaton.

This generates a plot of the data so you can visualize the cellular automaton.