New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

limit((x**Rational(1,4)-2)/(sqrt(x)-4)**Rational(2, 3), x, 16) NotImplementedError #8229

Open
satels opened this Issue Oct 11, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@satels
Copy link

satels commented Oct 11, 2014

On master

>>> limit((x**Rational(1,4)-2)/(sqrt(x)-4)**Rational(2, 3), x, 16)
Traceback (most recent call last): File "", line 1, in  File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/series/limits.py", line 85, in limit r = gruntz(e, z, z0, dir) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/series/gruntz.py", line 637, in gruntz r = limitinf(e0, z) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/cache.py", line 93, in wrapper r = func(*args, **kw_args) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/series/gruntz.py", line 416, in limitinf c0, e0 = mrv_leadterm(e, x) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/cache.py", line 93, in wrapper r = func(*args, **kw_args) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/series/gruntz.py", line 496, in mrv_leadterm series = calculate_series(f, w, logx=logw) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/series/gruntz.py", line 453, in calculate_series for t in e.lseries(x, logx=logx): File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/expr.py", line 2492, in yield_lseries for si in s: File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/expr.py", line 2566, in _eval_lseries series = self._eval_nseries(x, n=n, logx=logx) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/mul.py", line 1445, in _eval_nseries res += C.Order(x**n, x) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/decorators.py", line 77, in __sympifyit_wrapper return func(a, b) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/decorators.py", line 118, in binary_op_wrapper return func(self, other) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/expr.py", line 105, in __add__ return Add(self, other) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/cache.py", line 93, in wrapper r = func(*args, **kw_args) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/operations.py", line 40, in __new__ c_part, nc_part, order_symbols = cls.flatten(args) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/add.py", line 122, in flatten if o1.contains(o): File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/cache.py", line 93, in wrapper r = func(*args, **kw_args) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/series/order.py", line 349, in contains l = limit(ratio, s, point) != 0 File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/series/limits.py", line 85, in limit r = gruntz(e, z, z0, dir) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/series/gruntz.py", line 637, in gruntz r = limitinf(e0, z) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/cache.py", line 93, in wrapper r = func(*args, **kw_args) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/series/gruntz.py", line 416, in limitinf c0, e0 = mrv_leadterm(e, x) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/cache.py", line 93, in wrapper r = func(*args, **kw_args) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/series/gruntz.py", line 471, in mrv_leadterm Omega, exps = mrv(e, x) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/series/gruntz.py", line 265, in mrv s, expr = mrv(b, x) File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/series/gruntz.py", line 300, in mrv "Don't know how to calculate the mrv of '%s'" % e) NotImplementedError: Don't know how to calculate the mrv of 'O(1/_w, (_w, oo))' 

On 0.7.3

In [3]: limit((x**Rational(1,4)-2)/(sqrt(x)-4)**Rational(2, 3), x, 16)
Out[3]: 0

On wolfram:

http://www.wolframalpha.com/input/?i=limit+%28x^%281%2F4%29-2%29%2F%28%28sqrt%28x%29-4%29^%282%2F3%29%29+x+-%3E+16

= 0

@satels

This comment has been minimized.

Copy link

satels commented Oct 11, 2014

tests are written? :-D

@skirpichev skirpichev added the series label Oct 11, 2014

@pelegm

This comment has been minimized.

Copy link
Contributor

pelegm commented Oct 12, 2014

Nicer traceback:

Traceback (most recent call last):
  File "<ipython-input-13-a11a60168444>", line 1, in <module>
    limit((x**Rational(1,4)-2)/(sqrt(x)-4)**Rational(2, 3), x, 16)
  File "sympy/series/limits.py", line 79, in limit
    r = gruntz(e, z, z0, dir)
  File "sympy/series/gruntz.py", line 647, in gruntz
    r = limitinf(e0, z)
  File "sympy/core/cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy/core/compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy/series/gruntz.py", line 420, in limitinf
    c0, e0 = mrv_leadterm(e, x)
  File "sympy/core/cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy/core/compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy/series/gruntz.py", line 502, in mrv_leadterm
    series = calculate_series(f, w, logx=logw)
  File "sympy/series/gruntz.py", line 458, in calculate_series
    for t in e.lseries(x, logx=logx):
  File "sympy/core/expr.py", line 2468, in yield_lseries
    for si in s:
  File "sympy/core/expr.py", line 2542, in _eval_lseries
    series = self._eval_nseries(x, n=n, logx=logx)
  File "sympy/core/mul.py", line 1441, in _eval_nseries
    res += C.Order(x**n, x)
  File "sympy/core/decorators.py", line 77, in __sympifyit_wrapper
    return func(a, b)
  File "sympy/core/decorators.py", line 118, in binary_op_wrapper
    return func(self, other)
  File "sympy/core/expr.py", line 107, in __add__
    return Add(self, other)
  File "sympy/core/cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy/core/compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy/core/operations.py", line 41, in __new__
    c_part, nc_part, order_symbols = cls.flatten(args)
  File "sympy/core/add.py", line 121, in flatten
    if o1.contains(o):
  File "sympy/core/cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy/core/compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy/series/order.py", line 373, in contains
    l = ratio.limit(s, point) != 0
  File "sympy/core/expr.py", line 2642, in limit
    return limit(self, x, xlim, dir)
  File "sympy/series/limits.py", line 79, in limit
    r = gruntz(e, z, z0, dir)
  File "sympy/series/gruntz.py", line 647, in gruntz
    r = limitinf(e0, z)
  File "sympy/core/cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy/core/compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy/series/gruntz.py", line 420, in limitinf
    c0, e0 = mrv_leadterm(e, x)
  File "sympy/core/cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy/core/compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy/series/gruntz.py", line 476, in mrv_leadterm
    Omega, exps = mrv(e, x)
  File "sympy/series/gruntz.py", line 266, in mrv
    s, expr = mrv(b, x)
  File "sympy/series/gruntz.py", line 301, in mrv
    "Don't know how to calculate the mrv of '%s'" % e)
NotImplementedError: Don't know how to calculate the mrv of 'O(1/_w, (_w, oo))'

skirpichev added a commit to diofant/diofant that referenced this issue Apr 27, 2015

skirpichev added a commit to skirpichev/diofant that referenced this issue Nov 2, 2016

Add regression tests & mention closed issues
    close sympy/sympy#3112 (MrvAsympt was added in diofant#6)
    close sympy/sympy#9173 (test was added in 5a510ac)
    close sympy/sympy#9808 (fixed in 09e539b)
    close sympy/sympy#9341 (fixed in af98a00)
    close sympy/sympy#9908 (fixed in cc3fa8d)
    close sympy/sympy#6171 (test added in d278031)
    close sympy/sympy#9276 (diagnose_imports.py removed in ab8c535)
    close sympy/sympy#10201 (fixed in 0d0fc5f)
    close sympy/sympy#9057 (test was added in 8290a0c)
    close sympy/sympy#11159 (test was added in ffb76cb)
    close sympy/sympy#2839 (new AST transformers are used, see diofant#278 and diofant#167)
    close sympy/sympy#11081 (see ed01e16 and bb92329)
    close sympy/sympy#10974 (see 73fc425)
    close sympy/sympy#10806 (test in 539929a)
    close sympy/sympy#10801 (test in 2fe3da5)
    close sympy/sympy#9549 (test in 88bdefa)
    close sympy/sympy#4231 (test was added in fb411d5)
    close sympy/sympy#8634 (see 2fcbb58)
    close sympy/sympy#8481 (see 1ef20d3)
    close sympy/sympy#9956 (fixed in a34735f)
    close sympy/sympy#9747 (see e117c60)
    close sympy/sympy#7853 (see 3e4fbed)
    close sympy/sympy#9634 (see 2be03f5)
    close sympy/sympy#8500 (fixed in diofant#104 and finally in diofant#316)
    close sympy/sympy#9192 (see 9bf622f)
    close sympy/sympy#7130 (see e068fa3)
    close sympy/sympy#8514 (see b2d543b)
    close sympy/sympy#9334 (see 90de625)
    close sympy/sympy#8229 (see 9755b89)
    close sympy/sympy#8061 (see 7054f06)
    close sympy/sympy#7872 (tested in diofant#6)
    close sympy/sympy#3496 (tested in test_log_symbolic)
    close sympy/sympy#2929 (see da7db7a)
    close sympy/sympy#8203 (oo is not a real, see diofant#36)
    close sympy/sympy#7649 (0 is imaginary since diofant#8)
    close sympy/sympy#7256 (fixed in c0a4549)
    close sympy/sympy#6783 (see cb28d63)
    close sympy/sympy#5662 (is_integer issue fixed in 6bfa9f8, there is no is_bounded anymore)
    close sympy/sympy#5295 (fixed with diofant#354)
    close sympy/sympy#4856 (we now have flake/pep tests)
    close sympy/sympy#4555 (flake8 enabled after diofant#214)
    close sympy/sympy#5773 (cmp_to_key removed after diofant#164 and c9acbf0)
    close sympy/sympy#5484 (see above)

    Added regression tests:
    from https://groups.google.com/forum/#!topic/sympy/LkTMQKC_BOw
    fixes sympy/sympy#8825 (probably via diofant#209)
    fixes sympy/sympy#8635
    fixes sympy/sympy#8157
    fixes sympy/sympy#7872
    fixes sympy/sympy#7599
    fixes sympy/sympy#6179
    fixes sympy/sympy#5415
    fixes sympy/sympy#2865
    fixes sympy/sympy#5907
    fixes sympy/sympy#11722

    Closes diofant#347

skirpichev added a commit to skirpichev/diofant that referenced this issue Nov 2, 2016

Add regression tests & mention closed issues
    close sympy/sympy#3112 (MrvAsympt was added in diofant#6)
    close sympy/sympy#9173 (test was added in 5a510ac)
    close sympy/sympy#9808 (fixed in 09e539b)
    close sympy/sympy#9341 (fixed in af98a00)
    close sympy/sympy#9908 (fixed in cc3fa8d)
    close sympy/sympy#6171 (test added in d278031)
    close sympy/sympy#9276 (diagnose_imports.py removed in ab8c535)
    close sympy/sympy#10201 (fixed in 0d0fc5f)
    close sympy/sympy#9057 (test was added in 8290a0c)
    close sympy/sympy#11159 (test was added in ffb76cb)
    close sympy/sympy#2839 (new AST transformers are used, see diofant#278 and diofant#167)
    close sympy/sympy#11081 (see ed01e16 and bb92329)
    close sympy/sympy#10974 (see 73fc425)
    close sympy/sympy#10806 (test in 539929a)
    close sympy/sympy#10801 (test in 2fe3da5)
    close sympy/sympy#9549 (test in 88bdefa)
    close sympy/sympy#4231 (test was added in fb411d5)
    close sympy/sympy#8634 (see 2fcbb58)
    close sympy/sympy#8481 (see 1ef20d3)
    close sympy/sympy#9956 (fixed in a34735f)
    close sympy/sympy#9747 (see e117c60)
    close sympy/sympy#7853 (see 3e4fbed)
    close sympy/sympy#9634 (see 2be03f5)
    close sympy/sympy#8500 (fixed in diofant#104 and finally in diofant#316)
    close sympy/sympy#9192 (see 9bf622f)
    close sympy/sympy#7130 (see e068fa3)
    close sympy/sympy#8514 (see b2d543b)
    close sympy/sympy#9334 (see 90de625)
    close sympy/sympy#8229 (see 9755b89)
    close sympy/sympy#8061 (see 7054f06)
    close sympy/sympy#7872 (tested in diofant#6)
    close sympy/sympy#3496 (tested in test_log_symbolic)
    close sympy/sympy#2929 (see da7db7a)
    close sympy/sympy#8203 (oo is not a real, see diofant#36)
    close sympy/sympy#7649 (0 is imaginary since diofant#8)
    close sympy/sympy#7256 (fixed in c0a4549)
    close sympy/sympy#6783 (see cb28d63)
    close sympy/sympy#5662 (is_integer issue fixed in 6bfa9f8, there is no is_bounded anymore)
    close sympy/sympy#5295 (fixed with diofant#354)
    close sympy/sympy#4856 (we now have flake/pep tests)
    close sympy/sympy#4555 (flake8 enabled after diofant#214)
    close sympy/sympy#5773 (cmp_to_key removed after diofant#164 and c9acbf0)
    close sympy/sympy#5484 (see above)

    Added regression tests:
    from https://groups.google.com/forum/#!topic/sympy/LkTMQKC_BOw
    fixes sympy/sympy#8825 (probably via diofant#209)
    fixes sympy/sympy#8635
    fixes sympy/sympy#8157
    fixes sympy/sympy#7872
    fixes sympy/sympy#7599
    fixes sympy/sympy#6179
    fixes sympy/sympy#5415
    fixes sympy/sympy#2865
    fixes sympy/sympy#5907
    fixes sympy/sympy#11722

    Closes diofant#347
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment