octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Doubt in functionality of octsympy and octave.


From: Colin Macdonald
Subject: Re: Doubt in functionality of octsympy and octave.
Date: Thu, 24 Mar 2016 11:06:19 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 23/03/16 21:50, utkarsh gautam wrote:
> I had a doubt that, how does octsympy handles custom mathematical functions 
> objects e.g gamma function , airy etc. These functions cannot be written
> in closed form
> hence have to expressed as expression.
> If sympy has a function say"gamma" how I can I use its instance in
> octsympy ?

address@hidden/gamma.m` deals with Gamma function: if you look at that method,
note its a very thin layer which just returns (a representation of) the
SymPy object.

There is a bug report for implementing airy: it should similarly be just
a few lines of interface with SymPy.  SymPy knows how to e.g.,
differentiate airy.

> Similarly since there is no support for sympy in boost library ,which
> forms the basis of pytave,
> other than returning just evaluations of functions , how should I go
> about creating their instances and
> and then using them .?
> My present idea is to create a copy of their custom class (a wrapper)
> and for each member function or operation , call the corresponding
> python function. ? Can anything better be done.?

What you describe sounds like what we do right now: thin wrapper around
SymPy.  Of course, if there are better approaches, we should consider them.

> Also this question is specifically for "Mike Miller(mtmx)" current;y
> pytave has conversion from python list, object,tuple,list ,int etc
>  object to corresponding octave datatype. ,but since my focus is to
> build it for the use of octsympy , how can I simply store the python
> evaluation as string format ?
> This has to be used for symbolic outputs that cannot be further
> simplified or boiled down to any standard octave data type ?
> Since only one day is left for submitting proposal , I hope these
> questions are answered as soon as possible keeping that in mind.

Pytave is written in C++.  One approach would be to implement an
interface where pytave can call custom .m files to deal with converting
Python back to Octave.  Then the Symbolic package could "plugin" some
m-file code.   But as a short term temporary workaround, pytave's C++
code could simply call the address@hidden/sym.m` constructor for all SymPy 
objects.

Colin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]