Question about Simplify and related
- To: mathgroup at yoda.ncsa.uiuc.edu
- Subject: Question about Simplify and related
- From: "Paul N. Schatz" <pns at dalton.acc.virginia.edu>
- Date: Wed, 16 Jan 1991 13:58:24 EST
This is a question about Simplify and related objects. Below is a Mma session in which a 3x3 orthogonal matrix (u) is formed. (It is actually the Eulerian angle matrix.) To check that I had entered the matrix elements correctly, I multiplied the matrix by its transpose to confirm that the result is the 3x3 unit matrix. I found it surprisingly difficult to carry this through, and in fact was only partially successful. What is shown below is a subset of many things I tried. To go any further I seem to have to rather laboriously extract pieces of the various matrix elements and work with them. In fact I have gotten to the point below where one can show in a couple of minutes with a paper and pencil that uutrans is indeed the 3x3 unit matrix. Sould all this be so hard to do, or am I missing something simple and obvious? Paul Schatz University of Virginia In:=u={{c1 c2 - c3 s1 s2,c2 s1 + c3 c1 s2,s2 s3}, {-s2 c1 - c3 s1 c2, -s2 s1 + c3 c1 c2, c2 s3}, {s3 s1, -s3 c1, c3}} Out={{c1*c2 - c3*s1*s2, c2*s1 + c1*c3*s2, s2*s3}, {-(c2*c3*s1) - c1*s2, c1*c2*c3 - s1*s2, c2*s3}, {s1*s3, -(c1*s3), c3}} In:=uutrans=Simplify[Expand[u.Transpose[u]]] Out={{c1^2*c2^2 + c2^2*s1^2 + c1^2*c3^2*s2^2 + c3^2*s1^2*s2^2 + s2^2*s3^2, c2*s2*(-c1^2 + c1^2*c3^2 - s1^2 + c3^2*s1^2 + s3^2), -(c3*(-1 + c1^2 + s1^2)*s2*s3)}, {c2*s2*(-c1^2 + c1^2*c3^2 - s1^2 + c3^2*s1^2 + s3^2), c1^2*c2^2*c3^2 + c2^2*c3^2*s1^2 + c1^2*s2^2 + s1^2*s2^2 + c2^2*s3^2, -(c2*c3*(-1 + c1^2 + s1^2)*s3)}, {-(c3*(-1 + c1^2 + s1^2)*s2*s3), -(c2*c3*(-1 + c1^2 + s1^2)*s3), c3^2 + c1^2*s3^2 + s1^2*s3^2}} In:=rule1=s1^2+c1^2->1 Out=c1^2 + s1^2 -> 1 In:=rule2=s2^2+c2^2->1 Out=c2^2 + s2^2 -> 1 In:=rule3=s3^2+c3^2->1 Out=c3^2 + s3^2 -> 1 In:=rule123={rule1,rule2,rule3} Out={c1^2 + s1^2 -> 1, c2^2 + s2^2 -> 1, c3^2 + s3^2 -> 1} In:=t1=uutrans//.rule123 Out={{c1^2*c2^2 + c2^2*s1^2 + c1^2*c3^2*s2^2 + c3^2*s1^2*s2^2 + s2^2*s3^2, c2*s2*(-c1^2 + c1^2*c3^2 - s1^2 + c3^2*s1^2 + s3^2), 0}, {c2*s2*(-c1^2 + c1^2*c3^2 - s1^2 + c3^2*s1^2 + s3^2), c1^2*c2^2*c3^2 + c2^2*c3^2*s1^2 + c1^2*s2^2 + s1^2*s2^2 + c2^2*s3^2, 0}, {0, 0, c3^2 + c1^2*s3^2 + s1^2*s3^2}} In:=t2=Collect[t1,c2]//.rule123 Out={{c2^2 + c1^2*c3^2*s2^2 + c3^2*s1^2*s2^2 + s2^2*s3^2, c2*(-(c1^2*s2) + c1^2*c3^2*s2 - s1^2*s2 + c3^2*s1^2*s2 + s2*s3^2), 0}, {c2*(-(c1^2*s2) + c1^2*c3^2*s2 - s1^2*s2 + c3^2*s1^2*s2 + s2*s3^2), c1^2*s2^2 + s1^2*s2^2 + c2^2*(c1^2*c3^2 + c3^2*s1^2 + s3^2), 0}, {0, 0, c3^2 + c1^2*s3^2 + s1^2*s3^2}} In:=t3=Collect[t2,s3]//.rule123 Out={{c2^2 + c1^2*c3^2*s2^2 + c3^2*s1^2*s2^2 + s2^2*s3^2, -(c1^2*c2*s2) + c1^2*c2*c3^2*s2 - c2*s1^2*s2 + c2*c3^2*s1^2*s2 + c2*s2*s3^2, 0}, {-(c1^2*c2*s2) + c1^2*c2*c3^2*s2 - c2*s1^2*s2 + c2*c3^2*s1^2*s2 + c2*s2*s3^2, c1^2*c2^2*c3^2 + c2^2*c3^2*s1^2 + c1^2*s2^2 + s1^2*s2^2 + c2^2*s3^2, 0}, {0, 0, 1}} In:=t4=Simplify[t3]//.rule123 Out={{c2^2 + c1^2*c3^2*s2^2 + c3^2*s1^2*s2^2 + s2^2*s3^2, c2*s2*(-c1^2 + c1^2*c3^2 - s1^2 + c3^2*s1^2 + s3^2), 0}, {c2*s2*(-c1^2 + c1^2*c3^2 - s1^2 + c3^2*s1^2 + s3^2), c1^2*c2^2*c3^2 + c2^2*c3^2*s1^2 + c1^2*s2^2 + s1^2*s2^2 + c2^2*s3^2, 0}, {0, 0, 1}}