2
$\begingroup$

Basically I want to reduce something like:

Subscript[P, 4] - Subscript[P, 5] == Subscript[R, 4, 5]* Subscript[i, 4, 5]

when only one of them is known (Subscript[R, 4, 5] == 1), so that Mathematica expresses the simplified form as:

Subscript[i, 4, 5] + Subscript[P, 5] - Subscript[P, 4] == 0
$\endgroup$
  • $\begingroup$ Have a look at Reduce. $\endgroup$ – b.gates.you.know.what Oct 25 '12 at 9:29
  • $\begingroup$ Yeah I tried that... But how can you tell it to reduce so you have constants on one side ? $\endgroup$ – TehHO Oct 25 '12 at 9:30
  • 1
    $\begingroup$ Perhaps this is what you are looking for? Is is possible to have mathematica move all terms to one side of an equation? $\endgroup$ – Michael Wijaya Oct 25 '12 at 9:34
  • $\begingroup$ Yeah, but I also have some expressions which equal 1, and I do not want that moved over setting everything to equal zero... Basically I want all unknown on one side. And all that's known (defined) on the other side.. $\endgroup$ – TehHO Oct 25 '12 at 9:39
  • $\begingroup$ So you have a - b == c * d and your only known variable is c. Then, according to your last comment, the output should be: (a - b)/d == c. That is what you are looking for? $\endgroup$ – István Zachar Oct 25 '12 at 9:48
1
$\begingroup$

I think you are looking for Replace:

p4 - p5 == r45 i45 /. r45 -> 1
(* p4 - p5 == i45 *)

% /. lhs_ == rhs__ -> rhs - lhs == 0
(* i45 + p5 - p4 == 0 *)
$\endgroup$
  • $\begingroup$ (probably the question should have been closed?) $\endgroup$ – djp Mar 3 '15 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.