Homogeneous Linear Systems of ODE's with constant coefficients

We consider systems of the form\(TextForm
    \`x\&⇀' \((t)\)\  = \ A\ \(x\&⇀\) \((t)\)\)\(TextForm
    \`where\ \(x\&⇀\) \((t)\) = \ 
      \((\(x\_1\) \((t)\), \  ... \ , \ \(x\_t\) \((t)\))\)\ is\ a\ vector\ 
        whose\ components\ are\)functions of t,  
    and A is an n×n constant matrix .   For practicalpurposes,  we limit ourselves to the case n = 2.

RHS[x1_, x2_]  :=  A . {x1, x2}

Needs["Graphics`PlotField`"]

Example 1 Source (A has two positive eigenvalues:

We define A in terms of its diagonalization--i.e. in terms of its eigenvalues and eigenvectors.  What, by the way, are its eigenvalues
and eigenvectors here?

A  = {{1, 1}, {1, -1}}  . {{2, 0}, {0, 4}} . 
        Inverse[{{1, 1}, {1, -1}}]

Now we plot the direction field for A.  Unlike direction fields for single ODE's, direction fields for systems suppress the time variable.  This gives us an extra dimension for plotting the dependent variables, but it limits us to autonomous ODE's

directions  =  RHS[x1, x2]

\(\(PlotVectorField[directions, {x1, \(-3\), 3}, {x2, \(-3\), 3}, \ 
      Axes -> \ True, 
	ScaleFunction -> \((1&)\), Ticks -> None, 
      Frame -> True, AspectRatio -> 1, \ PlotPoints\  -> \ 15]; 
    \)\)

\(\(
rhs\  = \ RHS[x1[t], x2[t]]\)\)

Now we set up and solve the differentialequation, letting "a" and "b" be the initial values for
x1 and x2.

\(ivp\  = 
      \ {\(x1'\)[t]\  == \ First[rhs], \ \(x2'\)[t]\  == \ Part[rhs, 2], 

        	\ \ \ \ \ \ \ \ \ \ x1[0]\  == \ a, \ \ \ \ \ \ \ \ \ 
        x2[0]\  == \ b}\)

DSolve[ivp, {x1[t], x2[t]}, t]

soln[t_, a_, b_]  =  Expand[{x1[t], x2[t]} /. First[%]]

\(\(ParametricPlot[
      Evaluate[Table[
			soln[t,  .01*Cos[angle],  .01*Sin[angle]], 

          			{angle, 0, 2*Pi,  .05*Pi}]], 

      	\ \ \ \ \ {t, \(-1.5\), 1.5}, AspectRatio -> Automatic]; \)\)

Note that there are two "straight line" solutions corresponding to the two eigenvectors of A and that other solutions tend to diverge from one of the lines and become parallel to the other.  Given any particular solution curve, the previous plot does not provide any
information about which way the solution moves as t increases.  On
the other hand you can figure this out by looking at the direction field.

Example 2: Saddle Point (A has real eigenvalues of opposite sign)

Same eigenvectors, different eigenvalues:

A  = {{1, 1}, {2, -2}}  . {{ .6, 0}, {0, - .7}} . 
        Inverse[{{1, 1}, {2, -2}}]

The direction field:

directions  =  RHS[x1, x2]

\(\(PlotVectorField[directions, {x1, \(-3\), 3}, {x2, \(-3\), 3}, \ 
      Axes -> \ True, 
	ScaleFunction -> \((1&)\), Ticks -> None, 
      Frame -> True, AspectRatio -> 1, \ PlotPoints\  -> \ 15]; 
    \)\)

The solution

rhs =  RHS[x1[t], x2[t]]

\(ivp\  = 
      \ {\(x1'\)[t]\  == \ First[rhs], \ \(x2'\)[t]\  == \ Part[rhs, 2], 

        	\ \ \ \ \ \ \ \ \ \ x1[0]\  == \ a, \ \ \ \ \ \ \ \ \ 
        x2[0]\  == \ b}\)

DSolve[ivp, {x1[t], x2[t]}, t]

soln[t_, a_, b_]  =  Expand[{x1[t], x2[t]} /. First[%]]

\(\(ParametricPlot[
      Evaluate[Flatten[
          Table[
			soln[t, a, b], 

            			{a, \(-4\), 4, 1}, {b, \(-4\), 4}], 1]], 

      	\ \ \ \ \ {t, \(-2\), 2}, AspectRatio -> Automatic, 

      PlotRange -> {{\(-4\), 4}, {\(-4\), 4}}]; \)\)

Can you guess what will happen if we change the
eigenvalues of A so that both are negative?

Example 3:  Indifferent point (Imaginary eigenvalues)

It's not so easy to specify a real matrix A with imaginary eigenvalues in terms of its diagonalization.  We take a slightly different approach.  Note that the middle matrix has eigenvalues ±i.  Why should A have the same eigenvalues?

A  = {{1, 1}, {2, -1}}  . {{0, 1}, {-1, 0}} . 
        Inverse[{{1, 1}, {2, -1}}]

directions  =  RHS[x1, x2]

\(\(PlotVectorField[directions, {x1, \(-3\), 3}, {x2, \(-3\), 3}, \ 
      Axes -> \ True, 
	ScaleFunction -> \((1&)\), Ticks -> None, 
      Frame -> True, AspectRatio -> 1, \ PlotPoints\  -> \ 15]; 
    \)\)

The solution

rhs  =  RHS[x1[t], x2[t]]

\(ivp\  = 
      \ {\(x1'\)[t]\  == \ First[rhs], \ \(x2'\)[t]\  == \ Part[rhs, 2], 

        	\ \ \ \ \ \ \ \ \ \ x1[0]\  == \ a, \ \ \ \ \ \ \ \ \ 
        x2[0]\  == \ b}\)

DSolve[ivp, {x1[t], x2[t]}, t]

soln[t_, a_, b_]  =  Expand[{x1[t], x2[t]} /. First[%]]

\(\(ParametricPlot[
      Evaluate[Table[
			soln[t, r, 0], 
			{r, 0, 2,  .1}]], 

      	\ \ \ \ \ {t, \(-5\), 5}, AspectRatio -> Automatic]; \)\)

Example  4: Spiral Point (A has complex conjugate eigenvalues)

Note that the middle matrix has eigenvalues 1±i.

A  = {{1, 1}, {2, -2}}  . {{1, 1}, {-1, 1}} . 
        Inverse[{{1, 1}, {2, -2}}]

directions  =  RHS[x1, x2]

\(\(PlotVectorField[directions, {x1, \(-3\), 3}, {x2, \(-3\), 3}, \ 
      Axes -> \ True, 
	ScaleFunction -> \((1&)\), Ticks -> None, 
      Frame -> True, AspectRatio -> 1, \ PlotPoints\  -> \ 15]; 
    \)\)

The solution

\(\(
rhs\  = \ RHS[x1[t], x2[t]]\)\)

\(ivp\  = 
      \ {\(x1'\)[t]\  == \ First[rhs], \ \(x2'\)[t]\  == \ Part[rhs, 2], 

        	\ \ \ \ \ \ \ \ \ \ x1[0]\  == \ a, \ \ \ \ \ \ \ \ \ 
        x2[0]\  == \ b}\)

DSolve[ivp, {x1[t], x2[t]}, t]

soln[t_, a_, b_]  =  Expand[{x1[t], x2[t]} /. First[%]]

\(\(ParametricPlot[
      Evaluate[Table[
			soln[t,  .01*Cos[angle],  .01*Sin[angle]], 

          			{angle, 0, 2*Pi,  .1*Pi}]], 
	\ \ \ \ \ {t, \(-1.5\), 1.5}, 
      AspectRatio -> Automatic]; \)\)

How would this have been different had the eigenvalues been -1±i?

Example  5:  Improper node (A has repeated eigenvalues)

We start with the simplest possible example.

A  = {{1, 1}, {0, 1}}

directions  =  RHS[x1, x2]

\(\(PlotVectorField[directions, {x1, \(-3\), 3}, {x2, \(-3\), 3}, \ 
      Axes -> \ True, 
	ScaleFunction -> \((1&)\), Ticks -> None, 
      Frame -> True, AspectRatio -> 1, \ PlotPoints\  -> \ 15]; 
    \)\)

The solution

\(\(
rhs\  = \ RHS[x1[t], x2[t]]\)\)

\(ivp\  = 
      \ {\(x1'\)[t]\  == \ First[rhs], \ \(x2'\)[t]\  == \ Part[rhs, 2], 

        	\ \ \ \ \ \ \ \ \ \ x1[0]\  == \ a, \ \ \ \ \ \ \ \ \ 
        x2[0]\  == \ b}\)

DSolve[ivp, {x1[t], x2[t]}, t]

soln[t_, a_, b_]  =  Expand[{x1[t], x2[t]} /. First[%]]

\(\(ParametricPlot[
      Evaluate[Table[
			soln[t,  .01*Cos[angle],  .01*Sin[angle]], 

          			{angle, 0, 2*Pi,  .1*Pi}]], 
	\ \ \ \ \ {t, \(-1.5\), 1.5}, 
      AspectRatio -> Automatic]; \)\)

Note that solutions tend toward the same line regardless of whether
t goes to positive or negative infinity.