Alex Rivera | Logout

Get mathematica to simplify expression with another equation

Asked 2011-11-10T00:15:00.120
20

I have a very complicated mathematica expression that I'd like to simplify by using a new, possibly dimensionless parameter.

An example of my expression is:

K=a*b*t/((t+f)c*d);

(the actual expression is monstrously large, thousands of characters). I'd like to replace all occurrences of the expression t/(t+f) with p

p=t/(t+f);

The goal here is to find a replacement so that all t's and f's are replaced by p. In this case, the replacement p is a nondimensionalized parameter, so it seems like a good candidate replacement.

I've not been able to figure out how to do this in mathematica (or if its possible). I tried:

eq1= K==a*b*t/((t+f)c*d);
eq2= p==t/(t+f);
Solve[{eq1,eq2},K]

Not surprisingly, this doesn't work. If there were a way to force it to solve for K in terms of p,a,b,c,d, this might work, but I can't figure out how to do that either. Thoughts?


Edit #1 (11/10/11 - 1:30) [deleted to simplify]

OK, new tact. I've taken p=ton/(ton+toff) and multiplied p by several expressions. I know that p can be completely eliminated. The new expression (in terms of p) is

testEQ = A B p + A^2 B p^2 + (A+B)p^3;

Then I made the substitution for p, and called (normal) FullSimplify, giving me this expression.

testEQ2= (ton (B ton^2 + A^2 B ton (toff + ton) + 
   A (ton^2 + B (toff + ton)^2)))/(toff + ton)^3;

Finally, I tried all of the suggestions below, except the last (not sure how it works yet!)

Only the eliminate option worked. So I guess I'll try this method from now on. Thank you.

EQ1 = a1 == (ton (B ton^2 + A^2 B ton (toff + ton) + 
        A (ton^2 + B (toff + ton)^2)))/(toff + ton)^3;
EQ2 = P1 == ton/(ton + toff);
Eliminate[{EQ1, EQ2}, {ton, toff}]

A B P1 + A^2 B P1^2 + (A + B) P1^3 == a1

I should add, if the goal is

Edit
Report

1 Answer

9
K = a*b*t/((t+f)c*d);

FullSimplify[ K, 
 TransformationFunctions -> {(# /. t/(t + f) -> p &), Automatic}]
(a b p) / (c d)

Corrected update to show another method:

EQ1 = a1 == (ton (B ton^2 + A^2 B ton (toff + ton) + 
        A (ton^2 + B (toff + ton)^2)))/(toff + ton)^3;

f = # /. ton + toff -> ton/p &;

FullSimplify[f @ EQ1]
a1 == p (A B + A^2 B p + (A + B) p^2)

I don't know if this is of any value at this point, but hopefully at least it works.

answered 2011-11-10T10:25:01.890

Your Answer