logo back up home forward   further reading more topics »

Maths - Program

Comparison with other programs

There may be other programs in this field, for example Macaulay2, but I have not evaluated it, so I can't really comment about alternatives.

Evaluate Program

I am working on this program to produce graphs and tables for this site, also to analyse and compare different algebras, it is not yet in a state where it would be useful for others so I have not yet made any code available.

I don't even have a name for this program (and its associated language) yet, I have used 'evaluate' so far but I might call it EuclieanSpace after this site?

The program will evaluate, simplify, plot and do other operations on mathematical expressions. The program is mostly intended to operate with multivectors and matrices but it can operate with scalars (real numbers) and integers.

As an example of where I have used this program to plot graphs see this page.

As an example of where I have used this program to compare the algebraic properties of different algebras see this page.

The program is driven by an XML configuration file which is like a source code language. I have designed this 'language' to be structured, as far as possible, similar to the Java language. So this program can be thought of as a specialist mathematical compiler. Since the configuration file is based on XML it is tree structured consisting of different types of node which I have listed below. If you would prefer to work in terms of a text based source code there is a semantic analyser available which will convert from a text representation to the XML tree structured representation(see the XES program here.).

Some of the main differences between this language and Java are:

program design choice Java Evaluate
built-in types

int,long,byte,float,double,boolean,String

other types can be built by writing classes

int,scalar,multivector,matrix.
operations on numerical types + - * / and bitwise (&,| and ^ ) +,geometric, inner and outer products.
maths functions Math class library inverse,conjugate,reversal

output functions

extensive built-in class library (mostly low level). outputTable, outputFormula, outputSvg and outputXml.
variable definition

numeric variable types have name, type and visibility only. These cannot be changed when the program is running(static typing).

variable types have lots of parameters like dimension, which dimensions square to -ve. attributes of elements, sub-algebras, etc. These cannot be changed when the program is running(static typing).
variables store numeric values (int or float) can store numeric values or symbolic formula (such as: a*2+b).
     

The program is written in java although perhaps on day it could be written in its own language.

Configuration File (Source Code) Definition

Nodes

The program holds the mathematical expressions and all its data in a tree structure which it can read and write to an xml file structure.

The data structure consists of a tree with the following nodes:

nodes

class

Groups together related variables and procedures.

multiOp

This represents operations like +,*,-,/,and,or

can contain 2 or more operands

uniOp

This represents operations like not,-,invert,conj

variable

Holds an instance of a variable. Just before runtime this is linked to varDef node

constant

holds scalar number or array of numbers to represent the value of an integer, scalar, multivector or matrix.

varDef

This holds the name, visibility and mathType of the variable being defined. Before runtime variables are linked to this and it is linked to the appropriate mathType.

mathType

Defines;

array

Defines array of a given variable

call

calls a given procedure. Before runtime it is linked to procedure definition.

procedure

Defines a procedure. Before runtime calls that us this are linked.

return

Element of procedure which can optionally be used to return a value if required.

assignment

Assigns a value to a variable. contains;

simultaneous

Contains multiple condition nodes, solved mathematically not procedurally.

condition

Has two expression nodes and a relation value.

if

contains a condition node and a group or any other node which is executed if condition is true.

group

groups together other nodes so that a sequence can be represented as one node.

loop

Represents functionality of 'for', 'do' or 'while'.

comment

Text to help readability

Program Operation

The following links are setup just before runtime:

Library Items

library

scalar elements are represented by vaiable-element pair.

outputTable

child nodes;

This can allow the program to compare the multiplication tables (the essence of an algebra - for more information about these "Cayley" tables see this page) of different algebras.

The program generates the multiplication (Caley) table for a given algebra and can then do things like checking for commutivity and associativity, it does this by a sort of brute force method of trying all the possible combinations, if you know a more elegant mathematical method please let me know.

I have not properly validated this program so all these results should be treated as tentative. It is very difficult, take the associativity test, the progam tests (a* b)*c and a*(b * c) where we test every combination of a,b and c each of which, in the case of a clifford algebra based on 4D vectors, can have a value between 0 and 7 giving 8*8*8=512 combinations. If any of these are not associative then this is reported and its easy to check manually, but if the program goes through all combinations and finds the table associative, but how do I confirm that one of these combinations is not wrong?

Also the program only checks the commutivity and associativity of the basis values on their own, if does not check the commutivity and associativity of linear sums of these which make up a complete multivector.

I would like to extend this program to directly compare two multiplication tables. This is quite difficult because we not only need to compare the tables as they stand but also all combinations of swapping and inverting terms.

outputFormula

child nodes;



outputSvc

child nodes:

parameters:

svg parameters

Relationship between x value and pixel horizontal offset

i = pixel horizontal offset

i = C + x*(xAxisPos1 -xAxisPos1)

x = (i-xAxisPos1)/(xAxisPos1 -xAxisPos1)

LeftLimit -> i=0 x = (-xAxisPos1)/(xAxisPos1 -xAxisPos1)

RightLimit -> i=gridWidth x = (gridWidth-xAxisPos1)/(xAxisPos1 -xAxisPos1)

outputXml

child nodes;


metadata block
see also:

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

 

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to the software project, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

 

Can you help?

Please send me any improvements to here. I would appreciate ideas to make the pages more useful including error correction, ideas for new pages, improvements to wording. It helps if you quote the full URL of the page.

 

progam

I am working on a project which uses these principles, if you would like to help me with this you are welcome to join in, here:

http://sourceforge.net/projects/mjbworld/

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2008 Martin John Baker - All rights reserved - privacy policy.