Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: Simple questions about Mathematica

  • To: mathgroup at
  • Subject: [mg31943] Re: Simple questions about Mathematica
  • From: uhap023 at (Tom Crane)
  • Date: Thu, 13 Dec 2001 01:08:50 -0500 (EST)
  • Organization: Dept. Physics, Royal Holloway, University of London
  • References: <9v25kb$lcs$>
  • Sender: owner-wri-mathgroup at

In article <9v25kb$lcs$1 at>, BobHanlon at writes:
> In a message dated 12/9/01 7:11:31 AM, stevebg at writes:
>>1. Suppose I solve some equations and get a complicated
>>expression containing multiple identical elements such as
>>sqrt(a^2+b^2). To make the expression smaller, clearer, and
>>easier to deal with, I want to substitute say R=sqrt(a^2+b^2)
>>everywhere in the main expression and have R available as
>>a symbol from then on. I see nothing in Help or anywhere
>>else about how to do this. But it's such a standard thing to
>>do that there must be an easy answer.

> 1. Use substitution rules:
 [details removed]

What would be nice would be something like Simplify[] or FullSimplify[] but
which would identify common sub-expressions like the sqrt(a^2+b^2) above and
substitute them automatically subject to some criteria. eg. produce a result
which minimises the total numbers of terms (in the main expression plus all the
substituted sub-expressions) subject to a minimum size of substituting
sub-expression to prevent it doing silly things like turning,

R=Sqrt[a^2+b^2) into,


... this being effectively what the FortranDef utility does.

Tom Crane, Dept. Physics, Royal Holloway, University of London, Egham Hill,
Egham, Surrey, TW20 0EX, England. 
Email:	uhap023 at
SPAN:   19.875
Fax:    +44 (0) 1784 472794

  • Prev by Date: Re: Solve[] for equations?
  • Next by Date: Re: Solve[] for equations?
  • Previous by thread: Re: Simple questions about Mathematica
  • Next by thread: reading data files