MathGroup Archive 2003

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

Search the Archive

Rationalize denominator of a complex value formula using Abs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40261] Rationalize denominator of a complex value formula using Abs
  • From: gauer at ras.sk.ca
  • Date: Fri, 28 Mar 2003 04:31:41 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

I am given a set of four ordered pairs of formulae of six variables (this
is displayed as version 3 Mathematica text, so copy and paste
it to StandardForm for a better display) as follows (you may or may not
prefer to look at the 4 ordered pairs using MatrixForm):

\!\(ListForm[{{{{\((\((\(-b\)\ g + f\ h)\)\ \((a\ b - h\^2)\)\ \((\(-a\) +
b +
 \@\(\((a - b)\)\^2 + 4\ h\^2\))\) + \@2\ \@\(\(-\((\(-a\)\ b\ h + h\^3)\)\^2
\)\ \((a\ \((\(-b\)\ c + f\^2)\) + b\ g\^2 + h\ \((\(-2\)\ f\ g + c\ h)\))\)\
\((\(-a\) + b + \@\(\((a - b)\)\^2 + 4\ h\^2\))\)\))\)/\((\((\(-a\)\ b +
h\^2)
\)\^2\ \((\(-a\) + b + \@\(\((a - b)\)\^2 + 4\ h\^2\))\))\)}, {\(a\ f - g\ h
\)\/\(\(-a\)\ b + h\^2\) + \@\(\(-\((\(-a\)\ b\ h + h\^3)\)\^2\)\ \((a\
\((\(-
b\)\ c + f\^2)\) + b\ g\^2 + h\ \((\(-2\)\ f\ g + c\ h)\))\)\ \((\(-a\) + b +
\@\(\((a - b)\)\^2 + 4\ h\^2\))\)\)\/\(\@2\ h\ \((\(-a\)\ b +
h\^2)\)\^2\)}}},
 {{{\((\(-\((b\ g - f\ h)\)\)\ \((a\ b - h\^2)\)\ \((\(-a\) + b + \@\(\((a -
b)\)\^2 + 4\ h\^2\))\) - \@2\ \@\(\(-\((\(-a\)\ b\ h + h\^3)\)\^2\)\ \((a\
\((
\(-b\)\ c + f\^2)\) + b\ g\^2 + h\ \((\(-2\)\ f\ g + c\ h)\))\)\ \((\(-a\)
+ b
 + \@\(\((a - b)\)\^2 + 4\ h\^2\))\)\))\)/\((\((\(-a\)\ b + h\^2)\)\^2\
\((\(-
a\) + b + \@\(\((a - b)\)\^2 + 4\ h\^2\))\))\)}, {\(-\(\(2\ h\ \((\(-a\)\ f +
g\ h)\)\ \((\(-a\)\ b + h\^2)\) + \@2\ \@\(\(-\((\(-a\)\ b\ h + h\^3)\)\^2\)\
\((a\ \((\(-b\)\ c + f\^2)\) + b\ g\^2 + h\ \((\(-2\)\ f\ g + c\ h)\))\)\ \((
\(-a\) + b + \@\(\((a - b)\)\^2 + 4\ h\^2\))\)\)\)\/\(2\ h\ \((\(-a\)\ b + h
\^2)\)\^2\)\)\)}}}, {{{\((\(-\((b\ g - f\ h)\)\)\ \((a\ b - h\^2)\)\ \((a - b
 + \@\(\((a - b)\)\^2 + 4\ h\^2\))\) - \@2\ \@\(\((\(-a\)\ b\ h + h\^3)\)\^2\
\((a\ \((\(-b\)\ c + f\^2)\) + b\ g\^2 + h\ \((\(-2\)\ f\ g + c\ h)\))\)\
\((a
 - b + \@\(\((a - b)\)\^2 + 4\ h\^2\))\)\))\)/\((\((\(-a\)\ b + h\^2)\)\^2\
\((a - b + \@\(\((a - b)\)\^2 + 4\ h\^2\))\))\)}, {\(a\ f - g\ h\)\/\(\(-a\)\
b + h\^2\) + \@\(\((\(-a\)\ b\ h + h\^3)\)\^2\ \((a\ \((\(-b\)\ c + f\^2)\) +
b\ g\^2 + h\ \((\(-2\)\ f\ g + c\ h)\))\)\ \((a - b + \@\(\((a - b)\)\^2 + 4\
h\^2\))\)\)\/\(\@2\ h\ \((\(-a\)\ b + h\^2)\)\^2\)}}}, {{{\((\((\(-b\)\ g + f
\ h)\)\ \((a\ b - h\^2)\)\ \((a - b + \@\(\((a - b)\)\^2 + 4\ h\^2\))\) + \@2
\ \@\(\((\(-a\)\ b\ h + h\^3)\)\^2\ \((a\ \((\(-b\)\ c + f\^2)\) + b\ g\^2
+ h
\ \((\(-2\)\ f\ g + c\ h)\))\)\ \((a - b + \@\(\((a - b)\)\^2 + 4\ h\^2\))
\)\))\)/\((\((\(-a\)\ b + h\^2)\)\^2\ \((a - b + \@\(\((a - b)\)\^2 + 4\ h\^2
\))\))\)}, {\(-\(\(2\ h\ \((\(-a\)\ f + g\ h)\)\ \((\(-a\)\ b + h\^2)\) + \@2
\ \@\(\((\(-a\)\ b\ h + h\^3)\)\^2\ \((a\ \((\(-b\)\ c + f\^2)\) + b\ g\^2
+ h
\ \((\(-2\)\ f\ g + c\ h)\))\)\ \((a - b + \@\(\((a - b)\)\^2 + 4\ h\^2\))
\)\)\)\/\(2\ h\ \((\(-a\)\ b + h\^2)\)\^2\)\)\)}}}}]\)

I refer to the six variables as a (complex valued) sectuple, with
interesting cases usually occurring with real values, and such that each
of:

i) hh-ab=/=0 (Cases interested in: replace '=/=' with '<', '>',
respectively),
ii) (abc-2fgh-aff-bgg-chh)/(ab-hh)=/=0 (Cases interested in: replace '=/='
with '<', '>', respectively),
and,
iii) a=/=b (Cases interested in: replace '=/=' with '<', '>', respectively)

occur (ie, cases i, ii, iii hold simultaneously, but the subcases can (and
might need to) be broken down further).

I would like to get the equations into the following form, but also
respecting the complex-valued arithmetic (so that when I later
define the second as a general sectuple function, it should produce some
real and some complex values when assigned real-valued sectuples):

<the following abbreviations occur:
\!\({{\(f\ h - b\ g\)\/\(a\ b - h\^2\)}, {\(g\ h - a\ f\)\/\(a\ b - h\^2\)}}
 := {{\[Alpha]}, {\[Beta]}}\),
\!\(\*
  RowBox[{"\[Zeta]", ":=",
    RowBox[{"Det", "[",
      RowBox[{"(", GridBox[{
            {"a", "h", "g"},
            {"h", "b", "f"},
            {"g", "f", "c"}
            }], ")"}], "]"}]}]\)
>

\!\(\*
  RowBox[{"(", GridBox[{
        {
          TagBox[
            RowBox[{"(", GridBox[{
                  {\(\@\(Abs[\[Zeta]]\/2\)\ \@Abs[\((a - b + Abs[\@\(\((a
- b)
\)\^2 + 4\ h\^2\)])\)]\/\((a\ b - h\^2)\) + \[Alpha]\)},
                  {\(\(\@\(Abs[\[Zeta]]\/2\)\) \@Abs[\((b - a +
Abs[\@\(\((a -
 b)\)\^2 + 4\ h\^2\)])\)]\/\((a\ b - h\^2)\) + \[Beta]\)}
                  }], ")"}],
            (MatrixForm[ #]&)]},
        {
          TagBox[
            RowBox[{"(", GridBox[{
                  {\(\(\@\(Abs[\[Zeta]]\/2\)\ \@Abs[\((a - b + Abs[\@\(\((a -
b)\)\^2 + 4\ h\^2\)])\)]\)\/\((\(-a\)\ b + h\^2)\) + \[Alpha]\)},
                  {\(\(-\(\(\@\(Abs[\[Zeta]]\/2\)\ \@Abs[\((b - a + Abs[
\@\(\((a - b)\)\^2 + 4\ h\^2\)])\)]\)\/\((\(-a\)\ b + h\^2)\)\)\) -
\[Beta]\)}

                  }], ")"}],
            (MatrixForm[ #]&)]},
        {
          TagBox[
            RowBox[{"(", GridBox[{
                  {\(\(-\@\(\(Abs[\[Zeta]]\ \)\/2\)\)\ \@Abs[\((\(-a\) + b +
Abs[\@\(\((a - b)\)\^2 + 4\ h\^2\)])\)]\/\((\(-a\)\ b + h\^2)\) +
\[Alpha]\)},

                  {\(\@\(\(Abs[\[Zeta]]\ \)\/2\)\ \@Abs[\(-\((a - b + Abs[
\@\(\((a - b)\)\^2 + 4\ h\^2\)])\)\)]\/\((\(-a\)\ b + h\^2)\) + \[Beta]\)}
                  }], ")"}],
            (MatrixForm[ #]&)]},
        {
          TagBox[
            RowBox[{"(", GridBox[{
                  {\(\(\@\(Abs[\[Zeta]]\/2\)\) \@Abs[\(-\((\(-a\) + b + Abs[
\@\(\((a - b)\)\^2 + 4\ h\^2\)])\)\)]\/\((\(-a\)\ b + h\^2)\) + \[Alpha]\)},
                  {\(\(-\@\(\(Abs[\[Zeta]]\ \)\/2\)\) \@Abs[\(-\((a - b +
Abs[
\@\(\((a - b)\)\^2 + 4\ h\^2\)])\)\)]\/\((\(-a\)\ b + h\^2)\) - \[Beta]\)}
                  }], ")"}],
            (MatrixForm[ #]&)]}
        }], ")"}]\)

In some cases, when multiplying across square roots, absolute value
arithmetic need be enforced (I would prefer to not introduce trig and exp
arithmetic rules using exptotrig and trigtoexp). In fact, when running a
few tests on these equations, I had found that by changing a few Abs
signs on sqrts, that I could reproduce identical results between the two
formulae.

So, the main question is then: if Mathematica's root command likes to take
a certain parity in computing the nth root (n integer) of value^k, 0<k<n,
can we force it to return n distinct values, and, if we rationalize
the denominator, can I ensure the list's set(value)[k] is returned in the
same order when using formula 1 and formula 2, regardless of whether value
is left in the generalized equation form (the case conditions can be added
in here, but I would prefer to see as few as possible, and to keep further
subcase breakdowns as simple as possible) or in the numerical list of
values form?

How can I get Mathematica to return all possible formulae values, given
that I've not yet chosen a sectuple?

[ Can I somehow define p/m "the plus or minus typographical symbol, as
found in the button toolkits" and m/p to have the same rules of addition
and subtraction, multiplication, division, root extration, raising of
powers, etc that any other regular formula would have if somehow just
wrote '+', '-' (p/m would need the property that (-1)*p/m(a, b)=m/p(a, b)
to keep parity, and such that replace and/or simplify could simplify
k=p/m(a,b), in the same way that replace replaces (a+b)->k?)? I don't
fully understand how all of the abbreviating rules of Hold, etc can work
for me, and would rather not have to override operator definitions to make
them look "too concise" - means: be thorough; I don't use pattern matching
rules too often if I can get away with it, mainly since I find this part
of the Mathematica book harder to understand.  ]

I would like to generate a more effecient coding scheme than just writing
a few nested for(j,k,l=1 to 2 do (-1^j,k,l)) loops to switch the signs
whenever I come across a new formula possibility.

The following idea for complex numbers scaled to the unit circle would
work in a similar fashion, but for my formulae (but for unscaled numbers):

\!\(\(\tFor[k = 1, k < 30, {a\_k := FullSimplify[\@\(\((\((1 + I)\)\/\@2)
\)\^\(k\/2\)\)\%3\ \((\(\(-I\) - \@3\)\/2)\)\^3], Print[a\_k]}, \(++k\)]\)\)

System specifics: Pentium II 350 Mhz, 64 Meg Ram, Window 98, Mathematica
3.0, and sometimes get "Out of Memory. Exiting." returns when trying to
further manipulate these and similar formulae. Upgrade of
software/hardware is not an option for me at this time.

Thanks for any help which anyone might be able to offer me.
Kai G. Gauer




  • Prev by Date: Re: Questions concerning printing,editing, and copy/paste
  • Next by Date: RE: a little more complex list operation
  • Previous by thread: RE: Problems with TickFunction
  • Next by thread: Fit with lists instead of functions