Unfortunately, it doesn't work that way. See http://code.google.com/p/sympy/issues/detail?id=1932.
It should not be hard to make your own class (even a subclass of Equation) that this does work for. Or you could just manually use Eq(eq1.lhs - eq2.lhs, eq1.rhs - eq2.rhs). Aaron Meurer On Wed, Feb 13, 2013 at 10:03 PM, G B <[email protected]> wrote: > Sorry if this is covered in the documentation somewhere, I tried to check... > > Is there a way to subtract one equation from another? What I'm looking to > do boils down to: > a,b,r,s=symbols('a,b,r,s') > eq1=Eq(a,r) #a==r > eq2=Eq(b,s) #b==s > eq3=eq1-eq2 > > I'd very much like eq3 to be: > a-b==r-s > > In effect, I'm trying to step through equation manipulations, but > selectively under my control. > > Thanks-- > Greg > > -- > You received this message because you are subscribed to the Google Groups > "sympy" 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?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "sympy" 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
