Mathematica and the Wolfram language on Raspberry Pi

Lead Image © Adam Vilimek,

Mathematical Mind

Wolfram Mathematica and the powerful Wolfram language are now available for the Raspberry Pi. We'll help you get started with this fascinating tool for calculation, presentation, visualization, and general programming.

Wolfram Mathematica is a computational software program created originally by the British scientist Stephen Wolfram and now developed by Wolfram Research (with Stephen at the helm). Mathematica is mostly used in the fields of science, engineering, and mathematics, but it has a diverse range of capabilities that make it suitable for many other applications in other fields.

At the heart of Wolfram Mathematica is the Wolfram language, which has been around for more than 25 years in various iterations but only recently took the Wolfram name. Wolfram Research calls the Wolfram language a "revolutionary knowledge-based programming language" and claims it is "the world's most productive programming language" – a very bold claim indeed! The language, which focuses heavily on symbolic computing, is very large because of the huge amount of built-in specialization that provides functions for everything – from differential equation solvers to 3D graphical analysis tools and much, much more.

The company also has a product they call Wolfram Alpha, which they describe as a "Computational Knowledge Engine." You might not have heard of Wolfram Alpha, but if you spend any time with Internet technologies, you have have probably made use of it: Wolfram Alpha is one of the answer engines that form part of Apple's Siri and Microsoft's Bing. If you feel like experimenting with Wolfram Alpha, I recommend visiting the website [1] and having a play, because it is really useful: I have used Alpha many times at university to validate my work. (Unfortunately, they make you pay for certain advanced features, but the free version is still serviceable.)

Why Is Wolfram So Special?

Why use Mathematica and the Wolfram language when popular, mainstream languages like Python are already available for the Raspberry Pi? One of the main benefits is that Mathematica uses a multi-paradigm input method, which accepts code in various forms – obviously Mathematica can run native Wolfram language code, but you can also build up code using a more graphical interface called "palettes," and you can even type in plain English and let Mathematica translate the English statements into code using its own algorithms. These capabilities make Mathematica a flexible and intuitive experience for beginners and professionals alike. Another interesting feature of Mathematica is that it is laid out in what they call "notebooks," which enables you to add notes and word-processed text to the same document in which you store your code. This integration of documents and images means you can use the Notebook feature to create impressive presentations in Mathematica.

Until recently, the Mathematica software package (and hence the Wolfram language) has been completely proprietary – costing upward of US$149 a year. Last November, Stephen Wolfram, who is a big supporter of Raspberry Pi and its goal of integrating computers with education, announced that he was developing a free version of Mathematica and the Wolfram language that would run on the Pi. The release of the Raspberry Pi Mathematica edition opens up the brilliant software package to a huge number of students, hobbyists, and professionals who probably would not run across the commercial version of Mathematica in their everyday life.

Getting Started

Mathematica now comes bundled with the standard Raspbian OS image available at the Raspberry Pi website [2]. If you downloaded Raspbian after November 21, 2013, or if you installed Raspbian through a NOOBS version [2] released after November 21, you should already have Wolfram Mathematica installed and available to you.

If you set up your SD card before this date, you'll need to download and install Mathematica. Be sure you have at least 600MB of free space on your SD card to install the software. To install the Wolfram engine in Raspbian, be sure you are connected to the Internet, then open an LXTerminal (command-line) session and type:

sudo apt-get update
sudo apt-get install wolfram-engine

Following the update, the Wolfram installation begins, and you will likely be asked whether you want to continue with the download and installation. Hit Y and then Enter and the package manager will install the Wolfram engine, as well as any other prerequisite software, on your Raspberry Pi. The installation can sometimes take a few minutes, especially if you have not updated your Raspberry Pi in a while. A blue screen pops up asking you to accept the Wolfram license agreement (Figure 1).

Figure 1: Viewing the Wolfram license.

Use the Down arrow to scroll through the text. Press the Right arrow key to select OK and then hit Enter. Another blue screen asks you if you accept the license agreement. If you are happy to proceed, press the Left arrow key to select Yes and then hit Enter.

Once Wolfram and Mathematica are finished installing, you will find them in the app launcher under the Education menu (Figure 2).

Figure 2: Look for Mathematica and the Wolfram language in the app launcher.

If you installed a recent version of Raspbian or NOOBS that ships with Mathematica, you might see some desktop icons (Figure 3) in addition to the app launcher menu entry.

Figure 3: If you install a recent Raspbian version, you might find Wolfram and Mathematica icons on your desktop.

Buy this article as PDF

Express-Checkout as PDF

Pages: 2

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content