2

I am currently developing a project in JavaFX that accepts a mathematical expression and evaluates it. I have managed to get basic operations and a good deal of algebra to work. I have also managed to perform definite integrations using the trapezoid rule.

The main problem I am facing is with indefinite integration. I looked up many symbolic computation libraries online like JCalculus, JavaCalculus, JScience, SymJa and others. But none of them were as good as SymPy in terms of functionality. I wanted to know if there is a way to send commands to SymPy from Java and receive the result back into Java.

I am thinking of providing an installer for my JavaFX app that will install Python and SymPy if necessitated by the solution. I also tried to understand Jython, believing that it would somehow by related to the problem but I could not understand its purpose and its usage.

Please help me. I am quite good at Java and JavaFX but my knowledge of Python is severely low and restricted. Step by step instructions and sample code is extremely appreciated.

Thanks in advance.

  • You're facing problems with indefinite integration because it is more difficult to program than definite integrals, way more difficult. – gab06 Oct 14 '14 at 18:31

1 Answers1

2

If you somehow manage to write sympy equivalent python code from your java input in a file, you can get the output of that code very easily.

Process p = Runtime.getRuntime().exec("python yourfile.py");

Take a look at this.

Sudhanshu Mishra
  • 2,024
  • 1
  • 22
  • 40
  • For this to work, do I have to install SymPy and Python on the user's machine and also require to add Python to the path? And will it work on Windows? Your link gives a UNIX example... – Dhruv Bhanushali Jun 27 '14 at 05:56