Mathematica: A System of Computer Programs

Santanu K. Maiti
DOI: https://doi.org/10.48550/arXiv.cs/0605090
2015-10-28
Abstract:Starting from the basic level of mathematica here we illustrate how to use a mathematica notebook and write a program in the notebook. Next, we investigate elaborately the way of linking of external programs with mathematica, so-called the mathlink operation. Using this technique we can run very tedious jobs quite efficiently, and the operations become extremely fast. Sometimes it is quite desirable to run jobs in background of a computer which can take considerable amount of time to finish, and this allows us to do work on other tasks, while keeping the jobs running. The way of running jobs, written in a mathematica notebook, in background is quite different from the conventional methods i.e., the techniques for the programs written in other languages like C, C++, F77, F90, F95, etc. To illustrate it, in the present article we study how to create a mathematica batch-file from a mathematica notebook and run it in the background. Finally, we explore the most significant issue of this article. Here we describe the basic ideas for parallelizing a mathematica program by sharing its independent parts into all other remote computers available in the network. Doing the parallelization, we can perform large computational operations within a very short period of time, and therefore, the efficiency of the numerical works can be achieved. Parallel computation supports any version of mathematica and it also works significantly well even if different versions of mathematica are installed in different computers. All the operations studied in this article run under any supported operating system like Unix, Windows, Macintosh, etc. For the sake of our illustrations, here we concentrate all the discussions only for the Unix based operating system.
Mathematical Software,Programming Languages
What problem does this paper attempt to address?
The main problem that this paper attempts to solve is to show how to use Mathematica for complex scientific calculations and introduce some advanced features, including: 1. **Basic use of Mathematica notebooks**: It introduces how to write and run programs in Mathematica notebooks, and how to handle local and global variables. 2. **Linking external programs with Mathematica**: Through MathLink technology, it shows how to communicate Mathematica with external programs written in languages such as C and FORTRAN to perform complex computational tasks. 3. **Running Mathematica batch files in the background**: It introduces how to create Mathematica batch files and run these files in the background so that other work can be continued during long - time calculation processes. 4. **Parallel computing of Mathematica programs**: It explores how to parallelize Mathematica programs, by distributing independent task parts on multiple computers in the network, thereby significantly improving computational efficiency. Specifically, the paper describes the following aspects in detail: - **Basic operations of Mathematica**: Including how to start a Mathematica notebook, write programs, run programs, etc. - **Use of local and global variables**: It explains the difference between local and global variables and their roles in programs. - **Use of MathLink**: Through specific examples, it shows how to use MathLink to communicate Mathematica with external programs (such as FORTRAN programs) to achieve data exchange and complex calculations. - **Creation and background running of batch files**: It introduces how to create Mathematica batch files and use command - line tools to run these files in the background. - **Parallel computing**: It introduces how to start Mathematica slave processes on local computers and remote computers in the network, and accelerate the execution of large - scale computational tasks through parallel computing techniques. Through these contents, the paper aims to provide a comprehensive guide to help researchers and developers make full use of the powerful functions of Mathematica and improve the efficiency and flexibility of scientific computing.