I have also noticed this with the same Wild variables:
>>> print (exp(x)*exp(y)).match(c*d)
{d_: exp(y), c_: exp(x)}
>>> print (exp(x)*exp(y)*y).match(c*d)
{d_: y*exp(y), c_: exp(x)}
>>> print (x*exp(x)*exp(y)*y).match(c*d)
None
I think that I may need to write my own function to do this if I can't
get this fixed.
And sorry for that empty post. My browser did that for some reason.
Aaron Meurer
On Jun 19, 6:42 pm, "Aaron S. Meurer" <[email protected]> wrote:
> I have been working on getting separable equations in dsolve, and I
> noticed this:
> >>> c = Wild('c', exclude=[y])
> >>> d = Wild('d', exclude=[x])
> >>> (x).match(c*d)
> {c: x, d: 1}
> >>> (log(x)).match(c*d)
> {c: log(x), d: 1}
> >>> (x*log(x)).match(c*d)
> <Returns None>
>
> I would like for the last one to return {c:x*log(x), d:1}. Presently,
> I don't *need* this to work, because there is a workaround I can use
> where I multiply the expression by x*y to ensure that it has x's and
> y's in it and then they cancel out. But this is kind of hacky, and,
> unless I am mistaken, this is not the expected behavior of match. I
> searched the issues and I didn't see it, unless I missed it.
>
> Aaron Meurer
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy" 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?hl=en
-~----------~----~----~----~------~----~------~--~---