MathGroup Archive 1997

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

Search the Archive

Re: Numerical Left Eigenvectors

  • To: mathgroup at smc.vnet.net
  • Subject: [mg6395] Re: [mg6369] Numerical Left Eigenvectors
  • From: seanross at worldnet.att.net
  • Date: Sun, 16 Mar 1997 19:25:06 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Gregory Dwyer wrote:
> 
> Greetings -
> 
> When I use the "eigenvector" function to numerically calculate
> eigenvectors, Mathematica seems to assume that I always want right
> eigenvectors.  Is there some way to numerically calculate left eigenvectors?
> 
> Thanks.
> 
> Greg Dwyer.
> Entomology, UMASS Amherst
> dwyer at ent.umass.edu



I tried the following code in mathematica 3.0.  It looks bad in the 
email browser, but if you copy it into a notebook it should become 
transparent.  Anyway, it confirms that Matrix.columnvector = 
rowvector.Transpose[Matrix] which means that the "right eigenvectors" of 
a matrix are equal to the transpose of the "left eigenvectors" of its 
transpose.  The test matrix I used was a 5 x 5 which should be large 
enough to avoid any special cases that commonly occur in the smaller 
ones.

Thus, the statement Eigenvectors[Transpose[matrix]] should return your 
"left" eigenvectors.
   This, of course, assumes that I guessed correctly what you meant by 
left and right eigenvectors and they are:
Matrix.righteigenvector=constant.righteigenvector 
lefteigenvector.Matrix=constant.lefteigenvector


In[1]:=
\!\(\*
  RowBox[{
    RowBox[{"A", "=", 
      RowBox[{"(", GridBox[{
            {"a11", "a12", "a13", "a14", "a15"},
            {"a21", "a22", "a23", "a24", "a25"},
            {"a31", "a32", "a33", "a34", "a35"},
            {"a41", "a42", "a43", "a44", "a45"},
            {"a51", "a52", "a53", "a54", "a55"}
            }], ")"}]}], ";", "\n", 
    RowBox[{"x", "=", 
      RowBox[{"(", GridBox[{
            {"x1"},
            {"x2"},
            {"x3"},
            {"x4"},
            {"x5"}
            }], ")"}]}], ";"}]\)
In[4]:=
MatrixForm[Dot[A,x]]
Out[4]//MatrixForm=
\!\(\*
  TagBox[
    RowBox[{"(", GridBox[{
          {\(a11\ x1 + a12\ x2 + a13\ x3 + a14\ x4 + a15\ x5\)},
          {\(a21\ x1 + a22\ x2 + a23\ x3 + a24\ x4 + a25\ x5\)},
          {\(a31\ x1 + a32\ x2 + a33\ x3 + a34\ x4 + a35\ x5\)},
          {\(a41\ x1 + a42\ x2 + a43\ x3 + a44\ x4 + a45\ x5\)},
          {\(a51\ x1 + a52\ x2 + a53\ x3 + a54\ x4 + a55\ x5\)}
          }], ")"}],
    (MatrixForm[ #]&)]\)
In[9]:=
MatrixForm[Dot[Flatten[Transpose[x]],Transpose[A]]]
Out[9]//MatrixForm=
\!\(\*
  InterpretationBox[
    RowBox[{"(", GridBox[{
          {\(a11\ x1 + a12\ x2 + a13\ x3 + a14\ x4 + a15\ x5\)},
          {\(a21\ x1 + a22\ x2 + a23\ x3 + a24\ x4 + a25\ x5\)},
          {\(a31\ x1 + a32\ x2 + a33\ x3 + a34\ x4 + a35\ x5\)},
          {\(a41\ x1 + a42\ x2 + a43\ x3 + a44\ x4 + a45\ x5\)},
          {\(a51\ x1 + a52\ x2 + a53\ x3 + a54\ x4 + a55\ x5\)}
          }], ")"}],
    MatrixForm[ {
      Plus[ 
        Times[ a11, x1], 
        Times[ a12, x2], 
        Times[ a13, x3], 
        Times[ a14, x4], 
        Times[ a15, x5]], 
      Plus[ 
        Times[ a21, x1], 
        Times[ a22, x2], 
        Times[ a23, x3], 
        Times[ a24, x4], 
        Times[ a25, x5]], 
      Plus[ 
        Times[ a31, x1], 
        Times[ a32, x2], 
        Times[ a33, x3], 
        Times[ a34, x4], 
        Times[ a35, x5]], 
      Plus[ 
        Times[ a41, x1], 
        Times[ a42, x2], 
        Times[ a43, x3], 
        Times[ a44, x4], 
        Times[ a45, x5]], 
      Plus[ 
        Times[ a51, x1], 
        Times[ a52, x2], 
        Times[ a53, x3], 
        Times[ a54, x4], 
        Times[ a55, x5]]}]]\)

	by smc.vnet.net (8.8.5/8.8.5) with ESMTP id MAA22734
	for <mathgroup at smc.vnet.net>; Sat, 15 Mar 1997 12:42:03 -0500 (EST)
	(peer crosschecked as: boursy.news.erols.com [205.252.116.140])
	id QQcgzu15606; Sat, 15 Mar 1997 12:43:40 -0500 (EST)
	by boursy.news.erols.com (8.8.5/8.8.5) id MAA22082;
	Sat, 15 Mar 1997 12:43:22 -0500 (EST)
From: tracyp at erols.com
To: mathgroup at smc.vnet.net
Subject: [mg6395] Newbie Girl needs help with Ploting Equations Using Mathematica 3.0 Win95
Organization: Erol's Internet Services
Content-Length: 3276



Dear Experienced Mathematica Users:


I have the following BASIC programs that I am trying to convert to
Mathmatica.  Each program generates a graph as discribeded in the
header.  Could someone please help?  I recognize this is a big
request, but any help will be appreciated!


Tracy


Figure 1 (A Circle with internal connecting lines)
1. INPUT"NUMBER OF POINTS (SAMPLE HAS 18) ";N
2. DIM A(N), B(N)
3. FOR T =0 TO 2*PI-.001 STEP 2*PI/N
4. Z=Z+1
5. A(Z)=COST(T)*200+202: B(Z)=SIN(T)*202+202
6. NEXT T
7. FOR S=1 TO N-1: FOR D=S+1 TO N
8. X1=A(S): Y1=B(S)
9. X2=A(D): Y2=B(D)
10. GLINE (X1,Y1) (X2,Y2)
11. NEXT D,S

Figure 2 (parabolic border with circle that has internal connecting
lines)
1. FOR Q= 0 TO 405 STEP 9
2. X1=0: Y1=Q:X2=Q :Y2=405
3. GLINE (X1,Y1) (X2,Y2)
4. X1=Q:Y1=0:X2=405:Y2=Q
5. GLINE (X1,Y1) (X2,Y2)
6. NEXT Q
7. INPUT"NUMBER OF POINTS (SAMPLE HAS 18) ";N
8. DIM A(N),B(N)
9. FOR T = 0 TO 2*PI - .001 STEO 2*PI/N
10. Z=Z+1
11. A(Z)=COS(T)*125+202:B(Z)=SIN(T)*125+202
12. NEXT T
13. FOR S=1TO-1:FOR D= S+1 TO N
14. X1=A(S) : Y1=B(S)
15. X2=A(D): Y2=B(D)
16. GLINE (X1,Y1) (X2,Y2)
17. NEXT D,S

figure 3 (a moire pattern created by the interference of regularly
spaced radii of two circles)
1. FOR T = 0 TO PI/2 STEP PI/180
2. X1 = FIX(COS(T)*100):Y1=SIN(T)*100
3. X2= FIX(COS(T)*405): Y2=SIN(T)*405
4. GLINE (X1,Y1) (X2,Y2)
5. X1=405-X1: Y1=405-Y1
6. X2=405-X2 : Y2=405-Y2
7. NEXT T

Figure 4 ("the tunnel" is a square spiral)
1. X1=270: Y1=270
2. FOR Q = 1 TO 64
3. X2=X1+5*Q+2:Y2=Y1
4. GLINE (X1,Y1) (X2,Y2)
5. X1=X2:Y1=Y2+5*Q+3
6. GLINE (X1,Y1) (X2,Y2)
7. X2=X1-5*Q-5:Y2=Y1
8. GLINE (X1,Y1) (X2,Y2)
9. X1=X2:Y1=Y2-5*Q-6
10. GLINE (X1,Y1) (X2,Y2)
11. NEXT Q

figure 5 (A very simple disk made with one hundred straight lines)
1. FOR T = 0 TO 2 * PI STEP PI/50
2. X1=COST(T)*200+202:Y1=SIN(T)*200+202
3. A=T+3*PI/4
4. X2=COS(A)*200+202:Y2=SIN(A)*200+202
5. GLINE (X1,Y1) (X2,Y2)
6. NEXT T

figure 6 (An overlapping spiral made of two hundred lines)
1. FOR T = 0 TO 10*PI STEP PI/20
2. X1=COS(T)*5*T+202: Y1=SIN(T)*5*T+202
3. A=T+2*PI/3
4. X2=COS(A)*5*A+202:Y2=SIN(A)*5*A+202
5. GLINE (X1,Y1) (X2,Y2)
6. NEXT T

figure 7 (This figure used polar coordinates and is based on a four
leaf rose)
1. FOR T = 0 TO 2* PI STEP PI/75
2. R=COS (2*T)*200
3. X1=COS(T)*R+202:Y1=SIN(T)*R+202
4. A=T+PI/3
5. R2=COS(2*A)*200
6. X2=COS(A)*R2+202:Y2=SIN(A)*R2+202
7. GLINE (X1,Y1) (X2,Y2)
8. NEXT T

figure 8 (This figure is completely made of squares)
1. FOR T = 0 TO 2*PI STEP PI/60
2. R=COS(2*T)*200
3. X1=COS(T)*R+202: Y1=SIN(T)*R+202
4. A=T+PI/2
5. R2=COS(2*A)*200
6. X2=COS(A)*R2+202: Y2=SIN(A)*R2+202
7. GLINE (X1,Y1) (X2,Y2)
8. NEXT T

Figure 9 (This is based on an eight leaf rose; the small star in the
center was an accident)

1. FOR T=0 TO 2*PI STEP PI/60
2. R=COS(4*T)*200
3. X1=COS(T)*R+202:Y1=SIN(T)*R+202
4. A=T+PI/4
5. R2=COS(4*A)*200
6. X2=COS(A)*R2+202: Y2=SIN(A)*R2+202
7. GLINE (X1,Y1) (X2,Y2)

Figure 10 (This figure is completely made of triangles)
1. FOR T=0 TO 2*PI STEP PI/30
2. R=T*31
3. X1=COS(T)*R+202:Y1=SIN(T)*R+202
4. A=T+2*PI/3
5. X2=COS(A)*R+202:Y2=SIN(A)*R+202
6. GLINE (X1,Y1) (X2,Y2)
7. B=T+4*PI/3
8. X1=COS(B)*R+202:Y1=SIN(B)*R+202
9. GLINE (X1,Y1) (X2,Y2)
10. X2=COS(T)*R+202:Y2=SIN(T)*R+202
11. GLINE (X1,Y1) (X2,Y2)
12. NEXT T







  • Prev by Date: Re: Working with Dot[..] or NonCommutativeMultiply[..]
  • Next by Date: Re: Re: Numerical Left Eigenvectors
  • Previous by thread: Re: Numerical Left Eigenvectors
  • Next by thread: Re: Re: Numerical Left Eigenvectors