Question: How to "flip" equations for use in subs and algsubs?

I often run into this problem. Say I have defined a new variable in terms of some old variables:

     Eq1 := NewVar = OldVar1 + OldVar2

Then suppose I have an expression in terms of the old variables:

     Eq2 := OldVar6 * OldVar5 = OldVar3 * (OldVar1 + OldVar2)

If I want to substitute Eq1 into Eq2 I have to either type

     subs(OldVar1 + OldVar2 = NewVar1, Eq2)

or I can do this

     SubsEq := rhs(Eq1) = lhs(Eq1)

     subs(SubsEq, Eq2)

It would be nice if I could easily flip an equation (or set or list of equations) something like this:

     subs(FlipEqs(Eq1), Eq2)

Is there any way to do this easily in Maple? It seems to me that such an "equation flipping" function would be extremely useful.

Thanks,

Neill

Please Wait...