Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2000
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

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

Search the Archive

FullSimplify tricks

  • To: mathgroup at smc.vnet.net
  • Subject: [mg25474] FullSimplify tricks
  • From: "Arturas Acus" <acus at itpa.lt>
  • Date: Mon, 2 Oct 2000 22:26:54 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Dear Group,  
 
Simplifying trigonometric expressions I found rather unexpected 
feature of FullSimplify. In particularry FullSimplify sometimes can find nicer expressions if
some symbols we make "subscripted".  It is if we provide some fictive 
"substructure" (two dimensional form) for some symbols. Below is one of simplest examples.
In[1]:=
\!\(\((1 - 2\ x\_0\%2 + 
          2\ \((\(-1\) + x\_0\%2)\)\ Cos[
              2\ F])\)\ \((\(-\[ImaginaryI]\)\ Cos[F] + x\_0\ 
Sin[F])\)\^2 // 
    FullSimplify\)
Out[1]=
\!\(\((Cos[F] + \[ImaginaryI]\ Sin[F]\ x\_0)\)\^2\ \((\(-1\) + 2\ 
Cos[2\ F] + 
        4\ Sin[F]\^2\ x\_0\%2)\)\)
In[2]:=
\!\(ReplaceAll[\((1 - 2\ x\_0\%2 + 
            2\ \((\(-1\) + x\_0\%2)\)\ Cos[
                2\ F])\)\ \((\(-\[ImaginaryI]\)\ Cos[F] + x\_0\ 
Sin[F])\)\^2, \
{Subscript[x, \(-1\)] -> xm1, Subscript[x, 1] -> xp1, 
        Subscript[x, 0] -> x0}] // FullSimplify\)
Out[2]=
\!\(\((1 - 2\ x\_0\%2 + 
        2\ \((\(-1\) + x\_0\%2)\)\ Cos[
            2\ F])\)\ \((\(-\[ImaginaryI]\)\ Cos[F] + x\_0\ 
Sin[F])\)\^2\)
It is natural to expect this behaviour, due to some leaf count 
algorithm used by FullSimplify. However it could sometimes be quite difficult to understand this effect if
one uses two dimensional notations for such symbols. For example in 
this case I spend a hour when realized that symbol notation significantly affected FullSimplify rezult!
                                     
Dr. Arturas Acus
Institute of Theoretical
Physics and Astronomy
Gostauto 12, 2600,Vilnius
Lithuania 


E-mail: acus at itpa.lt
   Fax: 370-2-225361
   Tel: 370-2-612906


  • Prev by Date: Re: minimizing f(x,y) ???!!!!
  • Next by Date: Hold, HoldForm, ReleaseHold when Plotting multiple functions
  • Previous by thread: Re: making a function linear
  • Next by thread: Hold, HoldForm, ReleaseHold when Plotting multiple functions