Status: Accepted
Owner: asmeurer
Labels: Type-Defect Priority-Medium

New issue 1997 by asmeurer: Bug in dsolve() undetermined coefficients solver
http://code.google.com/p/sympy/issues/detail?id=1997

dsolve(f(x).diff(x, x) + f(x) - x*sin(x - 2), f(x), hint='nth_linear_constant_coeff_undetermined_coefficients')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sympy/solvers/ode.py", line 457, in dsolve
    match=hints[hint]), func, hints['order'], hint)
File "sympy/solvers/ode.py", line 2370, in ode_nth_linear_constant_coeff_undetermined_coefficients
    return _solve_undetermined_coefficients(eq, func, order, match)
File "sympy/solvers/ode.py", line 2460, in _solve_undetermined_coefficients " method of undetermined coefficients (unable to solve for coefficients).") NotImplementedError: Could not solve -x*sin(-2 + x) + D(f(x), x, x) + f(x) using the method of undetermined coefficients (unable to solve for coefficients).

As I was explaining to Chris on IRC, any time you explicitly pass a hint to dsolve() and it gives NotImplementedError, it means that there was a problem in the particular solver, so it is a bug (which is another reason why issue 1996 needs to be fixed).

I haven't looked into it yet, but if I had to guess, I would say it's because of the fishy behavior of sin(2 - x) vs. sin(x - 2).

--
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.

Reply via email to