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

New issue 1429 by asmeurer: matches fails to match differential equation
http://code.google.com/p/sympy/issues/detail?id=1429

See this thread:   
http://groups.google.com/group/sympy/browse_thread/thread/d1ca8352bcb187a8

>>> a = Wild('a', exclude=[f(x).diff(x)])
>>> b = Wild('b', exclude=[f(x).diff(x)])
>>> eq = x+f(x) - (x - f(x))*diff(f(x), x)
>>> r = eq.match(a+b*diff(f(x),x))

r is None.  I need it to be {a:x+f(x), b:-(x-f(x))}.  This works for other  
things similarly formatted, for example:

>>> eq1 = 2*x+f(x)*cos(x)+(2*f(x)+sin(x)-sin(f(x)))*f(x).diff(x)
>>> eq1.match(a+b*diff(f(x),x))
{a: 2⋅x + cos(x)⋅f(x), b: -sin(f(x)) + 2⋅f(x) + sin(x)}

Changing a to a Wild without exclusions sort of produces the right result.
>>> a = Wild('a')
>>> r = eq.match(a+b*diff(f(x),x))
>>> r
⎧                   d                     d                            ⎫
⎨a: x - (-x + f(x))⋅──(f(x)) - (x - f(x))⋅──(f(x)) + f(x), b: -x + f(x)⎬
⎩                   dx                    dx                           ⎭
>>> simplify r[a]
x + f(x)


--
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-issues@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