Re: How to get an optimal simplification?

*To*: mathgroup at smc.vnet.net*Subject*: [mg89465] Re: How to get an optimal simplification?*From*: yaqi <yaqiwang at gmail.com>*Date*: Tue, 10 Jun 2008 03:41:18 -0400 (EDT)*References*: <g2iir2$rj5$1@smc.vnet.net> <g2j078$528$1@smc.vnet.net>

On Jun 9, 5:21 am, Jean-Marc Gulliet <jeanmarc.gull... at gmail.com> wrote: > yaqi wrote: > > I expected to get: > > {t1,t2,t3} > > > with the expression: > > Simplify[{a - b, b - c, c - a}, {t1 == a - b, t2 == b - c, t= 3 == c - > > a}] > > > But I only get {-t2-t3,t2,t3}, which is a little bit annoying. > > > I know I can do the simplifications separately like, > > Simplify[Simplify[Simplify[{a - b, b - c, c - a}, t1 == a - b], = t2 > > == b - c], t3 == c - a] > > > But I still like to get the optimal result with one simplify > > operation. > > > Is there an answer? (the answer is useful for one of my big > > derivations.) > > I am not sure if the following will apply straightforwardly to your > bigger expressions, but you could use a list of rules with the > *ReplaceRepeated[]* operator (short cut //. double-forward slash and > period, though in your example *ReplaceAll[]* is enough) or compute a > *GroebnerBasis[]* for the variables t1, t2, t3, and eliminating a, b, > and c. For instance, > > In[1]:= {a - b, b - c, c - a} //. {a - b -> t1, b - c -> t2, > c - a -> t3} > > Out[1]= {t1, t2, t3} > > In[2]:= GroebnerBasis[{a - b, b - c, c - a, t1 - a + b, t2 - b + c, > t3 - c + a}, {t1, t2, t3}, {a, b, c}] > > Out[2]= {t3, t2, t1} > > Regards, > -- Jean-Marc- Hide quoted text - > > - Show quoted text - 'Replace' is not the way I want, because it can only replace the terms that exactly match the expression. For example, { b - a, b - c, c - a} /. {a - b -> t1, b - c -> t2, c - a -> t3} does not work. I am guessing that 'Simplify' is trying to simplify the equation with conditions one-by-one but not simutaneously. Acturally what I am doing is to integrate a function on an arbitrary triangle with coordinates of three vertices, I am expecting to get a formula with something like triangle area, surface-volume ratio, etc. The function could be very complicated. Regards,

**Follow-Ups**:**Re: Re: How to get an optimal simplification?***From:*Andrzej Kozlowski <akoz@mimuw.edu.pl>