MathGroup Archive 2006

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

Search the Archive

Re: normalization and square roots

  • To: mathgroup at
  • Subject: [mg65770] Re: normalization and square roots
  • From: "Chris Chiasson" <chris.chiasson at>
  • Date: Mon, 17 Apr 2006 02:28:08 -0400 (EDT)
  • References: <e1su8g$c3t$>
  • Sender: owner-wri-mathgroup at


I guess the problem happens because your delayed function definition
for f does not evaluate the right hand side until the left hand pattern
finds a suitabe expression.

f[0,0.3,0.4] fits this pattern. Let's follow the evaluator:


{HoldForm[f[0, 0.3, 0.4]],
 HoldForm[1/(Sqrt[0.4] - Sqrt[0.3*(1 + 0)^3 + ol +
       0.4]) /. ol -> myrule],
 HoldForm[(0.6324555320336759 - Sqrt[0.7 + ol])^
    (-1) /. ol -> -om + (-1 + Sqrt[oro])^2 - oro],
 HoldForm[(0.6324555320336759 -
    Sqrt[0.7 - om + (-1 + Sqrt[oro])^2 - oro])^(-1)]}

Notice that om and oro are replaced by 0.3 and 0.4 because they are
symbols that match the named pattern objects om_ and oro_. myrule
doesn't get replaced until its defition is called later, but the om and
oro it is replaced with will not be substituted with 0.3 and 0.4. To
make the substitution (or whatever it is supposed to be called) work,
you could do two things.

One, don't use a delayed function definition and make sure you define
myrule before f.
Like so (with a fresh kernel):

Two, make myrule have DownValues that accept the symbols om and oro.
Like so (with a fresh kernel):

You could also combine the two approaches. I would recommend approach

Good Luck,

  • Prev by Date: Re: Named Formats? (followup question)
  • Next by Date: Re: WebMathematica install question
  • Previous by thread: Re: normalization and square roots
  • Next by thread: problem inporting FITS format data