MathGroup Archive 2001

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

Search the Archive

Re: Simple questions about Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31916] Re: Simple questions about Mathematica
  • From: "Alan Mason" <swt at austin.rr.com>
  • Date: Wed, 12 Dec 2001 04:13:56 -0500 (EST)
  • References: <9uvhm2$ibq$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hello,
Your first question isn't as straightforward as it sounds, because of the
way Mathematica stores expressions internally (you can always find out how
it does this by using FullForm[]).
For instance, the simplest rule rl=Sqrt[a^2+b^2]\[Rule]R fails to work in a
lot of cases, e.g., 1/Sqrt[a^2+b^2].

The best simple rule I can think of is
rl2 = (a^2 + b^2)^Rational[p_, 2] :> R^p.
This works on things like Log[(a^2+b^2)^(3/2)]
in[ Sqrt[a^2+b^2]]/Sqrt[a^2+b^2].
For example,
Log[(a^2+b^2)^(3/2)] Sin[ Sqrt[a^2+b^2]]/Sqrt[a^2+b^2] //. rl2 gives
Log[R^3]Sin[R]/R.

"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.
>



  • Prev by Date: Re: Very simple limit, why doesn't it evaluate?
  • Next by Date: RE: Interactive simplifying
  • Previous by thread: RE: Simple questions about Mathematica
  • Next by thread: Re: Simple questions about Mathematica