A FriCAS Quick-Start Installation Guide for Mac OS: A Mathematica Alternative
Table of Contents
FriCAS is a free and powerful computer algebra system that can be scripted using Lisp. It is a good alternative for Mathematica or Matlab, and is said to be more powerful and correct than Maxima.
1. Installation
1.1. Prerequisites
1.2. Procedure
- In a terminal window, run
sudo port install xorg-server
- Run the newly installed program “X11” and let it be open in the background
- In a terminal window, run
sudo port install fricas +gmp +x11
2. Usage
Open a terminal window, and execute the command DISPLAY=:0 fricas
. You should be greeted by the documentation for FriCAS in a new window, and the live prompt where you can start using FriCAS in the terminal.
Try entering the following sequence of commands to test it out:
f(x) == x^3 * sin(x) draw(f(x), x=-3..3)
After which you should see a graph of this function. Click it once to open the interactive controle panel.
Figure 1: The interactive window of the graph depicting the function input in to the FriCAS live session in the terminal of Mac OS.
See the following usage guide for more information: An Introduction To Programming In FriCAS. Or the extensive book.
3. Usage in Emacs
To configure Emacs for FriCAS, copy the following snippet over to your configuration file.
(use-package fricas :load-path "/opt/local/lib/fricas/emacs/" :commands fricas)
Then, execute the newly available function fricas. This should open an interactive session. Note that you should run emacs as follows to enable graphics in FriCAS: DISPLAY=:0 emacs
.
In the interactive session, type the following command to enable LaTeX output:
)set output tex on
Figure 2: FriCAS running in a live session in Emacs on Mac OS, finding the series expansion of a function and its derivative, and outputting the result in rendered LaTeX.