Comment #4 on issue 3152 by [email protected]: Integration of
(x**3)**(-Rational(1,3)) raises CoeffExpValueError
http://code.google.com/p/sympy/issues/detail?id=3152
This also happens with the integral from
http://stackoverflow.com/q/16463027/161801
In [30]: function =
1.55572382686041*(1.5263628489853e-9*x**(-1)*sin(10.9175359259421*pi
-0.0301592300440543*pi*x)*sin(t)*x -
17456139.8613791*x**(-1)*sin(10.9175359259421*pi -
0.0301592300440543*pi*x)*cos(t)*x +
9401.13817429496*pi*cos(10.9175359259421*pi -
0.0301592300440543*pi*x)*cos(t)*x)*x**(-1)*cos(32.7526077778264*pi -
0.0904776901321629*pi*x)*cos(t) +
(1162050.0*x**(-1)*sin(10.9175359259421*pi -
0.0301592300440543*pi*x)*sin(t)*x -
9.81127127213595e-10*x**(-1)*sin(10.9175359259421*pi -
0.0301592300440543*pi*x)*cos(t)*x +
3.43953078983083e-13*pi*cos(10.9175359259421*pi -
0.0301592300440543*pi*x)*cos(t)*x)*(-1.0*x**(-1)*cos(32.7526077778264*pi -
0.0904776901321629*pi*x)*sin(t) +
0.0904776901321629*pi*sin(32.7526077778264*pi -
0.0904776901321629*pi*x)*sin(t))
In [31]: expand(function).integrate( (x,362.,395.154), (t,0,2*pi) )
---------------------------------------------------------------------------
_CoeffExpValueError Traceback (most recent call last)
<ipython-input-31-12510b407875> in <module>()
----> 1 expand(function).integrate( (x,362.,395.154), (t,0,2*pi) )
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/expr.pyc in
integrate(self, *args, **kwargs)
2836 """See the integrate function in sympy.integrals"""
2837 from sympy.integrals import integrate
-> 2838 return integrate(self, *args, **kwargs)
2839
2840 def simplify(self, ratio=1.7, measure=None):
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/utilities/decorator.pyc
in
threaded_func(expr, *args, **kwargs)
28 func(expr.rhs, *args,
**kwargs))
29 else:
---> 30 return func(expr, *args, **kwargs)
31
32 return threaded_func
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/integrals.pyc
in
integrate(*args, **kwargs)
1578
1579 if isinstance(integral, Integral):
-> 1580 return integral.doit(deep=False, meijerg=meijerg,
conds=conds, risch=risch)
1581 else:
1582 return integral
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/integrals.pyc
in
doit(self, **hints)
885 antideriv = None
886 else:
--> 887 antideriv = self._eval_integral(function, xab[0],
meijerg=meijerg1, risch=risch)
888 if antideriv is None and meijerg1 is True:
889 ret = try_meijerg(function, xab)
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/integrals.pyc
in
_eval_integral(self, f, x, meijerg, risch)
1241 # rewrite using G functions
1242 try:
-> 1243 h = meijerint_indefinite(g, x)
1244 except NotImplementedError:
1245 from sympy.integrals.meijerint import _debug
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/meijerint.pyc
in
meijerint_indefinite(f, x)
1587 results = []
1588 for a in list(_find_splitting_points(f, x)) + [S(0)]:
-> 1589 res = _meijerint_indefinite_1(f.subs(x, x + a), x)
1590 if res is None:
1591 continue
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/meijerint.pyc
in
_meijerint_indefinite_1(f, x)
1602 _debug('Trying to compute the indefinite integral of',
f, 'wrt', x)
1603
-> 1604 gs = _rewrite1(f, x)
1605 if gs is None:
1606 # Note: the code that calls us will do expand() and try
again
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/meijerint.pyc
in
_rewrite1(f, x, recursive)
1539 """
1540 fac, po, g = _split_mul(f, x)
-> 1541 g = _rewrite_single(g, x, recursive)
1542 if g:
1543 return fac, po, g[0], g[1]
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/cache.pyc in
wrapper(*args, **kw_args)
90 except KeyError:
91 pass
---> 92 func_cache_it_cache[k] = r = func(*args, **kw_args)
93 return r
94 return wrapper
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/meijerint.pyc
in
_rewrite_single(f, x, recursive)
1494 try:
1495 F, strip, _ = mellin_transform(f, x, s,
integrator=my_integrator,
-> 1496 simplify=False,
needeval=True)
1497 g = my_imt(F, s, x, strip)
1498 except IntegralTransformError:
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/transforms.pyc
in
mellin_transform(f, x, s, **hints)
347 hankel_transform, inverse_hankel_transform
348 """
--> 349 return MellinTransform(f, x, s).doit(**hints)
350
351
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/transforms.pyc
in
doit(self, **hints)
112 try:
113 return self._compute_transform(self.function,
--> 114 self.function_variable,
self.transform_variable, **hints)
115 except IntegralTransformError:
116 pass
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/transforms.pyc
in
_compute_transform(self, f, x, s, **hints)
289
290 def _compute_transform(self, f, x, s, **hints):
--> 291 return _mellin_transform(f, x, s, **hints)
292
293 def _as_integral(self, f, x, s):
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/transforms.pyc
in
wrapper(*args, **kwargs)
190 def wrapper(*args, **kwargs):
191 noconds = kwargs.pop('noconds', default)
--> 192 res = func(*args, **kwargs)
193 if noconds:
194 return res[0]
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/transforms.pyc
in
_mellin_transform(f, x, s_, integrator, simplify)
214 # convergence of the integral.
215 s = _dummy('s', 'mellin-transform', f)
--> 216 F = integrator(x**(s - 1) * f, x)
217
218 if not F.has(Integral):
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/meijerint.pyc
in
my_integrator(f, x)
1485 def my_integrator(f, x):
1486 from sympy import Integral, hyperexpand
-> 1487 r = _meijerint_definite_4(f, x, only_double=True)
1488 if r is not None:
1489 res, cond = r
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/meijerint.pyc
in
_meijerint_definite_4(f, x, only_double)
1911
1912 # Try two G functions.
-> 1913 gs = _rewrite2(f, x)
1914 if gs is not None:
1915 for full_pb in [False, True]:
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/meijerint.pyc
in
_rewrite2(f, x)
1553 """
1554 fac, po, g = _split_mul(f, x)
-> 1555 if any(_rewrite_single(expr, x, False) is None for expr in
_mul_args(g)):
1556 return None
1557 l = _mul_as_two_parts(g)
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/meijerint.pyc
in
<genexpr>((expr,))
1553 """
1554 fac, po, g = _split_mul(f, x)
-> 1555 if any(_rewrite_single(expr, x, False) is None for expr in
_mul_args(g)):
1556 return None
1557 l = _mul_as_two_parts(g)
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/cache.pyc in
wrapper(*args, **kw_args)
90 except KeyError:
91 pass
---> 92 func_cache_it_cache[k] = r = func(*args, **kw_args)
93 return r
94 return wrapper
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/meijerint.pyc
in
_rewrite_single(f, x, recursive)
1445 for fac, g in terms:
1446 r1 =
_get_coeff_exp(unpolarify(fac.subs(subs).subs(z, x),
-> 1447
exponents_only=True), x)
1448 g = g.subs(subs).subs(z, x)
1449 # NOTE these substitutions can in principle
introduce oo,
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/meijerint.pyc
in
_get_coeff_exp(expr, x)
308 return c, S(1)
309 else:
--> 310 raise _CoeffExpValueError('expr not of form a*x**b: %s' %
expr)
311
312
_CoeffExpValueError: expr not of form a*x**b: 0.00276245759561829
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.