3.5 Special Cases: Repeated and Zero Eigenvalues

October 26, 1998

> with(DEtools):with(linalg):

Warning, new definition for adjoint

Warning, new definition for norm

Warning, new definition for trace

Repeated Eigenvalues

The exponential of a matrix

The function exp does not give the exponential of a matrix.  The command to issue is exponential.

> A := matrix(2,2,[[3,2],[-1,5]]);

A := matrix([[3, 2], [-1, 5]])

> evalm(exp(A));

matrix([[exp(3), exp(2)], [exp(-1), exp(5)]])

> exponential(A);

matrix([[exp(4)*cos(1)-exp(4)*sin(1), 2*exp(4)*sin(1)], [-exp(4)*sin(1), exp(4)*cos(1)+exp(4)*sin(1)]])

Note that exp simply takes the exponential of each entry.  Where do the trigonometric functions in e^A come from? Well,

> eigenvalues(A);

4+I, 4-I

The exponential of A will involve the exponential of its eigenvalues, and in this case,

> evalc(exp(4+I));

exp(4)*cos(1)+I*exp(4)*sin(1)

Using the matrix exponential to solve planar systems

The mantra is that the solution of the constant coefficient two-dimensional linear initial value problem

> sys:={diff(x(t),t)=a*x(t)+b*y(t),diff(y(t),t)=c*x(t)+d*y(t),
x(0)=k1,y(0)=k2};

sys := {x(0) = k1, y(0) = k2, diff(x(t), t) = a*x(t)+b*y(t), diff(y(t), t) = c*x(t)+d*y(t)}

is obtained taking the coefficient matrix

> A := matrix(2,2,[[a,b],[c,d]]);

A := matrix([[a, b], [c, d]])

multiplying by t , exponentiating

> B := exponential(t*A);

and then multiplying by the initial data

> answer := evalm(B&*vector(2,[k1,k2]));

Example

Let's take the matrix we started with as the coefficient matrix,

> A := matrix(2,2,[[3,2],[-1,5]]);

A := matrix([[3, 2], [-1, 5]])

and initial data x(0) = 3 , y(0) = -2 .  The solution is then

> examplesolution := evalm(exponential(t*A)&*vector(2,[3,-2]));

examplesolution := vector([3*exp(4*t)*cos(t)-7*exp(4*t)*sin(t), -5*exp(4*t)*sin(t)-2*exp(4*t)*cos(t)])

Of course, it is a little silly to get Maple to do it this way, when we have dsolve around.

> exampleanswer := dsolve({D(x)(t)=3*x(t)+2*y(t),D(y)(t)=-x(t)+5*y(t),
x(0)=3,y(0)=-2},{x(t),y(t)});

exampleanswer := {y(t) = -exp(4*t)*(2*cos(t)+5*sin(t)), x(t) = -exp(4*t)*(7*sin(t)-3*cos(t))}

Which is the same thing, after all.

There are reasons to use the exponential.  For example, if one wanted the solutions for many different initial values, but the same coefficient matrix, using the exponential may save time.  (Not that it takes that long.) Or, if one had the matrix and the initial values and didn't want to type in the dsolve command.

What happens with repeated eigenvalues

If the matrix A has repeated eigenvalues, the exponential of tA simplifies to e^(lambda*t)*(I+t*(A-lambda*I)) .  For example:

> A := matrix(2,2,[[7,3],[-3,1]]);
eigenvalues(A);

A := matrix([[7, 3], [-3, 1]])

4, 4

> exponential(t*A);
evalm(exp(4*t)*(array(identity,1..2,1..2)+t*(A-4*array(identity,1..2,1..2))));

matrix([[exp(4*t)+3*t*exp(4*t), 3*t*exp(4*t)], [-3*t*exp(4*t), exp(4*t)-3*t*exp(4*t)]])

matrix([[exp(4*t)*(1+3*t), 3*t*exp(4*t)], [-3*t*exp(4*t), exp(4*t)*(1-3*t)]])

Pictures of phase planes for planar systems with repeated eigenvalues

Example 1

Let's start with

> A := matrix(2,2,[[7,3],[-3,1]]);

A := matrix([[7, 3], [-3, 1]])

which has eigenvectors

> eigenvectors(A);

[4, 2, {vector([-1, 1])}]

> phaseportrait({D(x)(t)=7*x(t)+3*y(t),D(y)(t)=-3*x(t)+y(t)},
[x(t),y(t)],t=-1..0.25,

[[x(0)=0,y(0)=1],[x(0)=0,y(0)=-1],[x(0)=1,y(0)=0],[x(0)=-1,y(0)=0],

[x(0)=-1,y(0)=1],[x(0)=1,y(0)=-1]]);

[Plot]

All the solutions leave the origin tangent to the eigendirection.

Example 2

> B := matrix(2,2,[[-1,-2],[2,-5]]);

B := matrix([[-1, -2], [2, -5]])

> eigenvectors(B);

[-3, 2, {vector([1, 1])}]

> phaseportrait({D(x)(t)=-x(t)-2*y(t),D(y)(t)=2*x(t)-5*y(t)},
[x(t),y(t)],t=-0.33..1,

[[x(0)=0,y(0)=1],[x(0)=0,y(0)=-1],[x(0)=1,y(0)=0],[x(0)=-1,y(0)=0],

[x(0)=1,y(0)=1],[x(0)=-1,y(0)=-1]]);

[Plot]

All solutions approach the origin along the eigendirections.  Note that the side of the eigenline that the solution approaches the origin on depends only on which side of the eigenline the solution is on.  Note that the picture changes very little if we change the matrix very little.

> phaseportrait({D(x)(t)=-x(t)-2*y(t),D(y)(t)=2*x(t)-5.01*y(t)},
[x(t),y(t)],t=-0.33..1,

[[x(0)=0,y(0)=1],[x(0)=0,y(0)=-1],[x(0)=1,y(0)=0],[x(0)=-1,y(0)=0],

[x(0)=1,y(0)=1],[x(0)=-1,y(0)=-1]]);

[Plot]

In this case, however, we have distinct eigenvalues:

> eigenvectors(matrix(2,2,[[-1,-2],[2,-5.01]]));

[-3.146509717, 1, {vector([9.658718135, 10.36626617])}], [-2.863490283, 1, {vector([.7316346124, .6816969955])}]

Here, all solutions approach the origin tangent to the second of these eigenvectors, but which side they approach on depends on which quadrant of the eigenvector system they start in.  It is hard to see that behavior in the picture since the eigendirections are so close to each other.

Zero Eigenvalues

These systems we can solve analytically as we did before.  The difference is that there will be non-zero, constant solutions corresponding to eigenvectors with eigenvalue zero.  This makes the qualitative behavior different.

One zero, one non-zero eigenvalue

The eigenvector with eigenvalue zero in the example below is (1,-1).  All multiples of it are equilibrium points.  The other eigenvalue is 2, so all solutions move away from that line.

> phaseportrait({D(x)(t)=x(t)+y(t),D(y)(t)=x(t)+y(t)},
[x(t),y(t)],t=-1..0.5,

[[x(0)=0,y(0)=1],[x(0)=0,y(0)=-1],[x(0)=1,y(0)=0],[x(0)=-1,y(0)=0],

[x(0)=1,y(0)=-1],[x(0)=-1,y(0)=1]]);

[Plot]

Two zero eigenvalues, not the zero matrix

Here is another repeated eigenvalue example.

> phaseportrait({D(x)(t)=3*x(t)+3*y(t),D(y)(t)=-3*x(t)-3*y(t)},
[x(t),y(t)],t=-1..4.,

[[x(0)=0,y(0)=1],[x(0)=0,y(0)=-1],[x(0)=0,y(0)=2],[x(0)=0,y(0)=-2],

[x(0)=1,y(0)=-1],[x(0)=-1,y(0)=1]]);

[Plot]

The solutions here are lines parallel to the eigendirections.

> dsolve({D(x)(t)=3*x(t)+3*y(t),D(y)(t)=-3*x(t)-3*y(t)},{x(t),y(t)});

{x(t) = 3*t*_C1+_C2+3*t*_C2, y(t) = _C1-3*t*_C1-3*t*_C2}