Section B.5 Triangular block form
Subsection B.5.1 Matrix and eigenvalues
Here we will use Sage to carry out the calculations in Section 30.2. First let's load our matrix into Sage.xxxxxxxxxx
A = matrix( [
[ 3, 4, 1, -1, 0, -4, 0 ],
[ 0, 3, -4, 0, 4, 0, 0 ],
[ 0, 0, 5, -1, -1, 0, 0 ],
[ 0, 0, -2, 2, 3, 0, 0 ],
[ 0, 0, 6, -1, -2, 0, 0 ],
[ 0, 4, -5, 0, 5, -1, 0 ],
[ 4, 3, 1, -1, 0, -3, -1 ]
] )
print(A)
Eigenvalues.
Determine the eigenvalues.xxxxxxxxxx
A.eigenvalues()
Subsection B.5.2 Analysis of λ1
For λ1=−1, the eigensubspaces are null spaces of powers of (−1)I−A, so let's form that matrix.xxxxxxxxxx
C = -1 * identity_matrix(7) - A
print(C)
Compute a basis of the eigenspace.
xxxxxxxxxx
C.rref()
xxxxxxxxxx
p1 = vector((0,0,0,0,0,0,1))
print(p1)
print(A*p1)
Extend to a basis for the second generalized eigensubspace.
Continue on to the generalized eigensubspace of degree 2. To do this, we analyze the null space of C2=((−1)I−A)2.xxxxxxxxxx
(C^2).rref()
(1,0,0,0,0,1,0),(0,0,0,0,0,0,1).
That second vector is already our basis vector from E1−1(A), so take p2=(1,0,0,0,0,1,0).
xxxxxxxxxx
p2 = vector((1,0,0,0,0,1,0))
print(p2)
C*p2
Extend to a basis for the third generalized eigensubspace.
Now we move on to analyzing the null space of C3 (where C=(−1)I−A).xxxxxxxxxx
(C^3).rref()
(1,−1,0,−1,1,0,0),(1,0,0,0,0,1,0),(0,0,0,0,0,0,1).
Again, the last two are actually already our basis for E2−1(A), so set p3=(1,−1,0,−1,1,0,0).
xxxxxxxxxx
p3 = vector((1,-1,0,-1,1,0,0))
print(p3)
C*p3
Subsection B.5.3 Analysis of λ2
For λ2=3, the eigensubspaces are null spaces of powers of 3I−A, so let's form that matrix.xxxxxxxxxx
C = 3 * identity_matrix(7) - A
print(C)
Compute a basis of the eigenspace.
xxxxxxxxxx
C.rref()
q1=(0,0,1,1,1,0,0),q2=(0,1,0,0,0,1,0),q3=(1,0,0,0,0,0,1).
xxxxxxxxxx
q1 = vector((0,0,1,1,1,0,0))
q2 = vector((0,1,0,0,0,1,0))
q3 = vector((1,0,0,0,0,0,1))
print(q1,q2,q3)
print(A*q1,A*q2,A*q3)
Extend to a basis for the second generalized eigensubspace.
Continue on to the generalized eigensubspace of degree 2. This should be our last step for this eigenvalue, as our dimension must increase past the eigenspace dimension (which was 3), but can't increase past the algebraic multiplicity (which is m2=4). The second generalized eigensubspace E23(A) is the null space of C2=(3I−A)2.xxxxxxxxxx
(C^2).rref()
(0,0,0,1,0,0,0),(0,0,1,0,1,0,0),(0,1,0,0,0,1,0),(1,0,0,0,0,0,1).
The last two vectors are already in our basis for E3(A). The first two vectors can be combined to give our other basis vector for E3(A), so that indicates that either one would be independent from our current basis for E3(A). Let's choose the simplest one of the two.
xxxxxxxxxx
q4 = vector((0,0,0,1,0,0,0))
print(q4)
C*q4
(3I−A)q4=q1+q3,
so (3I−A)q4 is an eigenvector, as desired.
Since we are now at dimE23(A)=m2=4, our analysis of this eigenvalue is complete.Subsection B.5.4 The transition matrix and the triangular block form matrix
We now have a basis for each of the generalized eigenspaces G−1(A) and G3(A), with each of these bases built up one step at a time by extending a basis for one generalized eigensubspace Ekλj(A) to a basis for the next generalized eigensubspace Ek+1λj(A). Now let's create our transition matrix P.xxxxxxxxxx
P = column_matrix([p1, p2, p3, q1, q2, q3, q4])
print(P)
xxxxxxxxxx
T = P.inverse() * A * P
print(T)
xxxxxxxxxx
T1 = T[0:3,0:3]
T2 = T[3:7,3:7]
print(T1)
print()
print(T2)
[PAP]row→reduce[IP−1(AP)]
xxxxxxxxxx
P_AP = P.augment(A*P)
print(P_AP)
print()
I_iPAP = P_AP.rref()
print(I_iPAP)
xxxxxxxxxx
T = I_iPAP[:,7:14]
print(T)
xxxxxxxxxx
T1 = T[0:3,0:3]
T2 = T[3:7,3:7]
print(T1)
print()
print(T2)