Example with [Maple Math]

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

[Maple Math]

>

> charpoly( A, lambda );

[Maple Math]

> eigenvals( A );

[Maple Math]

Since the eigenvalues have a negative real part, the origin is a spiral sink for this system.

>

> eigenvects( A );

[Maple Math]

>

The linearly independent solutions are found by the usual steps: exp( eigenvalue * t ) * eigenvector, but recall that the two solutions are the real and imaginary parts of this expression. These calculations are messy - by hand. With Maple it's a little better, but there are some extra commands that must be used.

We know that the two solutions will consist of the product of an exponential formed with the real part of the eigenvalues and a vector with trigonometric terms formed using the imaginary part of the eigenvalues. Let's begin by looking at the part of the solution that leads to complex-valued expressions:

> assume( t, real );

> mess := exp( I*sqrt(2)*t ) * matrix( 2, 1, [ 2, I*sqrt(2) ] );

[Maple Math]

> mess2 := convert( evalc( evalm( mess ) ), trig );

[Maple Math]

> messRE := map( Re, mess2 );

[Maple Math]

> messIM := map( Im, mess2 );

[Maple Math]

>

Using the real and imaginary parts we can construct the two linearly independent solutions for this system:

> Y1 := exp(-t) * evalm( messRE );

[Maple Math]

> Y2 := exp(-t) * evalm( messIM );

[Maple Math]

> t := 't':

>

> ode1 := diff( x(t), t ) = -x(t) + 2*y(t);

> ode2 := diff( y(t), t ) = -x(t) - y(t);

> MODEL := { ode1, ode2 }:

[Maple Math]

[Maple Math]

> VARS := { x(t), y(t) }:

> DOMAIN := t=0..3:

> RANGE := x=-2..2, y=-2..2:

> dirPLOT := DEplot( MODEL, VARS, DOMAIN, RANGE, arrows=MEDIUM ):

> dirPLOT;

>

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

> solPLOT := DEplot( MODEL, VARS, DOMAIN, RANGE, IC, arrows=NONE, stepsize=0.1, linecolor=GREEN ):

> #solPLOT;

>

> display( [ dirPLOT, solPLOT ], title=`Example of Spiral Sink` );

>