MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Strange behaviour of Simplify

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79086] Re: Strange behaviour of Simplify
  • From: Andreas Maier <andimai at web.de>
  • Date: Wed, 18 Jul 2007 02:56:52 -0400 (EDT)
  • References: <200707150514.BAA08789@smc.vnet.net><f7f25j$muj$1@smc.vnet.net>

On Jul 16, 8:10 am, Andrzej Kozlowski <a... at mimuw.edu.pl> wrote:
> On 15 Jul 2007, at 14:14, Andreas Maier wrote:
>
>
>
> > Hi,
>
> > i'm trying to simplify the following expression
>
> > In:= gamma=c Sqrt[g00])/Sqrt[c^2 g00 + g11 v^2]
> > In:=LeafCount[gamma]
> > Out:=52
>
> > using Simplify
>
> > In:= gamma2=Simplify[gamma, {Sqrt[g00] > 0, c > 0 }]
>
> > Out:=c/Sqrt[c^2 + (g11 v^2)/g00]
> > In:=LeafCount[gamma2]
> > Out:=44
>
> > Why is Mathematica (I'm using V6.0) able to cancel Sqrt[g00], but is
> > not
> > able to cancel c? I also tried ComplexityFunction->LeafCount, which
> > should work, because
>
> > In:=gamma3=1/Sqrt[1 + (g11 v^2)/(c^2 g00)]
> > In:=LeafCount[gamma3]
> > Out:=43
>
> > the LeafCount of gamma3 is smaller than gamma2, but it doesn' work.
> > Can anybody tell me, how i can transform gamma to gamma3 in
> > Mathematica?
>
> > Andreas Maier
>
> There is nothing strange about this behaviour. Simplify only uses
> certain specified transformation functions and applies certain
> sequences of them (such that the complexity does not increase at any
> step) but there is no such sequence of functions that would do what
> you want, because any such sequence would have to temporarily inrease
> the complexity of the expression. Rather than spend time and energy
> on trying to find a suitable mix of TransformationFunctions and a
> ComplexityFunction that would produce the result you want, it is much
> simpler to use replacement rules or a combination of replacement
> rules and Simplify, like this:
>
> Simplify[gamma /. c -> Sqrt[t], {Sqrt[g00] > 0, t > 0}] /. t -> c^2
>
> 1/Sqrt[(g11*v^2)/(c^2*g00) + 1]
>
> Andrzej Kozlowski

Actually i figured that out by myself just before i read your message.
But thank you anyway.
Still i think this solution is not a very elegant one, since it
involves a lot of guess work
(Although in this case it was suggestive to try to substitute with a
Sqrt[], but in general this might not be the case).
Is there no possibility in Mathematica to manually move out certain
factors from the enumerator and
denominator and then let Simplify cancel these factors? I understand
that Simplify cannot do transformations
that temporarily generate a higher LeafCount, but it would be nice, if
i could generate these expressions manually
to give a new starting point for Simplify, so it can find expressions
with an even lower LeafCount.

Andreas Maier




  • Prev by Date: Re: GammaDistribution versus PoissonDistribution
  • Next by Date: two new surfaces
  • Previous by thread: Re: Strange behaviour of Simplify
  • Next by thread: Re: Re: Strange behaviour of Simplify