Overview

The console is a text-based interface for interacting with Math Minion. It has two modes selected by the button at the bottom of the information view:

Using the Console

To open the console, tap the button at the bottom of the information view. Tapping it again will close the console. Note that unlike other views, the console is not pushed on top of the current information view, but rather just sits overtop of it.

Regardless of which mode is selected, you just enter your commands or instructions into the input field at the bottom of the console. When you press the Enter key, the input is submitted and the results are displayed in the text area above.

If you wish to enter multi-line input, you can use the Shift-Enter key to move to the next line.

Use the up and down arrow keys to navigate the history of commands.

Each input creates a new page of output. You can use the Shift-Up and Shift-`Down arrow keys to navigate between pages.

You can also use the Read Command File button to read a file of commands.

Note: The console button at the bottom of the information view is a toggle. Tap it to see the console view and tap it again to hide the view.

A Note on Program Structure

When Math Minion runs, all the calculations take place in a separate process called a web worker and all the user interaction and display occurs in the main program. The main program communicates with the calculation engine by passing it text commands. When the engine completes the command, it sends a message back to the main program containing text in the form of JSON. The interface uses these replies to construct what you see.

Console Mode

When in console mode, the commands you enter are sent directly to the calculation process and and the results it returns are displayed in the text area above. For example:

.Records get notes

would return the notes for the Records tool.

Commands

Commands take the form of a subject path, followed by an action, possibly followed by an object or other action parameter. If the subject path is omitted, the default subject is used.

The top of the subject tree is the session, which has the path "/". Children are separated by dots, so "/.root" is the root model and "/.root.x" is the tool named x in root.

At start up, the default subject is root and if a path does not start with "/", it will be relative to the default subject. Thus ".x" would also refer to the tool named x in the root model, unless the default subject has been changed. In Math Minion, the current subject is the model being viewed in the diagram unless changed with the cd command.

The command help will list the commands the subject understands. If the help command is followed by one of those commands, a very brief usage message will be displayed.

You can also looked at the instructions for the AI assistant. They are a bit verbose, but contain detailed information. There are also specific instructions for less common tools:

OpenAI Mode

NOTE: Using this feature will require having an OpenAI account and an OpenAI API key. This can be obtained from https://platform.openai.com/api-keys, but it is a paid service and will incur a cost. However you only need to add a few dollars to your account and $10 will go a long way.

How useful this is may be questionable, but it is a fun way to play with AI.

When in OpenAI mode, the instructions you enter are sent to OpenAI's API, which returns comments and usually commands. The commands are sent to the Math Minion engine for execution. Both the comments and commands are displayed in the text area above.

If executing a command returns an error, it will try a couple of times to fix it before giving up. If there are problems with the solution it created, you can ask it to fix them, although it is often easier to just fix them yourself.

How well it works is variable and while it sometimes is surprisingly bright, other times it is rather dim. The same instructions will often produce different results.

It can be a bit slow, so be patient. If it encounters an error and tries to fix it, the "thinking" indicator in the input field may disappear, but either a "Done" or Failed message will appear in the text area when it is finished. If you want to abort it, just refresh the browser. Refreshing will also clear the saved conversation and start fresh.

The assistant's instructions includes all functions and formula syntax and how to create and manipulate all Math Minion tools, with the exception of the HTML page and imported model tools.

Here are some examples along with comments on how well it worked as I write this. Again results vary.

I need an Expression that is 200 elements long that toggles between 0 and 1

This usually works well.

Given equations:
3*x-cos(y*z)-0.5 = 0
x^2 -81*(y+0.1)^2 + sin(z) +1.06 = 0
Exp(-x*y) +20*z+ (10*pi -3)/3 = 0
Create a model that determines the values of x, y and z.

This worked correctly except it didn't create a model, but created the tools in the current model.

For angles 0 to 720 degrees in 10 degree increments, create a 3d plot with x being sin angles, y being cos angles and z starting at 0 m and increasing 1 m for angle index. Add a second curve with z 20 m above the first.

This worked correctly.

Create a model to simulate a predator/prey relationship. Inputs should be: initial populations of predator and prey - default 200 for both the prey growth per period of time in the absence of predators - default 1 per day Death rate of prey per encounter with predators - default 0.003 1/d Death rate of predator in absence of food - default 2 per day Efficiency of turning prey into predators - default 1 Show both a table and graph of the results

This also usually works, but sometimes with a few errors that need to be fixed. This time it had an error that it fixed itself, but ended up with the model embedded inside an outer one.

The instructions didn't say anything about duration, so it just took a reasonable guess. After it created the model, I told it:

change the run time to 10 days and the recording period to 1 hour.

which it did correctly.

I have found doing things like asking it to examine a model and then add appropriate notes to the tools often works pretty well as does things like asking it to arrange the diagram icons into two columns or some such.

The bottom line is that it is fun to play with and might even be a time saver. The jury is still out, but given the rapid improvements in AI, that isn't going to be the case for long.