0
$\begingroup$

Is there a way to coerce FullSimplify to group the second result (below) to be similar to the first result?

eqDa01 = fCond + fFwhdrain + fExtToDa == fFw;
eqDa02 = fCond hCond + fFwhdrain hFwhdrain + fExtToDa hExtToDa == fFw hFw;
solDa = Solve[{eqDa01, eqDa02}, {fCond, fExtToDa}][[1]] // FullSimplify;
eqDafCond = solDa[[1, 2]]
eqDafExtToDa = solDa[[2, 2]]  

Below are the results enter image description here

would like to see the second result to be something like the following, which is similar to the first result.

(fFw (hCond - hFw ) + fFwhdrain (hFwhdrain - hCond) ) (hCond - hExtToDa)

Note after changing the symbols to something less verbose, the results are still not consistently grouped:

eqDa01 = fa + fb + fc == fd;
eqDa02 = fa ha + fb hb + fc hc == fd hd;
solDa = Solve[{eqDa01, eqDa02}, {fa, fb}][[1]] // FullSimplify
eqDafCond = solDa[[1, 2]]
eqDafExtToDa = solDa[[2, 2]] 

enter image description here

Now for the first result, would like to see something like ( fc (hb - hc) + fd (hd - hb) ) / (ha - hb)

$\endgroup$
1
$\begingroup$
eqDa01 = fCond + fFwhdrain + fExtToDa == fFw;
eqDa02 = fCond hCond + fFwhdrain hFwhdrain + fExtToDa hExtToDa == fFw hFw;
solDa = Solve[{eqDa01, eqDa02}, {fCond, fExtToDa}][[1]] // FullSimplify;

eqDafCond = solDa[[1, 2]]

(* (fFw (-hExtToDa + hFw) + fFwhdrain (hExtToDa - hFwhdrain))/(hCond - hExtToDa) *)

For the second result use Collect on the numerator

eqDafExtToDa = MapAt[Collect[#, {fFw, fFwhdrain}] &, solDa[[2, 2]], 2]

(* (fFw (hCond - hFw) + fFwhdrain (-hCond + hFwhdrain))/(hCond - hExtToDa) *)

Verifying equivalence,

eqDafExtToDa == solDa[[2, 2]] // Simplify

(* True *)
$\endgroup$

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.