## News

v 2.6, November 7th, 2014 is now pushed to Google Play.

New:
• Maxima 5.34.1 is integrated.
• Support for Android phones/tablets with Intel CPU
• Support for Android OS 5.0 Lollipop
• Experimental support for CyanogenMod custom firmware.

Restrictions:
• The use of set_draw_defaults() in the draw package will cause draw(), draw2d(), and draw3d() to fail.
• multi-user is not supported. Only the owner of the device can install and use MoA correctly.
• load(lapack) will fail and it cannot be used.
• load(graph) works and graph package functions can be used, except the function draw_graph()
• Package plotdf is not supported. Use drawdf instead.
• unit package and ezunit package seem not working
• load(opsubst) does not work. load('opsubst) does work.

## What is "Maxima on Android"?

Maxima, a computer algebra system written in Common Lisp, now runs on your Android mobile devices. Maxima, and its predecessor Macsyma is one of the most long-established software in the world. Original development efforts were back in 1960s at MIT LCS and Project Mac, and now the development continues as an open source project at maxima.sourceforge.net .

You can perform many many math operations such as integral, differentiation, matrix operations, rational numbers, symbolic treatment of constants such as pi, e, euler's gamma, symbolic and numerical treatment of special functions such as sin(x), cos(x), log(x), exp(x), zeta(s).

Maxima on Android is a port of Maxima on the Android operating system. Thanks to Sylvain Ageneau' effort on porting Embeddable Common Lisp to the Android OS, the latest Maxima code runs nicely on ECL on Android with very small changes to the source code.

Maxima on Android is a combination of many open source software: ECL on Android, MathJax, and Maxima itself. I wrote roughly a thousand lines of Java code and 50 lines of HTML including Javascript code. The result images can be viewed below:

The installation of the software requires total of 90MB on the storage. 30MB needs to be installed on the internal storage. The rest 60MB can be installed either on the external or the internal storage. The first run of the apk will ask you where you want the 60MB to be installed.

Then you can enjoy Maxima / Macsyma on your mobile phone or tablet based on Android OS.

Yasuaki dot honda at gmail dot com, Chiba, Japan

## How to use Maxima on Android

Choice of place to install

When Maxima on Android is first invoked, it installs additional data of 85MB, extracting from the APK. For those whose mobile devices' internal memory may be small, I give a choice for you where this 85MB to be installed.

When first run, the program will display the messages seen in the left picture (without showing the progress dialog box). You may choose the internal or external storage. If the available capacity is less than necessary, the one (or both) choice will be grayed out. After selecting one radio button, you can click "Install" button or "Cancel" button.

If you press "Install" button, the installation starts and the progress dialog box appears on the screen until installation finishes.

If you press "Cancel" button, this additional install process is terminated and nothing will be installed in addition. Then entire program will quit itself. Later run of this program will start again from this install window in such a case as necessary binary and data are not yet installed.

Start up screen

When everything is successfully installed, you will see the following screen. The screen contains the Maxima on Android information, then typical Maxima information comes after that.

The white large space below (%i1) is the place for displaying the command you typed for execution by Maxima, and also the place for displaying corresponding result.

Enlarge / shrink by fingers

You can enlarge/shrink the displayed text (including math formula) by using two fingers in a standard ways.

Maxima command input area

In the left picture, the bottom rectangle area surrounded by the orange lines is called the Maxima command input area. The area may not be orange line surrounded in the beginning, but if you touch the area, the orange lines appear, indicating that the input focus is given to this text edit area.

This is a standard text input field and many edit aids (such as software keyboard, cut and paste) are available.

Here you can enter any Maxima commands. Then Maxima performs the computation according to the command. The result will be rendered beautifully using MathJax 2.0, then displayed along with the command in the white space above the orange surrounded box.

The font size used in the Maxima command input area can be changed. You can enter:
textSize:40
in the Maxima command input area. Pressing enter key, the size of the font will become 40 pixels. You can specify any number instead of 40, though 10 to 50 is the range for recommendation. In the future release, some GUI will replace the textSize command.

Re-using the previous input by touch

All the previous input commands displayed after the prompt are touchable. When touched, it appears in the Maxima command input area. This is a very handy command history mechanism.

Tap for Execution of Examples

In the Maxima manual, so many examples are presented as session examples. On touching one of them, you can execute such examples in the Maxima itself.

Touching a session example (that appear in gray rectangle, with each input / output with prompts), the viewing of manual is finished and getting back to Maxima. Then, the first input line of the session example is copied to the Maxima command input area.
You can type "enter" key to execute the command, or you can edit it as usual before execution.

For further example execution, you can use "Next example" menu. This will paste the next input line of the session example. Repeating to choose "Next example" from menu will paste next ones into the Maxima command input area.

Maxima commands for beginners

You need to know syntax and semantics of the Maxima commands. They are not very difficult, but there are a number of such commands. Documentation can be found here in English or here in Japanese.

The followings are simple command examples. You may note that all lines are ended with a semi-colon. Actually a line may be ended with a semi-colon or a dollar sign.

You can just copy each of the followings in the browser and paste it into the command input area.

[34^2, 9+10*2-8/10, 8!, sqrt(162)];

[x+2*y=8,x-y=0];
solve(%,[x,y]);

solve(a*x^2+b*x+c=0,x);

x:a+3;
x^2;
expand(%);

[%pi, %pi^2];
%,numer;

Maxima Command Examples

Maxima implements example() command which works in Maixma on Android as well. Try the followings:

example();
example(linsolve);
example(nroots);
example(allroots);

#### Dropbox support

Dropbox is one of the best known cloud storage services in the world. Maxima on Android now supports Dropbox to provide the following functionality:

• To share Maxima code on PC with Android devices
• To write / edit Maxima code on Android devices
• To support loading the Maxima code in Dropbox into Maxima on Android

Let us assume that
• you have an account of Dropbox,
• you installed Dropbox application on your Android device and your PC, and
• sharing files through Dropbox between your Android device and PC already works

Here is step by step instructions on how to load shared files in Maxima on Android:
• You create a test.txt which contains couple of lines of Maxima codes,
• You put the file into Dropbox folder on your PC to share it,
• You make sure the file is there on your Dropbox application on your Android device,
• You may edit test.txt file with Dropbox text editor at any time,
• You export test.txt to the SD card by choosing Export and choosing SD card as the destination,
• The destination folder MUST be /sdcard/Download folder. Typically this is chosen by default,
• Run or return to Maxima on Android
• batch(test); should also work
Repeating editing and exporting is the typical development cycle. Editing can be carried out either on Android or PC.

There are two important things to note. One is that only the text file whose file name ends with .txt can be editted on the Dropbox text editor. So, test.txt can be editted, but test.mac cannot be editted on Android.

The other thing to note is that the folder to export must be /sdcard/Download. This folder is already added to the list of locations where Maxima searches files to load.

Maxima Manual

Maxima manual is available in the menu. You can choose the language of the manual from the settings menu. Japanese, English, and German languages are available.

Qepmax package: Qepcad - Maxima interface

Qepcad is supported in Maxima on Android via qepmax package. This means that the separte Qepcad program is included in this package, and you can use the Qepcad program using Maxima commands defined in the qepmax package. You need to load the qepmax package by doing:

(%i1) load(qepmax);


Qepcad is a program developed by Chris Brown of US Navy Accademy. This program performs a mathematical algorigthm called 'Quatifier Elimination' for the first order predicate logic with polynomials over real domain.

Here is some example that you can do with Qepcad with the qepmax package:

(%i1) load(qepmax)\$
(%i2) qe([[A,x]],x^2-3*x+a>=0);
4 a - 9 >= 0


The above example can be interpreted as follows: What is the condition of 'a' when for all x, x^2-3*x+a>=0? And the answer is 4*a-9>=0. Manually one can find this condition by 'square complete' the formula x^2-3*x+a to obtain (x-3*x/2)^2+a-9/4>=0.

(%i4) qe([[E,x],[E,y]],x^2+2*y^2=1 %and m=x+y);
2 m^2 -3 <= 0


The second example above can be interpreted as follows: What is the range of x+y when x and y satisfies that x^2+2*y^2=1? The answer is -sqrt(3/2) <= m <= sqrt(3/2). Can you find this condition by yourself?

Function qe() takes two args. One is the list of quantified variables, and the second is a logical formula with predicates (>, <, =, <=, >=, #) and polinomials over real domain. Together, the args of qe() represents a formula of the 1st order predicate logic. The formula may contain free variables.

The result of qe() is a formula representing the equal condition as the 1st order predicate logic formula specified in args of qe(), but only including such free varialbes. Here, all the quntified variables are eliminated.

Syntax of the arguments of function qe():
1st argument is a list of quantified variables, You can use A and E as quantifiers (for all and there exist). [[E,x],[A,x]] is a good example of the list of the quantified variables.
2nd argument is a logical formula with variables appeared in the 1st argument and the free variables. You can use %and, %or, %not, %implies as the logical operators. You can use <, >, <=, >=, # as predicates. You can use polynomials and rational functions as terms. So, the valid formula examples are:
x^2+2*y^2=1 and m=x+y.

Note that the number of variables and degree gets large numbers, the speed gets slower (double exponential).

Gnuplot for graph drawing

Now the graph drawing is supported with gnuplot 4.6. You can use the following commands:
plot2d, plot3d, implicit_plot, countour_plot, draw, draw2d, draw3d

Here are some examples of graph drawing commands:
plot2d(x^3-6*x,[x,-3,3]);
plot3d(x^2-y^2,[x,-5,5],[y,-5,5]);
draw2d(implicit(y^2=x^3-x,x,-2,2,y,-2,2));

Also, after you are back from graph window to the Maxima session screen, you can redraw the graph again by choosing Graph in the menu.

Working with your software keyboard

The best software keyboard suitable for math input is the Android keyboard (IMHO). If you are using Kanji input keyboard and / or some special software keyboard for your language, that is usually NOT the best one for use with Maxima on Android.

It is easy to change one software keyboard to the other. 'Long pressing' the Maxima command input area will pop up a list of actions you can do. Among them is for selecting the software keyboard for use. Try changing the software keyboard to Android keyboard.

Save/Restore the Maxima session

In the Session menu, you can see Save / Restore / Playback sub menus. Choosing one of them, you can save the current session, restore the saved session, and playback the display of the results.

User level customization in maxima-init.mac

If /data/local/tmp/maxima-init.mac exists, the file is loaded automatically when Maxima starts up. Arbitrary maxima commands and programs can be placed in the file. The directory /data/local/tmp is writable by ADB (Android Debug Bridge) so it is convenient to push maxima-init.mac from your PC/Mac.

Maxima manual for Android OS 3.x, and 4.0.x

Due to a bug in WebView of Android OS 3.x and 4.0.x, Maxima manual in MOA causes link error when navigating. From MOA 1.8, I have added a workaround for these OS versions.
You need to separately install Maxima manual using ADB (Android Debug Bridge, a tool provided in Android SDK).

You need to download a manual package from here. Then you extract the zip archive. You have a folder "maxima-doc" as the result. Then, in the terminal program of your OS,
% adb push maxima-doc /data/local/tmp/maxima-doc
This will push the document files into /data/local/tmp/maxima-doc folder in your Android device.

From MOA 1.8, if /data/local/tmp/maxima-doc folder exists, files in the folder will be used for manual viewing, and this will NOT cause any link error.

Exiting

To terminate the Maxima on Android program, you can choose Quit in the menu.

Misc.

From MOA 1.5, I have added a command to display misc information of this software. Please choose About MoA in the menu.

ċ
maxima-doc.zip
(4622k)

Jul 31, 2013, 7:09 AM