Application Center - Maplesoft

App Preview:

Classroom Tips and Techniques: Locus of Eigenvalues

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application




 

Classroom Tips and Techniques: Locus of Eigenvalues

``

Robert J. Lopez

Emeritus Professor of Mathematics and Maple Fellow

Maplesoft``

NULL

Introduction

``

In a May 4, 2012, post to Maple Primes, gdorsch sought the locus of eigenvalues for parameter-dependent matrices. In reply, Markiyan Hirnyk proposed the matrix P = M+s*(K-M) as a model to study how the eigenvalues of the matrix M morph to the eigenvalues of K as the parameter s varies from 0 to 1. Apparently, the matrices M and K are real.

 

If the matrices M and K are not symmetric, the eigenvalues of P can become complex, making the analysis of their loci very difficult. However, on May 30, 2013, jschulzb appended to the earlier post the comment "I have the same problem. Have you found a good solution yet?" and the post branched to a separate new question about eigenvalue ordering. In this new post, jschulzb imposed symmetry on the matrices M and K, making the problem slightly more tractable.

 

This question about the loci of eigenvalues is reminiscent of two earlier investigations in [1] and [2]. In [1], the general question of the root locus is raised. In the context of feedback control, engineers use the locus of roots of certain polynomials to determine the stability of these feedback systems. The characteristic polynomials for the matrices P(s) certainly raise similar issues.

 

In [2], Mike Monagan presents a Maple solution to an exercise in [3], a linear algebra text that touts numeric software as the best tool for studying that subject. In this text, Steve Leon essentially asks the student to explore the transition of the eigenvalues of one matrix to the eigenvalues of another. Because of the limited availability of access to back issues of the MapleTech journal, the next section of this article will be a paraphrase of Monagan's "reply" to Steve Leon.``

``

Thereafter, this article will explore several examples of the loci generated by symmetric real n × n matrices P(s) = M+s*(K-M), for n = 2, 3, and 5. These examples will show that whether or not the eigenvalues are degenerate for some `in`(s, [0, 1]), loci of eigenvalues have to be as taken curves with continuously turning tangents, that is, as C[1] curves.

 

Monagan's MapleTech Article

``

Given that the earlier editions of [3] are dated 1980, 1986, 1990, and 1994, it must be obvious that Mike Monagan's MapleTech article was based on one of the first three editions of Steve Leon's text. Mike's article used matrices that differed slightly from those in Exercise 4, page 360, in [3].

 

The following is a paraphrase of the exercise, and consequently, of the MapleTech article.

 

If P(s) = (Matrix(2, 2, {(1, 1) = 4, (1, 2) = -2, (2, 1) = 3, (2, 2) = s})), examine the locus of its eigenvalues as s varies linearly from -5 to 5.

``

Solution

 

The eigenvalues of P(-5) are (-1+`&+-`(sqrt(57)))*(1/2) whereas the eigenvalues of P(5) are (9+`&+-`(sqrt(23)))*(1/2). Because P(s) is not symmetric, its eigenvalues can be, and actually do become, complex. Indeed, the eigenvalues of P(s) are `#msub(mi("λ",fontstyle = "normal"),mo("±"))`(s) = 2+(s+`&+-`(sqrt(s^2-8*s-8)))*(1/2). Figure 1 is a graph of the real values of these eigenvalues; Figure 2 shows the eigenvalues in the complex plane. In each figure, `in`(s, [-5, 5]), with `#msub(mi("λ",fontstyle = "normal"),mo("+"))` drawn in black; and `#msub(mi("λ",fontstyle = "normal"),mo("&uminus0;"))`, in red.

 

evs := [2+(1/2)*s+(1/2)*sqrt(s^2-8*s-8), 2+(1/2)*s-(1/2)*sqrt(s^2-8*s-8)]:
plot(evs,s=-5..5,color=[black,red]);

 

Figure 1   Eigenvalues of P(s) in the real plane

evs := [2+(1/2)*s+(1/2)*sqrt(s^2-8*s-8), 2+(1/2)*s-(1/2)*sqrt(s^2-8*s-8)]:
plots:-complexplot(evs,s=-5..5,color=[black,red],scaling=constrained,thickness=2);

 

Figure 2   Eigenvalues of P(s) in the complex plane

``

Figures 3 and 4 repeat Figures 1 and 2, respectively, but for `in`(s, [-5, 15]). Figure 3 makes it clear that the analytic expressions giving `#msub(mi("λ",fontstyle = "normal"),mo("±"))`(s) are discontinuous as real functions, but not as complex-valued functions. On the other hand, Figure 4 shows that in the complex plane, the loci of `#msub(mi("λ",fontstyle = "normal"),mo("±"))`(s) do not have continuously turning tangents. Although P(s) will be symmetric in the remaining examples in this article, Figures 3 and 4 portend some of the difficulties that will be encountered even for a restricted class of matrices.

 

evs := [2+(1/2)*s+(1/2)*sqrt(s^2-8*s-8), 2+(1/2)*s-(1/2)*sqrt(s^2-8*s-8)]:
plot(evs,s=-5..15,color=[black,red]);

 

Figure 3   Eigenvalues of P(s) in the real plane

evs := [2+(1/2)*s+(1/2)*sqrt(s^2-8*s-8), 2+(1/2)*s-(1/2)*sqrt(s^2-8*s-8)]:
plots:-complexplot(evs,s=-5..15,color=[black,red],scaling=constrained,thickness=2);

 

Figure 4   Eigenvalues of P(s) in the complex plane

NULL

Figure 5 contains an animation of the loci traced by `#msub(mi("λ",fontstyle = "normal"),mo("±"))`(s) for `in`(s, [-5, 15]). From this animation, or from an explicit calculation of the appropriate limits, the following can be deduced.

 

lambda[+](s)->{[[4,s->-infinity],[infinity,s->infinity]] and lambda[-](s)->{[[-infinity,s->-infinity],[4,s->infinity]] 

 

The characteristic polynomial for P(s) is

 

lambda^2+(-4-s)*lambda+6+4*s 

 

and its discriminant, s^2-8*s-8, has zeros 4+`&+-`(2*sqrt(6)).

evS := [2+(1/2)*S+(1/2)*sqrt(S^2-8*S-8), 2+(1/2)*S-(1/2)*sqrt(S^2-8*S-8)]:
plots:-animate(plots:-complexplot,[evS,S=-5..s,color=[black,red],scaling=constrained,thickness=2],s=-5..15,frames=41,digits=3);

 

Figure 5   Animation of `#msub(mi("λ",fontstyle = "normal"),mo("±"))`(s) for `in`(s, [-5, 15]) 

Hence, the loci of `#msub(mi("λ",fontstyle = "normal"),mo("±"))` bifurcate at `≐`(s, -.9) and 8.9. But the real question is, do the closed-form expressions `#msub(mi("λ",fontstyle = "normal"),mo("±"))`(s) each define the locus of an eigenvalue (resulting in the black and red curves in Figure 4), or are the loci of the eigenvalues the connected curves in Figure 3?

``

Example 1

``

Find the loci of the eigenvalues of P(s) = (Matrix(2, 2, {(1, 1) = -5-2*s, (1, 2) = 6-8*s, (2, 1) = 6-8*s, (2, 2) = 7+s})) for `in`(s, [0, 1]).

``

Solution

The eigenvalues of the symmetric P(s) are

 

`#msub(mi("λ",fontstyle = "normal"),mo("±"))`(s) = 1-(s+`&+-`(sqrt(265*s^2-312*s+288)))*(1/2) 

 

Loci are graphed in Figure 6, where `#msub(mi("λ",fontstyle = "normal"),mo("+"))` is in black, and `#msub(mi("λ",fontstyle = "normal"),mo("&uminus0;"))` is in red.

 

It might seem from Figure 6 that symmetry removes many of the difficulties posed by complex eigenvalues. However, for the 2 × 2 matrix P(s) in Example 2, `#msub(mi("λ",fontstyle = "normal"),mo("±"))`(1/4) are equal, so the loci of the eigenvalues will have a point in common. In the present example, the loci for `#msub(mi("λ",fontstyle = "normal"),mo("±"))`(s) are separate and have continuously turning tangents.

evs1:=[1-(1/2)*s+(1/2)*sqrt(265*s^2-312*s+288), 1-(1/2)*s-(1/2)*sqrt(265*s^2-312*s+288)]:
plot(evs1,s=0..1,color=[black,red]);

 

Figure 6   Loci of eigenvalues `#msub(mi("λ",fontstyle = "normal"),mo("±"))`(s), `in`(s, [0, 1])

``

Example 2

``

Find the loci of the eigenvalues of P(s) = (Matrix(2, 2, {(1, 1) = 1-s, (1, 2) = 2-8*s, (2, 1) = 2-8*s, (2, 2) = 3-9*s})) for `in`(s, [0, 1]).

``

Solution

The eigenvalues of the symmetric P(s) are

 

`#msub(mi("λ",fontstyle = "normal"),mo("±"))`(s) = 2-5*s+`&+-`(sqrt(5)*(4*s-1)) 

 

Loci are graphed in Figure 7, where `#msub(mi("λ",fontstyle = "normal"),mo("+"))` is in black, and `#msub(mi("λ",fontstyle = "normal"),mo("&uminus0;"))` is in red.

 

Although the loci in Figure 7 intersect, each expression for an eigenvalue generates a unique locus with continuously turning tangent. Figure 7 raises the hope that perhaps tracking an eigenvalue from P(0) to P(1) might be a tractable task.

 

But alas, even though Example 3 might reinforce this belief, Examples 4 - 6 will prove this hope to be a chimera.

evs2:=[4*sqrt(5)*s-sqrt(5)-5*s+2, -4*sqrt(5)*s+sqrt(5)-5*s+2]:
plot(evs2,s=0..1,color=[black,red]);

 

Figure 7   Intersecting loci for `#msub(mi("λ",fontstyle = "normal"),mo("±"))`(s) 

``

Example 3

``

Find the loci of the eigenvalues of P(s) = (Matrix(3, 3, {(1, 1) = -9+10*s, (1, 2) = -4+5*s, (1, 3) = 1-8*s, (2, 1) = -4+5*s, (2, 2) = 6-9*s, (2, 3) = -3+6*s, (3, 1) = 1-8*s, (3, 2) = -3+6*s, (3, 3) = -3+9*s})) for `in`(s, [0, 1]).

``

Solution

The eigenvalues lambda[k](s), k = 1, 2, 3, are obtained exactly with Maple's Eigenvectors command. The return is a list of length nearly 2000, and which would take two and a half pages to print.

 

Figure 8 contains a graph of the loci of the three eigenvalues, colored black, red, and green, respectively. The graph is drawn with increased precision; at standard precision, roundoff generates small imaginary parts that cause small gaps in the loci.

 

The loci in Figure 8 are separate and distinct, all with continuously turning tangents. For this P(s) it is clearly a simple task to trace the eigenvalues from P(0) to P(1).

P:=Matrix([[-9+10*s,-4+5*s,1-8*s],[-4+5*s,6-9*s,-3+6*s],[1-8*s,-3+6*s, -3+9*s]]):
evs3:=LinearAlgebra:-Eigenvalues(P,output=list):
Digits:=25:
plot(evs3,s=0..1,color=[black,red,green]);
Digits:=10:

 

Figure 8   Loci of lambda[k], k = 1, 2, 3 

``

Example 4

``

Find the loci of the eigenvalues of P(s) = (Matrix(3, 3, {(1, 1) = 3-8*s, (1, 2) = 2+16*s, (1, 3) = 4-4*s, (2, 1) = 2+16*s, (2, 2) = -9+20*s, (2, 3) = 8-24*s, (3, 1) = 4-4*s, (3, 2) = 8-24*s, (3, 3) = -5-8*s})) for `in`(s, [0, 1]).

``

Solution

• 

The eigenvalues of P(1/4) are 6, -8, -8. Hence, the loci of the eigenvalues lambda[2], and lambda[3] have the point 1/4, -8 in common. Just what this does to the loci remains to be seen.

 

• 

The characteristic equation defines lambda(s) implicitly. Maple's implicitplot command applied to this equation produces Figure 9 in which the curves threrefore represent the loci of the eigenvalues of P(s).

CP:=x^3-(-11+4*s)*x^2-(1104*s^2-472*s+81)*x-10688*s^3+6192*s^2-1476*s-235:
plots:-implicitplot(CP,s=0..1,x=-25..35,labels=[s,typeset(lambda)],gridrefine=5);

 

Figure 9   Loci defined implicitly by the characteristic polynomial

• 

In Figure 10, the loci are graphs of the exact eigenvalues obtained via Maple's Eigenvalues command.

 

• 

The eigenvalues of P(0) are approximately 6.6, -15.3, and -2.3 and the loci emanating from these initial points are colored black, red, and green, respectively. The eigenvalues of P(1) are approximately 27.4, -8.9, and -25.4.

 

• 

The red and green curves, each defined by an exact expression, do not have continuously turning tangents.

P:=Matrix([[3-8*s, 2+16*s, 4-4*s], [2+16*s, -9+20*s, 8-24*s], [4-4*s, 8-24*s, -5-8*s]]):
Q:=LinearAlgebra:-Eigenvalues(P,output=list):
plot(Q,s=0..1,color=[black,red,green],labels=[s,typeset(lambda)]);

 

Figure 10   Loci via graph of exact expressions for the eigenvalues

``

The closed-form expressions for lambda[k](s), k = 2, 3, are continuous, but not C[1]. (This can be established analytically by the calculations in Table 1.) So either the loci of the eigenvalues are defined by the closed-form expressions lambda[k](s) and therefore do not have continuously turning tangents, or the loci are smooth curves and are only piecewise-defined by the analytic expressions lambda[k](s) whose graphs appear in Figure 10. A precise definition of the locus of eigenvalues of a real, symmetric, matrix P(s) is required.

NULL``

P := Matrix(3, 3, {(1, 1) = 3-8*s, (1, 2) = 2+16*s, (1, 3) = 4-4*s, (2, 1) = 2+16*s, (2, 2) = -9+20*s, (2, 3) = 8-24*s, (3, 1) = 4-4*s, (3, 2) = 8-24*s, (3, 3) = -5-8*s})

Lambda := LinearAlgebra:-Eigenvalues(P, output = list)

NULL

simplify(limit(diff(Lambda[2], s), s = 1/4, left)) = -4/7+(4/7)*1534^(1/2)``

simplify(limit(diff(Lambda[2], s), s = 1/4, right)) = -4/7-(4/7)*1534^(1/2)``NULL

simplify(limit(diff(Lambda[3], s), s = 1/4, left)) = -4/7-(4/7)*1534^(1/2)``

simplify(limit(diff(Lambda[3], s), s = 1/4, right)) = -4/7+(4/7)*1534^(1/2)``NULL

Table 1   Calculations showing that lambda[k](s), k = 2, 3, do not define C[1] curves

``

Example 5

NULL

For the matrix P(s) in Example 4, obtain the equivalent of Figure 10 and Table 1, using only numeric calculations.

NULL

Solution

Initializations

• 

Tools_Load Package: Linear Algebra

Loading LinearAlgebra

• 

Tools_Load Package: Plots

Loading plots

• 

Define the matrix P(s).

P := Matrix(3, 3, {(1, 1) = 3-8*s, (1, 2) = 2+16*s, (1, 3) = 4-4*s, (2, 1) = 2+16*s, (2, 2) = -9+20*s, (2, 3) = 8-24*s, (3, 1) = 4-4*s, (3, 2) = 8-24*s, (3, 3) = -5-8*s})

• 

Obtain the characteristic polynomial.

• 

Define CP as a function of s.

CP := CharacteristicPolynomial(P, lambda)NULL

F(s) = CP(->)FNULL

Numeric determination of loci of eigenvalues

• 

The function G returns a list of numerically computed eigenvalues for each given value of the parameter s.

G := proc (t) local r; r := [fsolve(F(t), lambda, complex)]; return r end proc

• 

The list S contains 101 equispaced values of `in`(s, [0, 1]).

• 

Each L[j] is a list of eigenvalues computed at s = s[k], k = 0, () .. (), 100.

S := [seq((1/100)*k, k = 0 .. 100)]; for j to 3 do L[j] := [seq(G((1/100)*k)[j], k = 0 .. 100)] end do

• 

Constructed from the lists S and L[j], each p[j] is a uniquely colored graph of the jth numerically calculated eigenvalue.

C := [red, green, black]; for j to 3 do p[j] := plots:-pointplot(S, L[j], style = line, color = C[j]) end do

• 

Figure 11 assembles the graphs p[j], j = 1, 2, 3, into a single graph via Maple's display command; it shows that the red and green curves share the common point 1/4, -8.

plots:-display(seq(p[j], j = 1 .. 3))

Figure 11   Numerically determined loci

NULL

Slopes on either side of s = 1/4 can be calculated numerically from (D(lambda))(s) computed implicitly from the characteristic polynomial.

NULL

`#mrow(mi("λ",fontstyle = "normal"),mo("′"))` := implicitdiff(CP, lambda, s) = 4*(8016*s^2+552*s*lambda+lambda^2-3096*s-118*lambda+369)/(-1104*s^2-8*s*lambda+3*lambda^2+472*s+22*lambda-81)NULL

NULL

Recall that lambda in diff(lambda(x), x) must be replaced by the appropriate eigenvalue lambda[k](s) which is available only through numeric calculation via the function G. The limiting process used in Table 1 can't be applied here; the requisite numeric calculations are summarized in Table 2.

 

eval(`#mrow(mi("λ",fontstyle = "normal"),mo("′"))`, [s = .2499, lambda = G(.2499)[2]]) = HFloat(-22.963322441134114)

eval(`#mrow(mi("λ",fontstyle = "normal"),mo("′"))`, [s = .2501, lambda = G(.2501)[1]]) = HFloat(-22.960195949561243)

eval(`#mrow(mi("λ",fontstyle = "normal"),mo("′"))`, [s = .2499, lambda = G(.2499)[1]]) = HFloat(21.82900028638478)``

eval(`#mrow(mi("λ",fontstyle = "normal"),mo("′"))`, [s = .2501, lambda = G(.2501)[2]]) = HFloat(21.808800909014742)

Table 2   Numeric calculation of slopes along the loci on either side of s = 1/4

NULL

Example 6

NULL

Find the loci of the eigenvalues of P(s) = (Matrix(5, 5, {(1, 1) = -3+8*s, (1, 2) = 3-6*s, (1, 3) = 6-12*s, (1, 4) = 4-8*s, (1, 5) = 6-12*s, (2, 1) = 3-6*s, (2, 2) = 3+4*s, (2, 3) = 2-4*s, (2, 4) = -7+14*s, (2, 5) = -9+18*s, (3, 1) = 6-12*s, (3, 2) = 2-4*s, (3, 3) = -2+24*s, (3, 4) = 4-8*s, (3, 5) = 3-6*s, (4, 1) = 4-8*s, (4, 2) = -7+14*s, (4, 3) = 4-8*s, (4, 4) = 6+8*s, (4, 5) = 3-6*s, (5, 1) = 6-12*s, (5, 2) = -9+18*s, (5, 3) = 3-6*s, (5, 4) = 3-6*s, (5, 5) = -6+42*s})) for `in`(s, [0, 1]).

NULL

Solution

NULL

Since P(s) is a 5 × 5 matrix, only numeric techniques can be used to find its eigenvalues. However, note that the matrix has been chosen so that the eigenvalues of P(1/2) are 1, 5, 10, 10, and 15.

NULL

In Table 3 the matrix P is defined, and the characteristic polynomial is defined as the function F(s).

NULL

P := Matrix(5, 5, {(1, 1) = -3+8*s, (1, 2) = 3-6*s, (1, 3) = 6-12*s, (1, 4) = 4-8*s, (1, 5) = 6-12*s, (2, 1) = 3-6*s, (2, 2) = 3+4*s, (2, 3) = 2-4*s, (2, 4) = -7+14*s, (2, 5) = -9+18*s, (3, 1) = 6-12*s, (3, 2) = 2-4*s, (3, 3) = -2+24*s, (3, 4) = 4-8*s, (3, 5) = 3-6*s, (4, 1) = 4-8*s, (4, 2) = -7+14*s, (4, 3) = 4-8*s, (4, 4) = 6+8*s, (4, 5) = 3-6*s, (5, 1) = 6-12*s, (5, 2) = -9+18*s, (5, 3) = 3-6*s, (5, 4) = 3-6*s, (5, 5) = -6+42*s}); CP := CharacteristicPolynomial(P, lambda); F := unapply(CP, s)

Table 3   The matrix P and the characteristic polynomial as the function F(s) 

NULL

The characteristic equation, (here, F(s) = 0) defines the loci of the eigenvalues of P implicitly. Figure 12 implements this insight via Maple's implicitplot command applied to the characteristic equation.

 

implicitplot(CP, s = 0 .. 1, lambda = -15 .. 40, labels = [s, lambda], gridrefine = 5)

Figure 12   Loci of eigenvalues defined implicitly by the characteristic equation

NULL

Table 4 shows the calculations needed to solve for the eigenvalues numerically, and to construct the separate loci based on these numeric data.NULL

NULL

• 

The function G returns a list of numerically computed eigenvalues for each given value of the parameter s.

G := proc (t) local r; r := [fsolve(F(t), lambda, complex)]; return r end proc:

• 

The list S contains 101 equispaced values of `in`(s, [0, 1]).

• 

Each L[j] is a list of eigenvalues computed at s = s[k], k = 0, () .. (), 100.

S := [seq((1/100)*k, k = 0 .. 100)]; for j to 5 do L[j] := [seq(G((1/100)*k)[j], k = 0 .. 100)] end do

• 

Constructed from the lists S and L[j], each p[j] is a uniquely colored graph of the jth numerically calculated eigenvalue.

C := [black, red, green, blue, gold]; for j to 5 do p[j] := plots:-pointplot(S, L[j], style = line, color = C[j]) end do

Table 4   Numeric construction of the loci of eigenvalues

NULL

Figure 13 assembles the graphs p[j], j = 1, () .. (), 5, into a single graph via Maple's display command; it shows that the green and blue curves share the common point 1/2, 10.

NULL

plots:-display(seq(p[j], j = 1 .. 5))

Figure 13   Numerically calculated loci of eigenvalues

NULLNULL

For the green and blue curves in Figure 13, slopes on either side of s = 1/2 can be calculated numerically from (D(lambda))(s) computed implicitly from the characteristic polynomial. Table 5 contains the relevant calculations.``

NULL

• 

Obtain (D(lambda))(s) implicitly with Maple's implicitdiff command.

`#mrow(mi("λ",fontstyle = "normal"),mo("′"))` := implicitdiff(CP, lambda, s)NULL

• 

Increase the number of working digits and define values of s on either side of s = 1/2.

Digits := 20; a := .49999999; b := .50000001

Evaluate (D(lambda))(s) on either side of s = 1/2 along the green and blue curves

eval(`#mrow(mi("λ",fontstyle = "normal"),mo("′"))`, [s = a, lambda = G(a)[4]]) = 4.6665969631280606834NULL

eval(`#mrow(mi("λ",fontstyle = "normal"),mo("′"))`, [s = b, lambda = G(b)[3]]) = 4.6665997194197342310

eval(`#mrow(mi("λ",fontstyle = "normal"),mo("′"))`, [s = a, lambda = G(a)[3]]) = 27.333402004025477668``

eval(`#mrow(mi("λ",fontstyle = "normal"),mo("′"))`, [s = b, lambda = G(b)[4]]) = 27.333401289670917418

Table 5   Numeric evaluation of slopes along the green and blue curves in Figure 13

NULL

There are no closed-form expressions for the eigenvalues of this 5 × 5 matrix P(s). The eigenvalues are computed numerically by Maple's Eigenvalues or fsolve commands, each of which return a sorted list of eigenvalues. There is no user-control of this sort, but even if there were, what sorting rule could be invoked across an eigenvalue with algebraic multiplicity greater than 1? It would seem that the only way to define a unique locus of eigenvalues is to require that it be of class C[1], that is, that it have a continuously turning tangent.

NULL

References

``

[1]

Mathematical Thoughts on the Root Locus, Robert J. Lopez, Tips & Techniques, Maple Reporter, July, 2013.

[2]

Using Computer Algebra to Help Understand the Nature of Eigenvalues and Eigenvectors, Michael Monagan, MapleTech, Issue 9, Spring 1993, Birkhäuser.

[3]

Linear Algebra with Applications, 5th ed., Steven J. Leon, 1998, Prentice Hall.

``

 

Legal Notice: © Maplesoft, a division of Waterloo Maple Inc. 2013. Maplesoft and Maple are trademarks of Waterloo Maple Inc. This application may contain errors and Maplesoft is not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact Maplesoft for permission if you wish to use this application in for-profit activities.