Octave: sympy error?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Octave: sympy error?

cfrangos

There seems to be an error in the sympy 1.0 limit() function.

The lim(1/x) as x->0 does not exist while the limit()
function indicates this as +infinity.

It seems that a custom octave function could compute the
left and right limits in order to get a better understanding.

Regards,
Constantine.

octave:20> limit(1/x,x,0)
ans = (sym) oo
octave:21>
octave:21> limit(1/x,x,0,'right')
ans = (sym) oo
octave:22> limit(1/x,x,0,'left')
ans = (sym) -oo



_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Octave: sympy error?

nrjank
On Fri, Nov 18, 2016 at 6:28 AM, Constantine Frangos <[hidden email]> wrote:

There seems to be an error in the sympy 1.0 limit() function.

The lim(1/x) as x->0 does not exist while the limit()
function indicates this as +infinity.

It seems that a custom octave function could compute the
left and right limits in order to get a better understanding.

Regards,
Constantine.

octave:20> limit(1/x,x,0)
ans = (sym) oo
octave:21>
octave:21> limit(1/x,x,0,'right')
ans = (sym) oo
octave:22> limit(1/x,x,0,'left')
ans = (sym) -oo



Yes, and this does appear to be a matlab incompatibility:

Matlab 2016b:

>> limit (1/x,x,0)
ans =
NaN
>> limit (1/x,x,0,'right')
ans =
Inf
>> limit (1/x,x,0,'left')
ans =
-Inf

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Octave: sympy error?

nrjank
On Fri, Nov 18, 2016 at 10:07 AM, Nicholas Jankowski <[hidden email]> wrote:
On Fri, Nov 18, 2016 at 6:28 AM, Constantine Frangos <[hidden email]> wrote:

There seems to be an error in the sympy 1.0 limit() function.

The lim(1/x) as x->0 does not exist while the limit()
function indicates this as +infinity.

It seems that a custom octave function could compute the
left and right limits in order to get a better understanding.

Regards,
Constantine.

octave:20> limit(1/x,x,0)
ans = (sym) oo
octave:21>
octave:21> limit(1/x,x,0,'right')
ans = (sym) oo
octave:22> limit(1/x,x,0,'left')
ans = (sym) -oo



Yes, and this does appear to be a matlab incompatibility:

Matlab 2016b:

>> limit (1/x,x,0)
ans =
NaN
>> limit (1/x,x,0,'right')
ans =
Inf
>> limit (1/x,x,0,'left')
ans =
-Inf



Looking at the help for limit, this is explicitly mentioned as a known incompatibility,as it's currently unknown how to get the same behavior from sympy. It hase a FIXME note pointing to : https://github.com/cbm755/octsympy/issues/74


I also noticed that I had to find the function file to read the help... help limit gave me a error: help: 'limit' not found...

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Octave: sympy error?

Colin Macdonald-2
On 11/18/2016 7:10 AM, Nicholas Jankowski wrote:
> Looking at the help for limit, this is explicitly mentioned as a known
> incompatibility,as it's currently unknown how to get the same behavior
> from sympy. It hase a FIXME note pointing to :
> https://github.com/cbm755/octsympy/issues/74

This is fixable in upstream Sympy; it will happen someday.

(IIRC, it is already fixed in a fork of Sympy but there is some politics
involved in merging that fix back.)

Colin

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave