An implementation of a symbolic toolbox using SymPy.
[https://github.com/cbm755/octsympy]
Feature parity with the other symbolic toolboxes.
"Beta" quality at best! Contributions welcome.
-
The only dependencies are Python and SymPy. Consult the SymPy website (e.g.,
yum install sympy
on Fedora). -
Download the latest release, e.g.,
octsympy-0.1.2.tar.gz
. -
Run Octave and change to the folder containing the downloaded file.
-
At Octave prompt, type
pkg install octsympy-0.1.2.tar.gz
. -
At Octave prompt, type
pkg load octsympy
. -
At Octave prompt, type
syms x
, thenf = (sin(x/2))^3
,diff(f,x)
, etc.
-
Get Octave for Windows.
-
Try the octsympy-windows-0.1.2.zip package. Follow the last three steps above using this file instead.
The octsympy-windows
package should have no dependencies other than
Octave itself (it includes SymPy and a Python interpreter.)
Alternatively, you can install Python and SymPy yourself and use the
standard octsympy-0.1.2.zip
package.
If you encounter any difficulties (even minor ones) please read and if possible help us improve the wiki page on Windows Installation.
Although OctSymPy is designed for GNU Octave, it will work with Matlab. Currently only the slower system()-based communication is available.
-
Download the latest release, e.g.,
octsympy-matlab-0.1.2.tar.gz
. -
Unzip is somewhere and add it to your Matlab Path.
The .m files for Matlab have been reformatted for Matlab comment conventions, but are otherwise the same as the Octave source.
We have a list of things to work on tagged help wanted. Some of these should be quite easy to fix and would be a great way to get involved. Come join us!
How to hack on the code:
-
Clone the repo with git (preferred, but you can use the "Download ZIP" instead of you want).
-
Go to octsympy/src/ and type "make". (You only need to do this again if you change the inst/private/python_header.py or various autogeneration scripts in src/.)
-
Run Octave (or Matlab) in octsympy/inst/.
Python code is generated to do the actual work. Each sym objects keep
a text field for display purposes and a string (a SymPy srepr
). The
objects are communicated between Python and Octave by passing the
srepr's back-and-forth. Currently pure m-file (and Python)
implementation, no code to be compiled.
We have two IPC mechanisms between Octave and Python. One option is calling "system()". The other uses "popen2()". Others could be implemented.
-
There was a previous "symbolic" package in Octave Forge based on GiNaC. Its history has now been merged into octsympy.
-
"SymPy CAS" by Jonathan Lister. Calls SymPy commands using system().