3.4 Complex Eigenvalues

October 23, 1998

> with(linalg):
with(DEtools):

Warning, new definition for norm

Warning, new definition for trace

Warning, new definition for adjoint

How to get Maple to do such an example

Consider the planar system with coefficient matrix

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

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

We can then find the eigenvectors and eigenvalues using eigenvectors.

> evects(B):=eigenvectors(B);

evects(B) := [2+3*I, 1, {vector([-1/3*I, 1])}], [2-3*I, 1, {vector([1/3*I, 1])}]

We can then define the complex solution using the first eigenvalue and eigenvector.

> xcomplex:=proc(t) exp([evects(B)][1][1]*t)*[evects(B)][1][3][1][1] end:
ycomplex:=proc(t) exp([evects(B)][1][1]*t)*[evects(B)][1][3][1][2] end:

xcomplex(t);

ycomplex(t);

-1/3*I*exp((2+3*I)*t)

exp((2+3*I)*t)

We get real solutions by taking real and imaginary parts.

> xreal:=proc(t) evalc(Re(xcomplex(t))) end:
yreal:=proc(t) evalc(Re(ycomplex(t))) end:

xim:=proc(t) evalc(Im(xcomplex(t))) end:

yim:=proc(t) evalc(Im(ycomplex(t))) end:

matrix(2,1,[[xreal(t)],[yreal(t)]]);

matrix(2,1,[[xim(t)],[yim(t)]]);

matrix([[1/3*exp(2*t)*sin(3*t)], [exp(2*t)*cos(3*t)]])

matrix([[-1/3*exp(2*t)*cos(3*t)], [exp(2*t)*sin(3*t)]])

And here's what the phase plane looks like.

> phaseportrait([D(x)(t)=2*x(t)+y(t),D(y)(t)=-9*x(t)+2*y(t)],
[x(t),y(t)],t=0..2*Pi/3,

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

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

linecolor=[blue,navy,green,cyan],

stepsize=0.01);

[Plot]

> plot([xreal(t),yreal(t)],t=0..4*Pi/3);

[Plot]

A Linear Second Order Equation Example

This one we have seen before.

Consider the equation

d^2*y/dt^2+2*dy/dt+50*y = 0 .

It has exponential solutions y = e^st for numbers s satisfying the associated quadratic equation

s^2+2*s+50 = 0 ,

that is, s = -1+7*i and s = -1-7*i .  Indeed,  the associated first order system is

dy/dt = v ,

dv/dt = -50*y-2*v ,

and the coefficient matrix is

> A:=matrix([[0,1],[-50,-2]]);

A := matrix([[0, 1], [-50, -2]])

with characteristic polynomial

> charpoly(A,s);

s^2+2*s+50

and eigenvalues

> eigenvalues(A);

-1+7*I, -1-7*I

and the eigenvectors are

> evalA:=eigenvectors(A);

evalA := [-1+7*I, 1, {vector([1, -1+7*I])}], [-1-7*I, 1, {vector([1, -1-7*I])}]

Corresponding to the first eigenvalue and eigenvector we have the solutions

> ycomplex:=proc(t) exp((-1+7*I)*t) end;
vcomplex:=proc(t) (-1+7*I)*exp((-1+7*I)*t) end;

ycomplex := proc (t) exp((-1+7*I)*t) end proc

vcomplex := proc (t) (-1+7*I)*exp((-1+7*I)*t) end proc

We get two independent solutions by taking real and imaginary parts.

> yreal:=proc(t) evalc(Re(ycomplex(t))) end;
vreal:=proc(t) evalc(Re(vcomplex(t))) end;

yim:=proc(t) evalc(Im(ycomplex(t))) end;

vim:=proc(t) evalc(Im(vcomplex(t))) end;

yreal := proc (t) evalc(Re(ycomplex(t))) end proc

vreal := proc (t) evalc(Re(vcomplex(t))) end proc

yim := proc (t) evalc(Im(ycomplex(t))) end proc

vim := proc (t) evalc(Im(vcomplex(t))) end proc

And these give us the solutions we obtained by the guess and test method.

> matrix(2,1,[[yreal(t)],[vreal(t)]]);
matrix(2,1,[[yim(t)],[vim(t)]]);

matrix([[exp(-t)*cos(7*t)], [-exp(-t)*cos(7*t)-7*exp(-t)*sin(7*t)]])

matrix([[exp(-t)*sin(7*t)], [7*exp(-t)*cos(7*t)-exp(-t)*sin(7*t)]])

Indeed, we found one solution to be

> matrix(2,1,[[exp(-t)*sin(7*t)],[diff(exp(-t)*sin(7*t),t)]]);

matrix([[exp(-t)*sin(7*t)], [7*exp(-t)*cos(7*t)-exp(-t)*sin(7*t)]])

The phase portrait we have seen before.

> phaseportrait([D(y)(t)=v(t),D(v)(t)=-50*y(t)-2*v(t)],
[y(t),v(t)],t=0..2,

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

linecolor=[navy,green],

stepsize=0.01);

[Plot]

And here again are the y and v functions plotted.

> plot([exp(-t)*sin(7*t),diff(exp(-t)*sin(7*t),t)],t=0..4,
title="y in red, v in green");

[Plot]