Status: Accepted
Owner: ----
Labels: Type-Defect Priority-Medium Series WrongResult
New issue 3137 by [email protected]: Series of ((N - 1)**D)/(N**D - 1)
fails
http://code.google.com/p/sympy/issues/detail?id=3137
Another simple issue:
In [40]: D = Symbol("D")
In [41]: N = Symbol("N")
In [42]: series(((N - 1)**D)/(N**D - 1), x=N)
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
/home/raoul/<ipython-input-42-d60de52f725c> in <module>()
----> 1 series(((N - 1)**D)/(N**D - 1), x=N)
/home/raoul/python/sympy/series/series.pyc in series(expr, x, x0, n, dir)
6 """
7 expr = sympify(expr)
----> 8 return expr.series(x, x0, n, dir)
/home/raoul/python/sympy/core/expr.pyc in series(self, x, x0, n, dir)
2216 if newn != ngot:
2217 ndo = n + (n - ngot)*more/(newn - ngot)
-> 2218 s1 = self._eval_nseries(x, n=ndo,
logx=None)
2219 # if this assertion fails then our ndo
calculation
2220 # needs modification
/home/raoul/python/sympy/core/mul.pyc in _eval_nseries(self, x, n, logx)
1354 def _eval_nseries(self, x, n, logx):
1355 from sympy import powsimp
-> 1356 terms = [t.nseries(x, n=n, logx=logx) for t in self.args]
1357 return powsimp(Mul(*terms).expand(), combine='exp',
deep=True)
1358
/home/raoul/python/sympy/core/expr.pyc in nseries(self, x, x0, n, dir, logx)
2343 return self.series(x, x0, n, dir)
2344 else:
-> 2345 return self._eval_nseries(x, n=n, logx=logx)
2346
2347 def _eval_nseries(self, x, n, logx):
/home/raoul/python/sympy/core/power.pyc in _eval_nseries(self, x, n, logx)
757 # so we need to rewrite base to the form "1+x"
758
--> 759 b = b._eval_nseries(x, n=n, logx=logx)
760 prefactor = b.as_leading_term(x)
761 # express "rest" as: rest = 1 + k*x**l + ... +
O(x**n)
/home/raoul/python/sympy/core/add.pyc in _eval_nseries(self, x, n, logx)
322
323 def _eval_nseries(self, x, n, logx):
--> 324 terms = [t.nseries(x, n=n, logx=logx) for t in self.args]
325 return Add(*terms)
326
/home/raoul/python/sympy/core/expr.pyc in nseries(self, x, x0, n, dir, logx)
2343 return self.series(x, x0, n, dir)
2344 else:
-> 2345 return self._eval_nseries(x, n=n, logx=logx)
2346
2347 def _eval_nseries(self, x, n, logx):
/home/raoul/python/sympy/core/power.pyc in _eval_nseries(self, x, n, logx)
806
807 if e.has(Symbol):
--> 808 return exp(e*log(b))._eval_nseries(x, n=n, logx=logx)
809
810 if b == x:
/home/raoul/python/sympy/functions/elementary/exponential.pyc in
_eval_nseries(self, x, n, logx)
376 exp_series = exp_series.removeO()
377 r = exp(arg0)*exp_series.subs(t, arg_series - arg0)
--> 378 r += C.Order(o.expr.subs(t, (arg_series - arg0)), x)
379 r = r.expand()
380 return powsimp(r, deep=True, combine='exp')
/home/raoul/python/sympy/core/cache.pyc in wrapper(*args, **kw_args)
89 except KeyError:
90 pass
---> 91 func_cache_it_cache[k] = r = func(*args, **kw_args)
92 return r
93 return wrapper
/home/raoul/python/sympy/series/order.pyc in __new__(cls, expr, *symbols,
**assumptions)
129 expr = expr.as_leading_term(*symbols)
130 else:
--> 131 expr = expr.compute_leading_term(symbols[0])
132 terms = expr.as_coeff_mul(*symbols)[1]
133 s = set(symbols)
/home/raoul/python/sympy/core/expr.pyc in compute_leading_term(self, x,
skip_abs, logx)
2385 if logx is None:
2386 d = C.Dummy('logx')
-> 2387 s = calculate_series(self, x, skip_abs, d).subs(d,
C.log(x))
2388 else:
2389 s = calculate_series(self, x, skip_abs, logx)
/home/raoul/python/sympy/series/gruntz.pyc in calculate_series(e, x,
skip_abs, logx)
506 f = e
507 for n in [1, 2, 4, 6, 8, 16]:
--> 508 series = f.nseries(x, n=n, logx=logx)
509 if not series.has(O):
510 # The series expansion is locally exact.
/home/raoul/python/sympy/core/expr.pyc in nseries(self, x, x0, n, dir, logx)
2343 return self.series(x, x0, n, dir)
2344 else:
-> 2345 return self._eval_nseries(x, n=n, logx=logx)
2346
2347 def _eval_nseries(self, x, n, logx):
/home/raoul/python/sympy/core/power.pyc in _eval_nseries(self, x, n, logx)
780 l = l.evalf()
781 else:
--> 782 raise NotImplementedError()
783
784 terms = [1/prefactor]
NotImplementedError:
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.