[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: referencing sympy commands in Octave
From: |
Mike Miller |
Subject: |
Re: referencing sympy commands in Octave |
Date: |
Fri, 30 Jun 2017 11:31:26 -0700 |
User-agent: |
NeoMutt/20170306 (1.8.0) |
On Fri, Jun 30, 2017 at 14:00:04 +0000, Browning, Robert S IV ERDC-RDE-GSL-MS
CIV wrote:
> I am using the symbolic toolbox and am wondering if there is a way to
> directly call sympy/python commands in an Octave script?
If you mean an easy way to call a SymPy function on an Octave symbolic
variable, it is possible but not easy or encouraged.
For example, you can call
syms x y
result = python_cmd ("_outs = prod(_ins)", x, y)
and the result will be the product "x*y".
At some point in the future it may be possible to call Python functions
directly on symbolic variables, for example
py.sympy.prod ({x, y})
but not at the moment.
> The reason I ask is that the quorem MatLab command does not appear to
> be supported yet. If I could simply call the div sympy command I could
> use that as a work-around. If this is not possible, is there a way I
> can write my own script to add to Octave to do this? How would I go
> about doing that?
Are you willing to write or help develop a Matlab compatible quorem
function for the symbolic package?
If so, the best thing you could do would be to contribute an
implementation of this function, following the example of other @sym
functions in the symbolic package, and file a PR to add this function to
the package at https://github.com/cbm755/octsympy/pulls. This will
ensure it gets added to the next release of the package for all users.
--
mike