0

I’m kinda of a new user here. I bought a raspberry pi 2 a couple of years ago and used as media server.

As a physics student I’d like to use Wolfram Mathematica. I would like to do something like this:

  • run Mathematica on raspberry
  • work on the raspberry from a ssh terminal from my chromebook/IPad

But I’ve seen most of the time Mathematica used with a GUI, so my question would be if it’s possibile to run Mathematica from terminal on raspberry, what model should I buy and what os to install to run it.

Thank you so much

1
  • John, Welcome to RPi SE. I must say that I feel that your question shows a lack of effort on your part to "help yourself". I hope that I'm wrong about that, but please do have a look at the "the Tour". – Seamus Feb 19 at 23:21
2

I haven't used Mathematica so far and don't know how it works. But if it has a command line then you can use that of course. With the graphical user interface you may consider to use VNC instead of ssh.

I think Mathematica needs some power, therefore you are well advised to use a Raspberry Pi 4B with 4 GB of RAM. There are also a version with 8 GB RAM available but for my opinion its not needed because single programs can only use 4 GB at once. As operating system the default Raspberry Pi OS will do.

1

Yes you can use Wolfram mathmatica from the command line. When you ssh into you RPI you can use wolframscripts, or use the wolfram engine directly.

After ssh'ing into you RPI issue this command:

pi@raspberrypi: wolfram

you should get a prompt that looks like this

In1:=

This will essentially put you into a wolfram shell where you can enter expressions and evaluate them.

Or after saving your expressions to a file wolframscripts lets you execute that file with the wolfram engine for example save this to a file named wolf.wls

{#!/usr/bin/env wolframscript -function -signature City City}

Print[GeoDistance[#1, #2]]&

then execute the file

pi@raspberrypi: ./wolf.wls "Champaign, IL" "Oxford, England"

pi@raspberrypi: Quantity[4010.4812837526256, Miles]

WolframScrips

I hope this helps

1

I'm not a user of Mathematica, but I have used Matlab in the past. If your needs for Mathematica can be satisfied by Matlab, then you may find GNU's Octave distribution worth a try - Octave tries its best to be a clone of Matlab.

Octave is in RPi's package repository:

apt-cache showpkg octave

informs us that the version is 4.4 (the current build is 6.1).

Octave can be run from either the GUI, or the command line. This means you can run it from either the Lite or the Desktop distros of RPi OS.

I've found Octave a decent package to use, but I don't do anything "heavy duty". My positive recommendation for Octave ends with Octave itself. My personal experience with some of its "package extensions" is negative - very negative in fact. The project has an incoherent approach to managing the extensions which will waste your time.

If a "Matlab-clone" won't meet your needs, the package sagemath is more like Mathematica, and is also in RPi's package repository:

apt-cache showpkg sagemath  

shows us that version 8.6-6 is available as a direct install using apt, while the current version is 9.2, and could (probably) be built from source. sagemath may also be run from the shell's command line interface. Please refer to the sagemath GitHub site for other details.

In closing, I must also say this: Your question was interesting enough to research, but strikes me as a silly idea for anyone with an even moderately capable laptop or desktop machine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.