Re: Simple questions about Mathematica

*To*: mathgroup at smc.vnet.net*Subject*: [mg31902] Re: Simple questions about Mathematica*From*: "Allan Hayes" <hay at haystack.demon.co.uk>*Date*: Mon, 10 Dec 2001 06:14:47 -0500 (EST)*References*: <9uvhm2$ibq$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Stephen, For your first question: rl=Sqrt[a^2+b^2]\[Rule]R; A[Sqrt[a^2+b^2]][B[Sqrt[a^2+b^2]]]/.rl A[R][B[R]] %/.Reverse[rl] A[Sqrt[a^2 + b^2]][B[Sqrt[a^2 + b^2]]] -- Allan --------------------- Allan Hayes Mathematica Training and Consulting Leicester UK www.haystack.demon.co.uk hay at haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565 "Stephen Gray" <stevebg at adelphia.net> wrote in message news:9uvhm2$ibq$1 at smc.vnet.net... > 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. > > 2. I'm not sure how a "batch" file is suppposed to be > prepared and fed to Mathematica. That is, I want to > prepare a bunch of operations and variables in advance > and feed it in, preferably having mathematica give me > line-by-line output as it would if I were typing each line > in one by one. > > As a new user I really need answers to these questions. > Thanks in advance for any information. >