1
$\begingroup$

Hi am a student in chemical engineering and I have the necessity to rearrange formulas algebraically, for example

 Cco[t] == (Exp^(-((t v0)/V))*(-Fcoa + Exp^((t*v0)/V) Fcoa - 
             Fcos + Exp^((t*v0)/V) Fcos + CCo0 v0))/v0

I have to find the expression for t... It is a simple algebraic manipulation that I can do manually.. How is it possible to do this with mathematica? Thanks a lot

$\endgroup$
3
  • $\begingroup$ could you try to use mathematica syntax? $\endgroup$
    – george2079
    Commented Feb 16, 2014 at 21:26
  • $\begingroup$ You probably meant E^... (not that this changes a iota about the difficulty of reproducing elementary simplifications in Mathematica) $\endgroup$
    – Peltio
    Commented Feb 16, 2014 at 21:26
  • 2
    $\begingroup$ A duplicate of that question? Seriously? $\endgroup$
    – Peltio
    Commented Feb 17, 2014 at 0:50

1 Answer 1

4
$\begingroup$

During the years I developed this peculiar idea that that best way to use Mathematica is to use it to the least possible extent. Hence, if you can do a simplification by hand, do it by hand.

The problem with Mathematica is that that software is sometimes too smart - or too dumb, depending on the point of view. Some behaviors of MMA that stand in the way of performing 'trivial simplifications' are:

  1. MMA considers the most general case of a complex variable, while in doing a simplification by hand, one can make- almost without realizing it - the most relevant assumptions. Assuming and Assumputions can help MMA see "the obvious" when it fails to produce the expect result.
  2. MMA does not know physics, nor chemistry. Hence it might not be able to select, for example, only the real or the real and positive solution when there are multiple solutions.
  3. MMA does not have a semantic pattern matching, meaning that you might end up specifying a pattern that do not correspond to the internal representation of what you see in your initial equation. Roots,complex and fractional expressions are unexpectedly hard to match.

All that said, sometimes you might want to reproduce the steps of a resolution 'by hand'. In that case, you can make Mathematica less smart by hiding part of the expression. Let's start from your expression just like you typed (even if you probably meant E instead of Exp)

Cco[t] == (Exp^(-((t v0)/V))*(-Fcoa + Exp^((t*v0)/V) Fcoa - Fcos + Exp^((t*v0)/V) Fcos + CCo0 v0))/v0

We can work on the right hand side to avoid carrying along the equation sign.

Expand[(Exp^(-((t v0)/V))*(-Fcoa + Exp^((t*v0)/V) Fcoa - Fcos + Exp^((
        t*v0)/V) Fcos + CCo0 v0))/v0]

we get and expression that only has Exp^(-((t v0)/V)) terms. We can collect them using Collect, like this

Collect[%, Exp^(-((t v0)/V))]

Then, we can go back to the equation, by adding ==Cco. Only, it is better to replace the exponential with a dummy variable, let's call it x.

% == Cco /. Exp^(-((t v0)/V)) -> x

If we solve for x and then equate the solution to Exp^(-((t v0)/V)) we can finally solve for t

Exp^(-((t v0)/V)) == x /. First[Solve[%,x]]

Solve[%, t]

And there you have it. Personally, I prefer pencil and paper.

$\endgroup$
0

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