MathGroup Archive 2008

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

Search the Archive

Re: Rearranging expressions in a user-defined form

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94129] Re: [mg94083] Rearranging expressions in a user-defined form
  • From: "David Park" <djmpark at comcast.net>
  • Date: Fri, 5 Dec 2008 05:33:39 -0500 (EST)
  • References: <24833256.1228395441799.JavaMail.root@m02>

I found a simpler method to do the first manipulation with the Presentations
MapLevelParts routine.

Needs["Presentations`Master`"]

HoldForm[a b + a c + c d + c a - g d - g a]
% // MapLevelParts[Factor, {1, {1, 2}}] // ReleaseHold
% // MapLevelParts[Factor, {{1, 3, 4, 5}}]
a b + a c + c d + c a - g d - g a
a c + a (b + c) + c d - a g - d g
a (b + c) + (a + d) (c - g)


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/ 



From: Alexei Boulbitch [mailto:Alexei.Boulbitch at iee.lu] 


Dear MathGroup,

in symbolic transformations of mathematical expressions I often need to 
group or transform differently different parts
of these expression, just to make them more visible , or more easy to 
analyze  or so.  Just to give a simplest  example, 
assume that we have  an expression:

expr = ab + ac + cd + ca- gd - ga

and I need to have it once in the form like say,

expr=a (b + c) + (c - g) (d + a)

and another time in the form say,

expr=a (b + 2 c - g) + d (c - g)

or I will need to group it in some third, fourth ... form. You indeed 
understand that I gave the example easily treatable without computer,
while I have in mind much more complex transformations of real interest.

This evidently may be done by copy-pasting parts of the expression in 
question and
transforming then separately and then again copy-pasting and thus, 
collecting the results together. That's exactly what I do in such a case.
However, this may easily become a source of errors: such as copying 
without a sign, or copying a part of the expression, rather than the 
whole one and so on.
Finally it considerably slows you down.

Could you think of tricks to instruct Mathematica to group only certain 
terms and not others, and to take certain
factors out of parentheses, while leave others, according to your choice?

Thank you, Alexei 






-- 
Alexei Boulbitch, Dr., Habil.
Senior Scientist

IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 Contern
Luxembourg

Phone: +352 2454 2566
Fax:   +352 2454 3566

Website: www.iee.lu

This e-mail may contain trade secrets or privileged, undisclosed or
otherwise confidential information. If you are not the intended recipient
and have received this e-mail in error, you are hereby notified that any
review, copying or distribution of it is strictly prohibited. Please inform
us immediately and destroy the original transmittal from your system. Thank
you for your co-operation.






  • Prev by Date: RE: A plot of Sign[x]
  • Next by Date: Re: How to substitute a function?
  • Previous by thread: Re: Rearranging expressions in a user-defined form
  • Next by thread: RE: Rearranging expressions in a user-defined form