Euler Math Toolbox (Euler for short) is a numerical and algebraic software, a mixture between a computer algebra system (CAS) and a numerical matrix language. The numerical part has been programmed by R. Grothmann, a mathematician at the University of Eichstätt. The algebraic part uses Maxima, an open CAS software.
The numerical kernel of Euler is based on a matrix language. This language can not only handle simple numbers, but also vectors and matrices of numbers. Moreover, Euler can compute expressions with complex numbers, intervals and strings. All these computations can be programmed in Euler functions, which might be loaded from external files into Euler. Indeed, a large part of the Euler syntax is based on functions written in the Euler programming language.
Euler can also produce graphics and save the graphics in various formats, among them PNG and SVG. Graphics can also be imported into the text window, exported to files or to the clipboard. More on this in the reference for the user interface.
The Maxima subsystem communicates with Euler through pipes. It remains a separated system. However, there are various interactions between Euler and Maxima. Using symbolic expressions, Maxima works completely transparent inside Euler. This is a mighty environment to investigate mathematics.
Euler started about 1987. The aim was to get the functionality of MATLAB on an Atari ST. The program was never a clone of MATLAB, and went its own path since the beginning. The current version works on Windows. Older versions for OS/2 or Linux are no longer up to date. However, Euler will run in Linux under Wine, including Maxima support. A native version for Linux, based on the native port by Eric Boucharé will have to wait.
From the user viewpoint, Euler looks like a command shell in a text window. Here, commands can be entered and executed, and the output will appear in the same window below the command. There is a second window, the graphics window, for the graphical output of Euler. The current graphics in the graphics window can be inserted into the text window at the current line. All commands in the text window can be edited and executed at any time. It is also possible to add comments. We refer to the content of the text window as an Euler notebook. Notebooks can be exported to HTML pages.
>1+1 2 >exp(-0.5)*sin(3/2*pi) -0.6065306597126
If you make a mistake, go to the error with the mouse or the cursor keys, and correct the input. Press return anywhere in the line to start the computation.
For a next step, I suggest opening the introduction notebooks in the Euler program. Use the help menu to find the introductions. They should be contained in the Euler installation. After reading a few of these introduction notebooks, you should have a very good idea of Euler.
Since Euler uses commands, you should take the time to learn the proper syntax of the program. This text tries to give you a good start on all aspects of Euler.
Further Information | |
---|---|
Help on current Command | Mark the command with a double click and press F1 |
The Status Line | Watch the status line for information on the current command. |
Open Introduction | Opens one of the introduction notebooks. |
Euler Help | Documentation on Euler. |
Version Information and Update | Look for the current version in the Net. |
There is a HTML file in the documentation with a full description of the Euler GUI. Here, we give only a quick overview.
The interface of Euler is relatively simple with its text window and its graphics window. The text window has the usual menu, the notebook area and a status line. Both windows can be enlarged. Euler will remember the sizes and the positions of the windows.
The advantage of such a simple interface is that it is not complicated to learn. The disadvantage is that it does not offer graphical icons listing all the available commands, since it is impossible to squeeze all options of Euler and Maxima into menus or icons. However, there is a reference and extensive help available through the help menu.
The graphics window contains the current graphics. It can be resized. To get a square aspect ratio, there is a menu item to resize the graphics window accordingly. The content of the graphics window can be exported in various formats. Either use the menu, or the functions savepng, savesvg, saveps.
Further Information | |
---|---|
TAB key | Switches between text and graphics window. |
>insimg | Inserts the current graphics into the notebook. |
All commands are entered into the text window in the current command line. The commands are in dark red and start with the prompt >. The user cannot delete the prompt >. Furthermore, the text window may contain comments in green color, and function definitions in blue color starting with $.
Enter commands just like in any other program, which uses a command shell. Use the arrow keys or the mouse to move the cursor. The Ctrl key together with the cursor moves the cursor word by word. Have a look into the edit menu for more options. Press the enter key anywhere in a line to execute the command.
The command line can contain more than one command. Separate the commands with a
A comma at the end of the command line can be omitted, and prints the result.
Command lines can be broken into several lines using "...". These lines execute together as one line.
>plot3d("x^2+y^2",a=0,b=2,c=0,d=2, ...
> niveau=0:0.5:8,zlabel="x^2+y^2",angle=-60°)
To break a command line, use Ctrl-Return, or press F9 to call the command line editor, and break the lines there.
Command lines can be deleted (Ctrl-Backspace). The deleted lines are accumulated and can be inserted anywhere (Ctrl-U). The shortcuts for this are listed in the edit menu. (Alternatively, you can use cut and paste as described below.)
To stop a long computation press the Esc key. This will also interrupt the print of long vectors.
To add a comment to a command line, start the comment editor with F5. The command editor is a simple text editor, which simply uses lines of text. The lines are then broken into lines of length 80 by default for the Euler notebook. To make paragraphs, use an empty line.
Comments can contain images and images derived from Latex formulas. The comment syntax for this is the following-
* This is a Heading This becomes a formula: latex: \sum_{k=0}^n x^k = \frac{1-x^{n+1}}{1-x} >&sum(x^k,k,0,n)|simpsum n + 1 x - 1 ---------- x - 1 This is a geometric construction done with C.a.R., and the screen dump was saved as PNG. image: geometrie.png
The green parts are comments, as they appear in the comment editor. After editing the comments in this way, the notebook will look like this, displaying the nicely rendered formula in the first comment and the image in the second.
You need to have a valid Latex system installed to generate Latex formulas. For more information see the installation guide.
latex: \integrate(x^2,x) = \frac{x^3}{3} + c
maxima: 'integrate(x^2,x) = integrate(x^2,2)+c
The second line runs the result through Maxima and uses the output of the tex command in Maxima to get the formula, which is then run through Latex. You can also use it to format the content of a symbolic variable in Latex in a comment.
It is also possible to set links for the HTML output in comments. The following two types of links refer page.html in the current directory, and to an internet link.
See: page
http://link
Simple comments can be appended to the command line using //.
>sum(1:1000) // computes the sum from 1 to 1000
500500
If an expression is too long for one command line, or does not look well in one single line, it can be broken into the next line with ..
>a:=1; >b:=(1+a+a^2+a^3)* .. >(1+2a+3a^2) 24 >plot2d("x^y",a=0,b=3,c=0,d=3, ... > niveau=-10:0.1:10, ... > title="x^y");
If lines end with three dots ..., Euler will execute the complete command at once (multi-line commands). This will work, even if the cursor is in the second line of the multi-line command. An internal editor (started with F9) can be used to edit such lines in one step.
You can mark text in the text window by dragging the mouse over it. Marked text can be copied to the clipboard. The copied text can then be inserted into the current command line, if it is less than one line, or in front of the current command line, if it contains several lines. This is also a quick way to send Euler commands by mail.
There are special menu entries to copy commands only, or to copy a formatted version of the notebook. Copying commands only is designed to generate an Euler file from the marked commands. It will not contain any output. Formatted copying is good for generating documentation files for Euler. The output can still be pasted back to Euler.
Further Information | |
---|---|
, | Separated the commands in a command line. |
; | Separates the commands and suppresses output. |
Home, End | Moves the cursor to the line ends. |
Shift | Marks text together with the cursor keys. |
There is a nice overview to the syntax of Euler in form of a notebook.
Euler knows commands, expressions and assignments.
>list sin // command "list" *** Functions: antialiasing arsinh asin isinterval sin sinh 7 items found! >a := sin(pi/2) // assignment ":=" 1
The most elementary expressions are mathematical expressions. Euler will evaluate these expressions with the usual order of evaluation.
>(1+2*4)*(3+4)/(4+2)
10.5
There are functions which work like commands. The result of these functions is of no interest. In this case, you can prevent the output of the result with a semicolon ;. An example is the plot2d command, which returns the coordinates of the current plot window. Usually, we do not need this information.
>plot2d("x^2",-1,1);
An assignment contains a variable name on the left side, and an expression on the right side of :=. Here, the semicolon cd{; will often be used to suppress the output.
>a:=2; >a:=a^2; >a 4 >a:=a^2; >a 16
Euler does also understand the syntax a=2 for assignments. However, in cases like a=a^2 this looks confusing, so it is no longer recommended. In this introduction, we use the := syntax.
There are other assignments for symbolic variables, and symbolic values. Refer to the page about symbolic computation for more information.
There are also multiple assignments to assign multiple return values of functions to several variables. Read more about this in the section about programming.
Further Information | |
---|---|
>x^2 | Sends the command to Euler. |
>:: x^2 | Sends the command to Maxima. |
>&x^2 | Symbolic expression (preferred way to use Maxima) |
>: x^2 | Sends the command to Maxima in direct mode (disabled by default) |
>> x^2 | Sends the command to Yacas (disabled by default) |
Ctrl+Cursor-Up | Pastes the previous command line into the current one. |
The content of the text window is called a notebook. Notebooks can be saved in a simple text format, or exported to HTML for web pages or printing. Notebooks can contain commands, Euler output, comments, and images. If a notebook containing images is saved, the images are saved in separate files in the PNG format.
To navigate through the commands in a notebook use the mouse or the cursor keys. The comments and the output of a command belong to the command. Scrolling through the notebook with the scroll bar or the mouse wheel does not change the cursor position. You will have to click into a command to edit it.
To edit the comment of a command, use the comment editor with F5. To edit a function definition, use the internal editor with F9. These editors are explained in more detail the GUI documentation. The output cannot be edited. Command lines can be inserted and deleted only together with their comments and their output.
Note that the order of execution may not be the order of the commands in the notebook. Entering the commands in the following notebook yields the output printed here. If you go back to the second line and execute it once more, a=4 will be used, and the output changes to 16.
>a:=2; >a*a 4 >a:=4;
To run all commands in a notebook use the corresponding menu entry. All variables will be set in the correct order then. For a clean start, reload the current notebook via the list of recent notebooks. By default, Euler will restart automatically, when a new notebook is loaded.
Saved notebooks must have the extension *.en. These files are ordinary text files. However, it is not recommended to edit notebooks with an external text editor. The character encoding of the notebooks is the current encoding of the system the notebook was saved with. Notebooks with comments in foreign languages may not look well in wrong encodings. Currently, Euler does not save notebooks in Unicode encoding.
Images will be saved in separate files in PNG (portable network graphics) format, and are referred from the notebook file by file name.
By default, Euler performs a fresh restart when a notebook is loaded. This can be disabled with a switch in the options menu. A restart affects Maxima too. The Maxima process ends, and by default starts again. In case Euler crashes (hopefully never), you may want to kill the pending Maxima process.
Further Information | |
---|---|
Open Notebook | Open notebook in the current directory. |
Open User Notebook | Open notebook in the user directory ("Euler Files" in the documents). |
Open Introduction | Open introduction notebook installed with Euler. |
Export to HTML. | Export the notebook as an HTML file. |
Euler comes with a complete reference in English, a reference to the Euler interface, many examples, and this documentation. Use the help menu, the examples menu and the three menus with Euler, Maxima and user commands to access these items. The user command menu is empty, until you load an Euler file containing menu items.
The examples in the menu will paste into the notebook, including a comment and several commands. The commands in the menus for Euler and Maxima will be pasted at the current cursor position. The commands can contain places to be filled in. These places look like ?explanation with an explanation about the expected item. Place the cursor in front of the question mark and start typing to fill the item. You can go to the next question mark with the cursor right key.
Also observe the status line in the text window while typing a function. After the open bracket of the function, you can find a list of parameters and an explanation there. This works for Euler and Maxima commands. Pressing F1 opens the index page of the full reference positioned at the command. If that does not work on your system, of if you want to use a specific browser, set the browser executable in the options menu.
If a word is marked in the notebook, F1 will jump directly to index in the reference page at the marked word. To mark a word double click on it. Once the browser window opens, you find the marked word in the first line. Follow the links to the full reference of the item. In case, your browser does not open, you can edit the browser call string. There is a browser function to find your favorite browser for Euler.
Moreover, there is the help command, which prints the help into the notebook. The help lines may include examples.
>list sin *** Commands: *** Euler functions: antialiasing arsinh asin isinterval sin sinh >help sin sin is a builtin function. abs,sin,cos,tan,asin,acos,atan,exp,log,sign,sqrt Mathematical functions. Work for real, complex and interval scalars and matrices. The trigonometric functions work for radians. To convert use x° or deg(x). (use shift-F7 for °) Examples : sin(45°) // -> 0.7071067811865 - sin in degrees! sin(pi/2) // -> 1 sin(rad(90)) // -> 1 ... cos(1)^2+sin(1)^2 // -> 1 cos(acos(0.1)) // -> 0.1 plot2d("cos(x)",0,2pi); ...
Above you see the help for a built-in function. Functions in the Euler language look a little bit different.
>help sinh
function sinh ()
Function in file : functions
...
There is a similar command for Maxima functions.
>mxmhelp plotdf
-- Function: plotdf (<dydx>, ...options...)
-- Function: plotdf (<dvdu>, `['<u>,<v>`]', ...options...)
-- Function: plotdf (`['<dxdt>,<dydt>`]', ...options...)
-- Function: plotdf (`['<dudt>,<dvdt>`]', `['<u>,<v>`]', ...options...)
Displays a direction field in two dimensions <x> and <y>.
<dydx>, <dxdt> and <dydt> are expressions that depend on <x> and
<y>. <dvdu>, <dudt> and <dvdt> are expressions that depend on <u>
and <v>. In addition to those two variables, the expressions can
...
Further Information | |
---|---|
>list text | Find all functions and commands containing the text. |
>help command | Display help on the command. |
>type function | Type the definition of the function. |
>listvar | Types all variables and their values (for short variables). |
>listvar text | Contains all variables containing the text. |
If you want to develop longer and more complicated programs, it becomes useful to put all function definitions and all commands into external Euler files. These files should have the extension *.e, and can be loaded into Euler with the load command.
Files in the current directory will be found by their name. The current directory is the directory, where the current notebook is loaded from or saved to. Otherwise, use the full path the file, or include the directory of the file into the Euler path.
>load sound Save and load WAV sound files. Analyze frequencies. end{verbatim} end{euler} begin{euler} begin{verbatim} >help sound // or help sound.e
Some Euler files start with comments, which are printed in the text window. This can be switched off with ;.
>load sound;
For more information about the functions in an Euler file, use the help command with the file name.
Comments in the Euler file must be written between comment and endcomment. There also are other ways to comment an Euler file. Here is an example of an Euler file.
comment This text is shown when the file loads. endcomment /* Multi-line comment Some variables: */ g:=9.81; // earth gravitational acceleration t:=2.5; // time s:=1/2*g*t^2; // height // Output of s: s,
Save this file into a file named test.e, and load it with the load command as follows
>load test
This text is shown when the file loads.
30.65625
All output of the load command will be printed at the current command line. The commands in the Euler file are not inserted into the current notebook, when the file is loaded.
Euler files can be edited with the internal or an external editor. To call the internal editor, use the menu item, or press F9. A dialog will open. If the editor is called in a line which starts with a load command, it uses this file.
The editor edits the file EulerTemp.e in the user directory, if it is started in an empty line. However, other files can be loaded into the editor, or the editor file can be saved to some other file.
The external editor works with the load command too. But it cannot edit function definitions, or command lines. The default external editor is JE, a Java based editor, which is installed with Euler. However, you can configure any other editor of your choice. Euler does not wait for the external editor to finish. You can leave the editor open, switch to Euler, and run the load command there. Do not forget to save any changes in the external editor.
The external editor will find the file in the current directory, i.e., the directory of the current notebook. For other files, use the full path in the load command, and press F10.
Euler notebooks can be exported to HTML. The export uses CSS styles, which are either defined in the page header, or in a separate CSS file. If a file named euler.css is found in the current directory, it will be used. To see the necessary CSS elements, have a look at this file.
The most flexible way is to provide a pattern.html file in the current directory. It must contain a line with "#". At this place the content of the notebook will be inserted.
The images of the Euler notebook are used for HTML too. By default, the images are stored in a image folder in the current directory.
Euler can generate links during the export. To do this, use the following lines in comments.
http://www.anypage.de See: Any Page
The first will create a full link to the internet. The second will link to "Any Page.html" in the current directory.
Euler files can be converted to HTML with a menu item. The output will be "Filename.e.html". The structure of the Euler file should be the following
// Page Title comment A short comment (printed when loading) endcomment // Longer comments for the HTML file (will go to <p>...</p>), // can contain several lines // Another paragraph // >samplecommand(); // * A Heading a := 5; function f(x) := sin(x); function test(x) ## Comment for test ## Second line of comment ... endfunction
These HTML files can be linked from notebook comments with
See: Filename.e