Re: Re: Simplifying constants...bug?

• To: mathgroup at smc.vnet.net
• Subject: [mg18590] Re: [mg18559] Re: [mg18489] Simplifying constants...bug?
• From: "Carl K.Woll" <carlw at fermi.phys.washington.edu>
• Date: Tue, 13 Jul 1999 01:01:25 -0400
• Organization: Department of Physics
• References: <7m3l22\$shp@smc.vnet.net> <199907100618.CAA03008@smc.vnet.net.>
• Sender: owner-wri-mathgroup at wolfram.com

```Alan,

A tip for unraveling unexpected behavior: Look at the FullForm of an
expression. In your case we find

In[53]:=
(a + c*d)/(c*d)//FullForm
Out[53]//FullForm=
Times[Power[c, -1], Power[d, -1], Plus[a, Times[c, d]]]

So, we see that the c*d in the denominator has turned into c^-1 * d^-1. Hence,
when the rule

c*d->-z

is applied, the denominator is left unaffected. You might try using a rule
like

c -> - z/d

Carl Woll
Dept of Physics
U of Washington

calvitti at boes.ces.cwru.edu wrote:

> here's some intersting behavior in 3.0:
>
>     (a + c*d)/(b + c*d) //. c*d -> -z
>
> gives (as expected):
>
>     (a - z)/(b - z)
>
> yet
>
>     (a + c*d)/(c*d) //. c*d -> -z
>
> no longer simplifes the denominator:
>
>     (a+b-z)/(c*d)
>
> anyone know why?
>
> +------------------------------------------+
>   alan c
>   systems and control engineering
>   case western reserve university
>
>   calvitti at alpha.ces.cwru.edu
> +------------------------------------------+
>
> "Ersek, Ted R" <ErsekTR at navair.navy.mil> writes:
>
> > Morten G. Dyndgaard wrote:
> > -----------------------------
> > I am working with some annoyingly long equations that I want to simplify
> > by including one set of parameters in a constant (or function) A, and
> > another in B and so on.
> >
> > You can easily do:
> > A = b+c+d+e
> >
> > but what I want to do is the reverse:
> > b+c+d+e = A
> > -----------------------------
> >
> > This should help.
> > In[1]:=
> > expr=a+b+b1+c+c1+d+d1+e;
> >
> >
> > In[2]:=
> > expr/.a+b+c+d+e->A
> >
> > Out[2]=
> > A+b1+c1+d1
> >
> >
> > Regards,
> > Ted Ersek

```

• Prev by Date: Re: Re: Simplifying constants...bug?
• Next by Date: Re: Re: RE: Re: Re: easiest way to sort a list?
• Previous by thread: Re: Re: Simplifying constants...bug?
• Next by thread: Re: Re: Simplifying constants...bug?