Skip to content

Massachusetts Institute of Technology

OEIT - Office of Educational Innovation and Technology

Facebooks Twitter

C Varenhorst

webMathematica: Empowering Interactive Web Computation and Visualization

November 4, 2005

Violeta M. Ivanova, Ph.D.
Math and Engineering Educational Technology Consultant
IS&T Academic Computing

If you are teaching or supporting a math, engineering, or science class and would like to make it possible for your students to learn computational concepts interactively on the web, consider using webMathematica. A new product by Wolfram Research Inc., webMathematica integrates the computational engine of Mathematica with Java server technologies to provide an interactive web interface for scientific calculations and visualizations. It allows you to create a web site from which students can view and interact with mathematical formulae and display results in 2D and 3D graphics in their web browser. A web browser is all that is needed for most of the interaction. For some advanced features, such as interactive 3D graphics, they also need the Java Runtime Environment (JRE), which comes pre-installed in operating systems such as the Mac OS X or can be downloaded free of charge for other platforms.

3-D Plot

Figure 1. 3D Visualization of a Function of Two Variables.
(The image is a link to one of several interactive examples on the webMathematica server maintained by Academic Computing.)

Anybody can use a webMathematica web site; but can anybody create one? The short answer is no. You need to understand shell commands and system files to install webMathematica, and a good knowledge of Mathematica and Java is recommended before you start developing webMathematica web sites. However, if you do not have these qualifications and would like to use webMathematica, do not despair. The following services will be available for faculty, on a per project basis, from the educational technology consultants at MIT Academic Computing:

  • Hosting and supporting webMathematica web sites on Academic Computing web servers;
  • Limited programming support for selected educational projects;
  • Consulting help during installation and use of webMathematica;
  • Demos by request; look also for the webMathematica demo at the Math on the Web short course during IAP 2006.

Not sure whether you want to do it yourself or request help from Academic Computing? Take this quick quiz:

  • Do you understand shell commands and know how to use environment variables?
  • Can you write Java code and do you know what a .jsp file extension means?
  • Do you have your own web server or the time, ability, and hardware to set one up?

If you answered no to any of these questions, consider discussing your needs and options with Academic Computing by contacting the author of this article for more information on installation, demos, web servers, programming support, and the capabilities of webMathematica. If you answered yes to all questions, you are a good candidate to tackle webMathematica on your own; read on for more details about how to get started.

Do-It-Yourself webMathematica

MIT holders of a Mathematica license can request a free copy of webMathematica Amateur through the Volume Site License Software web site of the MIT Information Services and Technology department. The webMathematica Professional version can be purchased from Wolfram Research Inc.

What You Need (System Requirements)

Minimal system requirements for commonly used platforms at MIT are as follows:

  • Mac OS X: 10.3.
  • Windows: NT 4.0, 2000, XP.
  • Linux: Red Hat 9, Red Hat Enterprise 3.

Commonly used browsers, compatible with webMathematica, are:

  • On Unix/Linux, Mac OS X, and Windows: Firefox, Netscape Communicator, and Mozilla.
  • On Windows and Mac OS X: Internet Explorer.
  • On Mac OS X 10.3+ only: Safari, OmniWeb.

Consult the webMathematica combatibility chart on Wolfram Research Inc.'s web site for a complete list of compatible operating systems, server technology, web servers, servlet engines, and supported Java versions.

Step by Step webMathematica

Follow these steps to install webMathematica:

  1. Set up a Java-enabled web server (also called a "servlet container"):
  2. Install and configure Mathematica:
    • A copy of Mathematica 5.1 ships with webMathematica. Note that the newest version, Mathematica 5.2, is not yet compatible, but you can have more than one Mathematica versions installed on your computer.
  3. Install the webMathematica web application:
    • Install the webMathematica directories and templates into Apache Tomcat;
    • Configure the environment variables for your platform;
  4. UNIX only: configure the X Windows system.

A significant drawback during installation is the guide that ships with webMathematica , which leaves a lot to be desired in terms of clarity, or even correctness, of the instructions. For example, it is not clear from the installation guide that only certain versions of Apache Tomcat (e.g. 4.1.31) and Mathematica (5.1) are compatible with webMathematica . However, Wolfram Research Inc. provides excellent technical support, and help is available on the phone, free of charge, to all licensed users of webMathematica at MIT.

Once the Java Development Kit , Apache Tomcat (or another servlet container), Mathematica, and webMathematica are installed, you can start coding in Java.

webMathematica = Mathematica + Java programming  

Integrating Mathematica with standard Java technologies, namely the JavaServlet and JavaServer Pages (JSP), makes a large library of Mathematica commands available for web development. To create a webMathematica enhanced web site means, essentially, to create a Java servlet - a Java program that runs on a servlet container such as the Apache Tomcat. Creators of webMathematica enhanced web sites call Mathematica commands directly from their JSP files, instead of writing Java code for mathematical algorithms, graphics, and input and output routines that already exist in Mathematica.

Wolfram Research Inc. provides many template JSP files, included in the webMathematica package, which can be edited to fit the desired new content. Proficiency in Java will enable you to explore the capabilities of webMathematica beyond the provided templates. You can browse through available templates on the webMathematica server maintained by MIT Academic Computing: see online webMathematica examples and documentation. If you have completed the installation steps above, you should have the same directories locally on your computer, and can start editing the templates or creating your own JSP files. After you create your webMathematica web site, you can either host it locally on your computer, or contact us to request that your site be hosted on a web server that is supported by MIT Academic Computing.

Office of Educational Innovation and Technology
Building NE48-308, Cambridge, MA 02139-4307
Phone: (617) 252-1981; Fax: (617) 452-4044