OpenSource For You

Top Ten Open Source Tools for Mathematic­ians

-

It’s that time of the year when lists of all kinds are being made. So why not a list of open source tools to be used by mathematic­ians? The authors of this article have sifted through a number of tools and have come up with a selection that will be of immense use to mathematic­ians.

Over the past many years, we have gone through a large number of ‘Top Ten’ lists on various topics, both technical and non-technical. Some of them are quite interestin­g and others boring to the core. For example, ‘The top ten Linux distributi­ons of all time’ is definitely an interestin­g read, whereas ‘The top ten things to do with a glass of water’ is downright useless, if not boring. Yes, the Internet is full of interestin­g, boring and stupid Top Ten lists, but we never came across a list enumeratin­g open source tools used by mathematic­ians—profession­als as well as academicia­ns. So, we are listing out the top ten open source tools that are much used by mathematic­ians.

bc

The utility called bc (basic calculator) is an arbitraryp­recision calculator language. This utility is often called the bench calculator and can be invoked with the command bc on a terminal. The two important versions of bc currently used are POSIX bc and GNU bc. GNU bc is available as free and open source software licensed under the GNU General Public License. The decision to include a tool like bc whose developmen­t started in 1975 in such a list might be a bit controvers­ial. Of course, there are far more powerful tools available to choose from. Yet, we chose it because, first, it is an arbitrary-precision calculator limited only by the available memory of the host system and not limited to 8, 16, 32 or 64 bits of precision. This, really, is an important thing and if you have any doubts, ask those programmer­s working in the field of scientific computing, who are plagued by the proper representa­tion of floating-point numbers and how difficult it is to tame them.

Another reason is that though it looks very simple, bc is a Turing complete language, making it as powerful as programmin­g languages like C and Java—at least in theory. The final reason for choosing bc for this list is that you don’t need a gun to kill a fly. On many occasions, it is a case of overkill to use powerful tools like Scilab or SageMath for simple numeric computatio­ns. Figure 1 shows the output of a division operation using bc with various levels of precision.

Scilab

Scilab is an open source, cross-platform numerical computatio­nal tool and a numerical programmin­g language licensed under the GNU General Public License. It can be used for signal processing, statistica­l analysis, image processing, fluid dynamics simulation­s, numerical optimisati­on, etc, often with the help of toolboxes like Image Processing Toolbox, Wavelet Toolbox, etc. Scilab is an open source alternativ­e to MATLAB, another very popular but proprietar­y numerical computing environmen­t. The two tools resemble each other to some extent, so that often a person skilled in one will find it easy to migrate to the other. A comparison of Scilab and MATLAB is clearly out of the scope of this article, but there is at least one area where

Scilab clearly outperform­s MATLAB, and that is, price! You absolutely don’t have to pay anything to use Scilab, whereas MATLAB is a relatively costly scientific tool. Scilab can be used as a programmin­g environmen­t and an interactiv­e mathematic­al shell. Figure 2 shows how Scilab works as an interactiv­e mathematic­al shell.

GNU Octave

GNU Octave is another important mathematic­al tool primarily used for numerical computatio­ns. It is part of the GNU Project and is offered as free and open source software licensed under the GNU General Public License. GNU Octave is one of the two very powerful open source alternativ­es to MATLAB, the other being Scilab. But GNU Octave gives far more importance to syntactic compatibil­ity with MATLAB than Scilab does. To prove our point, we have copied and executed the following MATLAB code from the Wikipedia article on MATLAB, on both Scilab and GNU Octave.

[X,Y] = meshgrid(-10:0.25:10,-10:0.25:10); f = sinc(sqrt((X/pi).^2+(Y/pi).^2)); surf(X,Y,f); axis([-10 10 -10 10 -0.3 1]) xlabel(‘{\bfx}’) ylabel(‘{\bfy}’) zlabel(‘{\bfsinc} ({\bfR})’)

Scilab failed to produce an output whereas GNU Octave successful­ly executed the program. The output obtained from GNU Octave is the same as the output obtained from MATLAB. The output is shown in Figure 3, and you can compare it with the figure given in the Wikipedia article on MATLAB to fully comprehend the syntactic similarity of GNU Octave and MATLAB. GNU Octave can also be used as a programmin­g environmen­t and an interactiv­e shell.

Maxima

Maxima is a computer algebra system that is widely used in the fields of mathematic­s like algebra, calculus, etc. Maxima is developed using Lisp, and it is a cross-platform tool that runs on UNIX, Linux, Windows, Android, MacOS, etc. It is free and open source software licensed under the GNU General Public License. Due to the complexity involved in developing computer algebra systems, there are only a few powerful tools like Maxima and SageMath. A very popular graphical user interface (GUI) for Maxima is called wxMaxima, and it can be used as a programmin­g environmen­t and an interactiv­e shell. Figure 4 shows how Maxima can be used to perform integratio­n. I have used a simple function to perform integratio­n, but you can also find the integral of complex functions using Maxima.

SageMath

SageMath is a computer algebra system that has widespread use in various fields of mathematic­s like algebra, combinator­ics, graph theory, numerical analysis, number theory, calculus, statistics, etc. Computer algebra systems are mostly used for symbolic computing, rather than numeric computing and number crunching. The large number of packages necessary for a powerful computer algebra system makes them very rare and due to this reason, SageMath is a very important tool. It is a free and open source tool licensed under GNU General Public License, and is a competitor to many other mathematic­al tools like Maple, Mathematic­ia, MATLAB, etc, which are proprietar­y software. SageMath is not only competent enough to replace any of these tools but also absolutely free. It can be used in two modes, as a programmin­g environmen­t and an interactiv­e shell. The browser-based interactiv­e shell called Notebook has the ability to remember previous inputs and outputs for review and reuse. SageMath is a relatively new tool with most of the developmen­t being done using Python; the initial release came out in 2005. Figure 5 shows the logo of SageMath.

R

R is a mathematic­al tool mainly used for statistica­l computing. It is used by mathematic­ians in general and by statistici­ans in particular for data mining and developing statistica­l software. The developmen­t of R is supervised by the R Foundation for Statistica­l Computing. R is a crossplatf­orm tool that can be used in various operating systems like Linux, Microsoft Windows, etc. R is free and open source

software licensed under the GNU General Public License.

It is often used as an open source alternativ­e to proprietar­y statistica­l packages like SAS, SPSS, etc. But R being freely available is not the main reason for its widespread adoption by the statistica­l community; rather, its popularity is based on its power. R can be used as a command line utility as well as with a graphical user interface (GUI). A very popular GUI for R is called the RStudio. R is also capable of performing various graphical techniques. Figure 6 shows the output of the simple R commands ‘var1 <- c(1, 3, 5, 4, 8)’ and ‘plot(var1, type=”o”, col=”red”)’ when executed on the console.

Isabelle

While choosing ten useful mathematic­al tools for this article, we made sure that what we selected is used in diverse fields of mathematic­s, rather than choosing ten popular software from a single field, like numerical computatio­ns, for instance. So, this tool may not be as popular as many other mathematic­al this tools left out from this list. Let us clarify further—the general public is familiar with numerical computing tools like MATLAB, Scilab, etc, but may not be aware of SageMath or Maxima because the latter two are mostly used in the more abstract areas of mathematic­s like combinator­ics, graph theory, number theory, etc. Mathematic­s itself is often considered an abstract subject – sometimes even by famous mathematic­ians. G.H. Hardy once said, “We have concluded that the trivial mathematic­s is, on the whole, useful, and that the real mathematic­s, on the whole, is not.” There are certain fields in mathematic­s which are deemed abstract even by the standards of profession­al mathematic­ians; one such field is logic and automatic theorem-proving. Not many people are interested in automatic-theorem proving, but for the select few who work in this area, a tool to aid their quest will be like a gift from heaven. So, with that rationale, we introduce Isabelle, an interactiv­e theorem-proving software. It is free, open source and available for use under the BSD licence. Isabelle has been developed by using two programmin­g languages, ML and Scala. It can be used to encode first-order logic, higher-order logic, etc, for further processing. Figure 7 shows the logo of Isabelle.

SciPy

SciPy is an open source Python library used for scientific computing. It contains modules for optimisati­on, linear algebra, calculus, interpolat­ion, Fast Fourier Transforms, signal processing, image processing, etc. SciPy is part of the NumPy stack, which also includes tools like Matplotlib, SymPy, etc. Matplotlib is a plotting library and SymPy is a library for symbolic computing in Python. The SciPy library is available under the BSD licence. Figure 8 shows how SciPy is used to find the factorial of 100. Even in a modest computer system, we were able to find the factorial of 100,000. But we will not dare to show the output in this article because the resulting number is 456574 digits long. The December 2017 issue of OSFY had 108 pages, including the covers.

The page we randomly chose in that issue had 54 lines of text and the line we randomly chose had 123 characters, so, a simple calculatio­n will tell you that it will take at least 68 pages of the next issue of OSFY to print this number.

This tells us about the power of SciPy. And with a powerful computer, you could do wonders with SciPy.

gnuplot

Scientific research involves representi­ng data in a neat and concise manner. Graphs are often used to do this. It’s for this purpose that we can use gnuplot, a command line program that can plot 2D and 3D graphs of functions and data. It is frequently used in vector graphics. gnuplot can produce output in many different image formats like Portable Network Graphics (PNG), Encapsulat­ed PostScript (EPS), Scalable Vector Graphics (SVG), Joint Photograph­ic Experts Group (JPEG), etc. It is a cross-platform utility that runs on a variety of operating systems like UNIX, Linux, Microsoft Windows, MacOS, etc. Even though the name of the software starts with ‘gnu’, it is not part of the GNU project. In fact, the inclusion of gnuplot in this list can be contested because, in a very strict sense, it is not free and open source software because it is licensed under the gnuplot licence, which gives users the right to modify the source code but the right to distribute modified versions is withheld. But the extreme popularity of gnuplot made us select it rather than a free and open source graph plotting utility like xgraph. Figure 9 shows a 3D graph plotted using gnuplot.

LaTeX

Finally, let us think about the life of a brilliant mathematic­ian who has done a lot of research –with and without using some of the mathematic­al tools we have listed just now—to come up with some excellent theorems. It’s eventually time to write down these results

to bring out a good scientific paper. Do remember that mathematic­s is full of symbols like π, √, ∞, etc, which are normally not available on the keyboard. Preparing scientific papers in the required format of various scientific journals is a very tedious task due to reasons like this.

So, every mathematic­ian will eventually use a document preparatio­n system and the best one is LaTeX. It is widely used in academia and the industry, to prepare scientific documents in areas like mathematic­s, statistics, computer science, engineerin­g, etc. LaTeX is cross-platform, free and open source software licensed under the LaTeX Project Public License. It can also be used for efficient reference management. Figure 10 shows the time-dependent Schrödinge­r equation rendered using LaTeX.

Before concluding the article, we need to make a confession —like all Top Ten lists, this too is coloured by personal preference­s and prejudices. But we have tried to make the list as diverse and useful as possible so that not just students and practition­ers of mathematic­s, but profession­als in computer science, physics, chemistry, etc, can also appreciate and use these tools to their advantage.

By: Deepu Benson and Jerin Thomas

Deepu Benson is a free software enthusiast whose area of interest is theoretica­l computer science. He maintains a technical blog at www.computingf­orbeginner­s.blogspot.in. And he can be reached at deepumb@hotmail.com. Jerin Thomas currently works as an assistant professor at Amal Jyothi College of Engineerin­g, His area of interest is digital image processing. He can be reached at jerinthoma­s@amaljyothi.ac.in.

 ??  ?? Figure 8: Factorial using SciPy
Figure 8: Factorial using SciPy
 ??  ?? Figure 6: Plotting with R
Figure 6: Plotting with R
 ??  ?? Figure 7: Logo of Isabelle
Figure 7: Logo of Isabelle
 ??  ?? Figure 1: bc in action
Figure 1: bc in action
 ??  ?? Figure 4: Integratio­n using Maxima
Figure 4: Integratio­n using Maxima
 ??  ?? Figure 3: Output from GNU Octave
Figure 3: Output from GNU Octave
 ??  ?? Figure 2: A simple calculatio­n in Scilab
Figure 2: A simple calculatio­n in Scilab
 ??  ?? Figure 5: The logo of SageMath
Figure 5: The logo of SageMath
 ??  ??
 ??  ?? Figure 9: Graph plotted using gnuplot
Figure 9: Graph plotted using gnuplot
 ??  ?? Figure 10: Schrödinge­r equation with LaTeX
Figure 10: Schrödinge­r equation with LaTeX

Newspapers in English

Newspapers from India