David's Blog

Living a quiet life in Coquitlam, B.C.

Name:
Location: Coquitlam, British Columbia, Canada

Sunday, July 19, 2009

Free Math Tools for Science and Engineering Students

On the page in the title of this post are presented links to several numerical mathematics tools, programs written in Javascript for performing specific numerical tasks. I have been working on these math programs for several years but never explained why I do it. So, here goes . . .

When I was an engineering undergraduate, commercial mathematics software was not provided by my school. When the need arose for computer programs that solved math problems, we either searched for existing code or wrote the programs ourselves. At the time, I found good-quality source code written in FORTRAN but had a “C” compiler. So I translated the programs from FORTRAN into “C”. Then, instead of letting the programs sit on a floppy disk in the closet doing nothing, I translated them from “C” into Javascript. (In fact, I have received several requests for “C” source code, so that is slowly getting posted too.)

Posting the routines online as Javascript programs transforms them from passive documents into dynamic, immediate-for-use, tools accessible to anybody with an Internet connection. A few other aspects of Javascript are worth mentioning:

1) Javascript syntax is very similar to that of “C”, so the translation from “C” to Javascript is pretty simple.
2) Javascript programs incorporated in a web page can be run in any browser, regardless of whether the page is being viewed on a computer running Windows, Linux, Mac, etc.
3) A separate executable does not have to be downloaded nor does a plug-in have to be installed.
4) The pages can be saved and the programs can be used in a browser offline.

Over the years, the number of routines posted on the site has grown significantly: there are now utilities for computing the roots of polynomial equations, solving simultaneous equations, computing eigenvalues and eigenvectors, linear least-square data-fitting, cubic spline interpolation, minimization/maximization, numerical integration, and more. In addition, more are planned.

Finally, one short note before I conclude this post. The interface for many of the utilities is getting changed slightly. Instead of requiring all the inputs to be typed in individually, which can get quite tedious and increases the chances of entering typos, more use is being made of textarea boxes, in which all input data can be entered at once. This approach gives users the capability to copy data from a plain-text document and then pasted into the form--a much quicker process and one that eliminates the potential for typos in the input data. In other words, regardless of where the data may come from, as long as it is first copied into a plain-text document and arranged in the appropriate format, it can then quickly and easily be copied into the data input box of the utility.

Labels: , , , , , , , , , , , , , , , ,