Machinedesign 2912 Lt Math 0

Attack of the math software clones

Nov. 17, 2011
There are a number of surprisingly powerful free alternatives to widely used mathematical and simulation packages

Authored by:
Leland Teschler
[email protected]
Key points:
• It is relatively easy to find math packages devised for college coursework and research that can be repurposed to do meaningful tasks in engineering.
• Some kinds of academic software is flexible enough to handle engineering simulations.

When math professors get frustrated, the result can sometimes be mathematical-analysis software that is free for the asking. Picture this: The instructor of a calculus or higher-level math class realizes that students would benefit greatly from access to mathematical-analysis software. But commercial packages are too expensive for every student to have a copy. So the professor sets out to create a math package to be used as free course material. The resulting software becomes open source, and the rest is history.

The above scenario has played out several times over the past few years. Free math packages that include Octave, Sage, and Ptolemy II, as well as several others, began as classroom aids, then were expanded either by their original authors and collaborators or by independent contributors who took advantage of the open-source nature of these packages.

The point of these packages is to mimic the environment of commercial packages, often the Matlab package from MathWorks, Natick, Mass. For example, consider GNU Octave, a high-level language for numerical computations now used by thousands of people worldwide. Entering data in a command line lets the user solve linear and nonlinear problems numerically, using a language that is mostly compatible with Matlab. It can solve common numerical linear-algebra problems, find the roots of nonlinear equations, integrate ordinary functions, manipulate polynomials, and integrate ordinary differential and differential-algebraic equations.

Octave was written by Dr. John W. Eaton and originally conceived around 1988 as companion software for an undergraduate-level textbook on chemical reactor design. Octave authors say they originally set out to create specialized tools for solving chemical-reactor design problems but eventually realized that approach was limited and opted to create something more flexible.

Over the years, other packages have been developed that augment Octave’s capabilities. For example, one called pMatlab enables parallel programming by providing distributed arrays and functions.

Another package that began life in academia is called Sage. It is built out of nearly 100 open-source packages and can be used for basic algebra, calculus, elementary to very-advanced number theory, cryptography, numerical computation, commutative algebra, group theory, combinatorics, graph theory, exact linear algebra, and more. The user interface is a notebook in a Web browser or a command line. Using the notebook, Sage connects to a Sage server on the network. Inside the Sage notebook users can create embedded graphics, mathematical expressions, add and delete input, and share work across the network.

Sage was originally the vision of Dr. William A. Stein, now a mathematics professor at the University of Washington. Over 200 people have contributed to its creation. It contains over 90 open-source packages that have been smoothly tied together and which can be accessed through a single user interface. The program is also somewhat different from Octave in that it provides capabilities of programs like Matlab but doesn’t attempt to run their code. You need a special translation program to do that. Originally created in 2005, Sage is written in open-source languages called Python, PARI, and GAP.

Another math program with academic roots is Maxima. It is a descendant of Macsyma, a well-known computer algebra system developed in the late 1960s at the Massachusetts Institute of Technology. It was maintained by University of Texas math professor William Schelter who, in 1998, released the source code under the GNU General Public License. Schelter passed away in 2001, and since then a group of users and developers continues to work on the program.

Maxima manipulates symbolic and numerical expressions, including differentiation, integration, Taylor Series, Laplace transforms, ordinary differential equations, systems of linear equations, polynomials, sets, lists, vectors, matrices, and tensors. It also yields high precision numeric results by using exact fractions, arbitrary precision integers, and variable-precision floating-point numbers. Maxima can plot functions and data in two and three dimensions.

Another package with academic roots is called R. Basically a statistics package, R was initially written by Ross Ihaka and Robert Gentleman at the University of Auckland in New Zealand. Since 1997, a large group of individuals has contributed to R.

R handles such statistical tasks as linear and generalized linear modeling, nonlinear regression modeling, time-series analysis, classical parametric and nonparametric tests, clustering, and smoothing. There is also a large set of functions which provides a graphical environment for creating various kinds of data presentations. Additional modules are available for a variety of specific purposes.
R consists of a language plus a run-time environment with graphics, a debugger, access to certain system functions, and the ability to run programs stored in script files. The core of R is an interpreted computer language which allows branching and looping. It is possible to interface R to procedures written in the C, C++, or Fortran languages for efficiency.

The birth of a numerical computation program called Scilab differs from that of Octave and Sage in that it came out of a 1980s effort at a French research institute. The free version was developed in the 1990s by researchers at the French National Institute for Research in Computer Science and Control. A consortium was eventually created to support the package, which since 2008 has been distributed under an open-source license.

Scilab includes hundreds of mathematical functions as well as a high-level language that helps construct advanced data structures, and 2D and 3D graphical functions. Users can also use the package to solve problems in statistics, control-system design and analysis, signal processing, and optimization. There are about 1,700 mathematical functions useful for linear algebra, solving sparse matrices and systems of differential equations, polynomials and rational functions, and so forth.

Another academic project at the University of California, Berkeley resulted in a program called Ptolemy II. The program is more of a simulation engine than a mathematical package. It can model systems as state machines and show how they behave with different inputs. For example, it might model a simple thermostat as a heating and cooling state with temperature as an input. The program would plot outputs, a heating or cooling rate in this example, as results. But Ptolemy II is capable of handling systems that are much more complicated than a simple thermostat. More-sophisticated tasks for which it has been used include applications involving blended continuous and discrete dynamics, models of time, and models of computation for orchestrating real-time tasks across a network.

A second free package with simulation in mind is FlowDesigner. It is an open-source data-flow-oriented development environment rather than a simulation package. In that regard, it can be viewed as a sophisticated spreadsheet that uses building blocks rather than cells. It can be used to build complex applications by combining small, reusable building blocks. Its developers say that in some ways, it is similar to both Simulink and LabView, but is hardly a clone of either. Its developers also say FlowDesigner can be used both as a rapid-prototyping tool for building end-application controls, or to help build real-time applications such as audio-effects processing.

FlowDesigner is not really an interpreted language, which makes it fast. It is written in C++ and features a plug-in mechanism that allows plug-ins/toolboxes to be easily added. Currently there are toolboxes available in signal processing, audio processing, vector quantization, neural networks, fuzzy logic, robotics, linear algebra, and an interface to let the program work in conjunction with the Octave mathematics program mentioned earlier.

Then there is Freemat, whose author calls it an environment for rapid engineering and scientific processing. Freemat author Samit Basu says he developed the program over a period of four years with help from a number of contributors. The program is said to be similar to commercial systems such as Matlab and IDL from Research Systems, Australia, but is open source. FreeMat is intended to go beyond Matlab to include features such as a codeless interface to external C/C++/Fortran code, parallel/distributed algorithm development (via MPI), and advanced volume and 3D visualization capabilities.

Basu says FreeMat supports roughly 95% of the features in Matlab, including N-dimensional array manipulation, support for solving linear systems of equations, arbitrary size FFT support, sparse matrix support, and numerous others. Right now, FreeMat doesn’t support Matlab GUI/widgets building, though Basu says that feature is in development.

SciPy is another open-source software package for mathematics, science, and engineering. The SciPy library depends on NumPy, a program for N-dimensional array manipulation built using a programming language called Python. The SciPy library is built to work with NumPy arrays, and provides many user-friendly numerical routines such as those for numerical integration and optimization. Because it is based on the widely used Python language, scientific applications written in SciPy benefit from the development of additional modules in numerous niches of the software landscape. Everything from parallel programming to Web and data-base subroutines and classes are available in addition to the mathematical libraries in SciPy.

It is also possible to find free versions of commercial packages. The free versions typically target students and educators and come with slightly diminished capabilities. That is the case with a commercial package called SysQuake and a free version called SysQuake LE. Created by Calerga in Switzerland, SysQuake’s claim to fame is its interactive graphics, which help in understanding and solving complicated problems in mathematics, physics, and engineering. The free version excludes an integrated development environment, programming functions to read and write files, extension plug-ins (such as serial I/O, image files, and long integers), and a way to add extensions written in C or other languages.

Recast commercial software
In at least one case, a failed commercial program wound up as an open-source free program. That is the case with Axiom, a general-purpose computer-algebra system. It targets users engaged in research and development of mathematical algorithms. It defines a strongly typed, mathematically correct type hierarchy and has a programming language and a built-in compiler.

Axiom has been in development since 1971, at which time it was called Scratchpad. Scratchpad was originally developed by IBM, Armonk, N. Y., and was basically considered as a research platform for developing new ideas in computational mathematics. In the 1990s, the program was renamed Axiom, was sold to another company, but never became commercially successful. It was eventually released as a free program.

Axiom has both an interactive language for user interactions and a programming language for building library modules. Users can build polynomials of matrices, matrices of polynomials of power series, hash tables with symbolic keys and rational function entries, and so on with the programming language. The Axiom interactive language is oriented towards ease of use. The Axiom interpreter uses type inferencing to deduce the type of an object from user input, so users need not specifically declare the type of variables they are using. Type declarations can generally be omitted for common types in the interactive language.

A program called CompPad has roots in an old commercial package as well. CompPad is part of the Open Office suite of open-source programs which mimic some of the capabilities of the Microsoft Office suite. The original package was a commercial product called StarOffice suite, which Sun Microsystems, Santa Clara, Calif. (now Oracle), acquired and eventually released as Open Office software. The software firm Oracle is now the principal contributor of code to Open Office, which has an estimated user base exceeding 100 million people.

CompPad is an extension that provides live mathematical and engineering calculations within an Open Office word processing document. It is intended to provide a free/open-source alternative to Mathcad. CompPad creates technical calculations in the form of conventional-looking mathematical expressions using the equation editor. With the click of a toolbar icon, CompPad will evaluate expressions and display the results, embedded in a word-processing document.

CompPad is currently in alpha release. Developers say it is quite usable and reportedly has evaluated documents with hundreds of formulas. Among the features supported in the most-recent version are support for real and complex numbers, Booleans, vectors and matrices; handling of measurement units in all quantities and calculations; use of basic operators, including arithmetical, exponential, comparison, rounding, trigonometric, logarithmic, exponential; and support for vector/matrix operators, including transpose, multiply, min, max, sum, and product.

SysQuake targets automatic control problems that involve feedback. Its claim to fame is the ability to display plots of system performance interactively so that the user can, for example, move poles around in the S plane and see what happens to system performance. It graphs performance curves simultaneously in the frequency, time, and complex plane domain.

Smath is a mathematical program with a “paperlike” interface and numerous computing features. Basically, the screen looks like a ruled sheet of paper. It has been integrated with a mathematical reference book that provides a level of tutorial help. It was developed by Andrey Ivashov for Windows, Linux and Windows Mobile — it works on smart phones.

Finally, there is Jasymca, an interactive system for solving math problems. As with many math programs, it was devised with teaching in mind. It supports arbitrary precision numbers and symbolic variables. Users can build scalars, vectors, and matrices and perform such operations as computing the pseudoinverse of symbolic matrices over trigonometric simplifications to symbolic solutions of integrals and systems of equations. The user interface can be selected from either an Octave/Matlab/SciLab-like language, or a GNU-Maxima style. There are three versions of Jasymca: A Midlet version for portable devices like cell phones or PDAs; a java application for desktop PCs, laptops, and workstations; and an applet which can be integrated in Web pages.

Free alternatives
Sage 4.1 – Open source math software for studying number theory, algebra, group theory and more. It includes interfaces to Matlab and to other free math programs.
Octave 3.3 – Uses a language compatible with Matlab. It is customizable with user-defined functions written in Octave’s language or C++, C, Fortran or others.
Scilab 4.1.2 – Handles linear algebra, matrices, polynomials, simulation based on solving differential equations.
Maxima – Manipulates symbolic and numerical expressions, including differentiation, integration, Taylor Series, Laplace transforms, ordinary differential equations, systems of linear equations, polynomials, and sets, lists, vectors, matrices, and tensors.
Smath – Math program with “paperlike” interface and numerous computing features, with integrated mathematical reference book.
CompPad – extension that provides live mathematical and engineering calculations within a document. Intended as a free/open-source alternative to Mathcad.
Axiom – General-purpose computer algebra system useful for research and development of mathematical algorithms. Has a programming language and a built-in compiler.
Ptolemy II – Open-source software framework supporting simulation.
Sysquake 4 LE – Programming language designed with functions that accept arrays as well as scalar arguments.
Freemat – Free environment for rapid engineering and scientific prototyping and data processing. It is similar to commercial systems such as Matlab and IDL but is open source.
R – Free software environment for statistical computing and graphics.
Flow Designer – Free data flow-oriented development environment. Can be used to build complex applications by combining small, reusable building blocks. In some ways, it is similar to both Simulink and LabView.
SciPy – Open-source software for mathematics, science, engineering, and scientific computing.
Jasymca – Java Symbolic Calculator, also available for cell phones or PDAs, as a java application for desktop PCs, laptops and workstation, and an applet which can be integrated in Web pages.

© 2011 Penton Media, Inc.

Sponsored Recommendations

MOVI-C Unleashed: Your One-Stop Shop for Automation Tasks

April 17, 2024
Discover the versatility of SEW-EURODRIVE's MOVI-C modular automation system, designed to streamline motion control challenges across diverse applications.

The Power of Automation Made Easy

April 17, 2024
Automation Made Easy is more than a slogan; it signifies a shift towards smarter, more efficient operations where technology takes on the heavy lifting.

Lubricants: Unlocking Peak Performance in your Gearmotor

April 17, 2024
Understanding the role of lubricants, how to select them, and the importance of maintenance can significantly impact your gearmotor's performance and lifespan.

From concept to consumption: Optimizing success in food and beverage

April 9, 2024
Identifying opportunities and solutions for plant floor optimization has never been easier. Download our visual guide to quickly and efficiently pinpoint areas for operational...

Voice your opinion!

To join the conversation, and become an exclusive member of Machine Design, create an account today!