Comment #85 on issue 1598 by smichr: New polynomials manipulation module
http://code.google.com/p/sympy/issues/detail?id=1598

I'm running into a problem with trying to do a substitution in a RootOf instance:

eq = f(x).diff(x, 5) + 11*f(x).diff(x) - 2*f(x)
ans = dsolve(eq, f(x))
ans
f(x) == C1*exp(x*RootOf(_m**5 + 11*_m - 2, _m, domain='ZZ', index=0)) +
C2*exp(x*RootOf(_m**5 + 11*_m - 2, _m, domain='ZZ', index=1)) + C3*exp(x*RootOf(_m**5 + 11*_m - 2, _m, domain='ZZ', index=2)) + C4*exp(x*RootOf(_m**5 + 11*_m - 2, _m, domain='ZZ', index=3)) + C5*exp(x*RootOf(_m**5 + 11*_m - 2, _m, domain='ZZ', index=4))
def get_dummy(eq):
...     for ai in eq.atoms(Symbol):
...             if str(ai).startswith("_"):
...                     return ai
...             
got = get_dummy(ans)
got
_m
sympy.var('x')
x
ans.subs(got, x)
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
File "C:\Documents and Settings\chris\sympy\sympy\core\basic.py", line 1116, in subs
    return self._subs_old_new(old, new)
File "C:\Documents and Settings\chris\sympy\sympy\core\cache.py", line 85, in wrapper
    func_cache_it_cache[k] = r = func(*args, **kw_args)
File "C:\Documents and Settings\chris\sympy\sympy\core\basic.py", line 1125, in
_subs_old_new
    return self._eval_subs(old, new)
File "C:\Documents and Settings\chris\sympy\sympy\core\relational.py", line 136, in
_eval_subs
return self.__class__(self.lhs._eval_subs(old, new), self.rhs._eval_subs(old, new)) File "C:\Documents and Settings\chris\sympy\sympy\core\add.py", line 314, in _eval_subs
    return self.__class__(*[s._eval_subs(old, new) for s in self.args])
File "C:\Documents and Settings\chris\sympy\sympy\core\mul.py", line 937, in _eval_subs
    return self.__class__(*[s._eval_subs(old, new) for s in self.args])
  File "C:\Documents and
Settings\chris\sympy\sympy\functions\elementary\exponential.py", line 166, in _eval_subs
    return Function._eval_subs(self, old, new)
File "C:\Documents and Settings\chris\sympy\sympy\core\function.py", line 204, in
_eval_subs
    return Basic._seq_subs(self, old, new)
File "C:\Documents and Settings\chris\sympy\sympy\core\basic.py", line 1209, in
_seq_subs
    return self.func(*[s.subs(old, new) for s in args])
File "C:\Documents and Settings\chris\sympy\sympy\core\basic.py", line 1116, in subs
    return self._subs_old_new(old, new)
File "C:\Documents and Settings\chris\sympy\sympy\core\cache.py", line 85, in wrapper
    func_cache_it_cache[k] = r = func(*args, **kw_args)
File "C:\Documents and Settings\chris\sympy\sympy\core\basic.py", line 1125, in
_subs_old_new
    return self._eval_subs(old, new)
File "C:\Documents and Settings\chris\sympy\sympy\core\mul.py", line 937, in _eval_subs
    return self.__class__(*[s._eval_subs(old, new) for s in self.args])
File "C:\Documents and Settings\chris\sympy\sympy\core\basic.py", line 1131, in
_eval_subs
    return self.func(*[arg._eval_subs(old, new) for arg in self.args])
AttributeError: 'int' object has no attribute '_eval_subs'


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to