Maximka - java interface for the Maxima computer algebra system.
ABCL (http://common-lisp.net/project/armedbear/) is used to run Maxima.
- add repo
<repositories>
<repository>
<id>maximka-repo</id>
<url>http://dl.dropbox.com/u/11987354/repo </url>
</repository>
</repositories>
- add dependency
<dependency>
<groupId>com.github.darl</groupId>
<artifactId>maximka</artifactId>
<version>1.0</version>
</dependency>
- use it!
public class App {
public static void main(String[] args) throws MaximaException {
MaximaEvaluator ev = new ABCLMaximaEvaluator();
System.out.println(ev.eval("integrate(1/x, x, 2, 7)")); //should print log(7)-log(2)
}
}
- abcl (version 1.1.0) - to load and run Maxima (for some reason 1.0.1 is last version in maven)
- maxima.jar - packed and slightly patched sources of Maxima
- -XX:MaxPermSize=128m is recomended to sucsessfully load Maxima
- Loading Maxima may take some time (but happens only once)
- Sometimes can unexpectedly fail with "Unhandled lisp condition" (try to run ABCLMaximaEvaluatorTest.testPerformance() multiple times)
- download maxima sources from http://sourceforge.net/projects/maxima/files/Maxima-source/
- unpack sources to %maxima-sources%
- cd %maxima-sources%/src
- edit maxima.asd
--- src/maxima.asd 2 Jan 2011 06:11:33 -0000 1.18 +++ src/maxima.asd 27 Feb 2011 09:28:47 -0000 @@ -9,9 +9,9 @@ ;; Don't try to optimize so much in ECL. ;; Therefore functions can be redefined (essential for share libraries). #+ecl (declaim (optimize (debug 2))) - +#+nil (defvar *binary-output-dir* "binary-ecl") - +#+nil (defmethod output-files :around ((operation compile-op) (c source-file)) (let* ((source (component-pathname c)) (source-dir (pathname-directory source))
- run abcl repl: java -XX:MaxPermSize=128m -jar .../abcl.jar
- execute commands
(require :abcl-contrib) (require :asdf-jar) (asdf-jar:package :maxima)
- you will see location of your file in temp directory
p.s. if you cannot load asdf-jar try to replace abcl-contrib.jar with file from older release (for example 1.0.1)