Phase Plane Analysis of Linear Differential Equations

Description of behavior from coefficients of linear expansion about fixed point

Write a set of function that predict the behavior of the system   d y d t = (

a b
c d
) y for real matrices.

Note: This is a first-order ODE with constant coefficients. Its solution will be a sum of two exponential functions with the form λt . The characteristics of the system of two equations are determined by the eigenvalues and eigenvectors of the matrix of coefficients, as detailed by the analysis and examples presented below.

Note that the eigenvalues are either real or they are complex conjugates (i.e., the eigenvalues are the solutions to  the quadratic equation)

Here is a function to print out a warning if the eigenvalues are inconsistent with a real coefficient matrix:

In[54]:=

EigenConsistency [ eval1_ , eval2_ ] := If [ And [ And [ Im [ eval1 ] 0 , Im [ eval2 ] 0 ] , Conjugate [ eval1 ] eval2 ] , Print [ Coefficients are not real ] ]

Here is a function that prints out information about stability based on the eigenvalues:

In[55]:=

EigenStability [ eval1_ , eval2_ ] := If [ And [ Re [ eval1 ] < 0 , Re [ eval2 ] < 0 ] , Print [ Stable and Attractive ] , If [ Or [ Re [ eval1 ] > 0 , Re [ eval2 ] > 0 ] , Print [ Unstable ] , Print [ Stable Orbits about Fixed Point ] ] ]

Here is a function that prints out information about the type of fixed point:

In[56]:=

EigenTrajectory [ eval1_ , eval2_ ] := If [ Or [ Im [ eval1 ] 0 , Im [ eval2 ] 0 ] , Print [ Circulation ] , If [ ( s1 = Sign [ Re [ eval1 ] ] ) ( s2 = Sign [ Re [ eval2 ] ] ) , Print [ Saddle ] , Print [ Node ] ] ]

Here is a function that collects our other functions

In[57]:=

EigenDescription [ eval1_ , eval2_ ] := Module [ { } , EigenConsistency [ eval1 , eval2 ] ; EigenStability [ eval1 , eval2 ] ; EigenTrajectory [ eval1 , eval2 ] ]

In[58]:=

EigenDescription [ - 1 + , - 1 - ]

Stable and Attractive

Circulation

In[59]:=

EigenConsistency [ 1 + , 1 ]

Here is a function that prints out information about the direction of the eigenvectors

In[60]:=

EigenDirector [ eval_ , { ex_ , ey_ } ] := Module [ { theta = N [ 180 * ArcTan [ ex , ey ] / π ] } , If [ eval > 0 , Print [ Unstable (λ= , eval , ) direction is θ = , theta ] ] ; If [ eval < 0 , Print [ Stable (λ= , eval , ) direction is θ = , theta ] ] ]

Here is a function that uses the coefficients to collect and print the physical information about the fixed point

In[61]:=

LinearDescription [ a_ , b_ , c_ , d_ ] := Module [ { esys , eval1 , eval2 , evec1 , evec2 } , esys = Eigensystem [ { { a , b } , { c , d } } ] ; eval1 = Chop [ esys [ [ 1 , 1 ] ] ] ; eval2 = Chop [ esys [ [ 1 , 2 ] ] ] ; evec1 = Chop [ esys [ [ 2 , 1 ] ] ] ; evec2 = Chop [ esys [ [ 2 , 2 ] ] ] ; EigenDescription [ eval1 , eval2 ] ; Print [ Eigenvalues = , eval1 , and , eval2 ] ; If [ And [ Im [ eval1 ] 0 , Im [ eval1 ] 0 ] , EigenDirector [ eval1 , evec1 ] ; EigenDirector [ eval2 , evec2 ] ] ; esys ]

In[62]:=

LinearDescription [ 1 , .1 , 1 , - 3 ]

Unstable

Saddle

Eigenvalues = - 3.024845673131659 and 1.0248456731316589 SequenceForm Eigenvalues = -3.024845673131659 and 1.0248456731316589

Stable (λ= - 3.024845673131659 ) direction is θ = 91.42325939491276 SequenceForm Stable (λ= -3.024845673131659 ) direction is θ = 91.42325939491276

Unstable (λ= 1.0248456731316589 ) direction is θ = 13.952991853913426 SequenceForm Unstable (λ= 1.0248456731316589 ) direction is θ = 13.952991853913426

Out[62]=

{ { - 3.024845673131659 , 1.0248456731316589 } , { { - 0.024838007970444692 , 0.9996914890905396 } , { 0.9704938837598415 , 0.2411257381217099 } } }

Visualization of Trajectories near Fixed Points in the Plane

Functions to find the solutions for input coefficients (first one for specified initial point; the second one for initial points picked randomly

In[63]:=

LinSol [ a_ , b_ , c_ , d_ , xo_ , yo_ ] := { x [ t ] , p [ t ] } /. Flatten [ DSolve [ { x ' [ t ] a x [ t ] + b p [ t ] , p ' [ t ] c x [ t ] + d p [ t ] , x [ 0 ] xo , p [ 0 ] yo } , { x [ t ] , p [ t ] } , t ] ]

In[64]:=

LinSol [ a_ , b_ , c_ , d_ ] := { x [ t ] , p [ t ] } /. Flatten [ DSolve [ { x ' [ t ] a x [ t ] + b p [ t ] , p ' [ t ] c x [ t ] + d p [ t ] , x [ 0 ] Random [ Real , { - 10 , 10 } ] , p [ 0 ] Random [ Real , { - 10 , 10 } ] } , { x [ t ] , p [ t ] } , t ] ]

In[65]:=

LinSol [ 3 , 2 , - 3 , 2 ]

Out[65]=

{ 4.284814892121187 5 t / 2 Cos [ 23 t 2 ] - 6.117391826839953 5 t / 2 Sin [ 23 t 2 ] , - 8.405698863933955 5 t / 2 Cos [ 23 t 2 ] - 3.6079646260886564 5 t / 2 Sin [ 23 t 2 ] }

Example of a plot for a single directory

In[66]:=

CritPointPlot [ a_ , b_ , c_ , d_ ] := ParametricPlot [ Evaluate [ LinSol [ a , b , c , d ] ] , { t , 0 , 20 } , PlotRange { { - 15 , 15 } , { - 15 , 15 } } ]

In[67]:=

CritPointPlot [ - 1 , - .2 , 1 , - 2 ]

[Graphics:HTMLFiles/Lecture-25_1.gif]

Out[67]=

Graphics

This is not terribly informative.  Construct a function that takes input and plots many paths with arrows that describe the trajectory.  Print out physical interpretations as well.  Supply an argument with  a default definition that indicates the number of trajectories to plot.

In[68]:=

<< Graphics`Arrow`

In[69]:=

CritPointPlotPointsMany [ a_ , b_ , c_ , d_ , howmany_: 100 ] := Module [ { esys , eval1 , eval2 , funcs , data , lendata , gstack , lp , rstack , lstack , magrange , rstackmag , lstackmag } , esys = LinearDescription [ a , b , c , d ] ; Print [ esys ] ; eval1 = esys [ [ 1 , 1 ] ] ; eval2 = esys [ [ 1 , 2 ] ] ; funcs = Table [ Chop [ LinSol [ a , b , c , d ] ] , { i , howmany } ] ; lstack = { } ; rstack = { } ; For [ imany = 1 , imany howmany , imany ++ , data = Chop [ Table [ Evaluate [ funcs [ [ imany ] ] /. t itime ] , { itime , 0 , 20 , .1 } ] ] ; lendata = Length [ data ] ; gstack = { Hue [ 0 ] , Arrow [ data [ [ 1 ] ] , data [ [ 2 ] ] , HeadScaling Absolute ] } ; For [ iend = 4 , iend lendata / 2 , iend += 8 , AppendTo [ gstack , Hue [ iend * 0.66 * 2 / lendata ] ] ; AppendTo [ gstack , Arrow [ data [ [ iend - 1 ] ] , data [ [ iend ] ] , HeadScaling Absolute ] ] ] ; lp = ListPlot [ data , PlotJoined True , AspectRatio 1 , PlotRange { { - 15 , 15 } , { - 15 , 15 } } , PlotStyle Hue [ Random [ ] ] , DisplayFunction Identity ] ; lstack = Show [ lp , Graphics [ gstack ] , lstack ] ; rstack = Show [ lp , rstack ] ] ; If [ Or [ Re [ eval1 ] > 0 , Re [ eval2 ] > 0 ] , magrange = { { - 60 , 60 } , { - 60 , 60 } } , magrange = { { - 1 , 1 } , { - 1 , 1 } } ] ; rstackmag = Show [ rstack , PlotRange magrange ] ; lstackmag = Show [ lstack , PlotRange magrange ] ; Show [ GraphicsArray [ { { lstack , rstack } , { lstackmag , rstackmag } } ] , ImageSize 1000 , DisplayFunction $DisplayFunction ] ]

General :: spell1 : Possible spelling error: new symbol name \" rstack \" is similar to existing symbol \" gstack \". More… "Possible spelling error: new symbol name \\\"\\!\\(rstack\\)\\\" is similar to existing symbol \\\"\\!\\(gstack\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)"

General :: spell : Possible spelling error: new symbol name \" lstack \" is similar to existing symbols { gstack , rstack } . More… "Possible spelling error: new symbol name \\\"\\!\\(lstack\\)\\\" is similar to existing symbols \\!\\({gstack, rstack}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, ButtonData:>\\\"General::spell\\\"]\\)"

General :: spell1 : Possible spelling error: new symbol name \" lstackmag \" is similar to existing symbol \" rstackmag \". More… "Possible spelling error: new symbol name \\\"\\!\\(lstackmag\\)\\\" is similar to existing symbol \\\"\\!\\(rstackmag\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)"

In this first example, the eigenvalues are real and negative, and the system of equations has a stable, attractive node. The eigenvectors are real and correspond to directions along which the system will evolve along a straight trajectory.

In[70]:=

CritPointPlotPointsMany [ - 1 , 0.25 , 0.75 , - 1 ]

Stable and Attractive

Node

Eigenvalues = - 1.4330127018922194 and - 0.5669872981077807 SequenceForm Eigenvalues = -1.4330127018922194 and -0.5669872981077807

Stable (λ= - 1.4330127018922194 ) direction is θ = 120.00000000000001 SequenceForm Stable (λ= -1.4330127018922194 ) direction is θ = 120.00000000000001

Stable (λ= - 0.5669872981077807 ) direction is θ = 60.00000000000001 SequenceForm Stable (λ= -0.5669872981077807 ) direction is θ = 60.00000000000001

{ { - 1.4330127018922194 , - 0.5669872981077807 } , { { - 0.5 , 0.8660254037844385 } , { 0.5 , 0.8660254037844387 } } }

[Graphics:HTMLFiles/Lecture-25_2.gif]

Out[70]=

GraphicsArray

In this next example, the eigenvalues are real and positive, and the system of equations has an unstable node. The eigenvectors are real and correspond to directions along which the system will evolve along a straight trajectory.

In[71]:=

CritPointPlotPointsMany [ 1.25 , - 0.25 , - 0.75 , 0.75 , 200 ]

Unstable

Node

Eigenvalues = 1.5 and 0.5 SequenceForm Eigenvalues = 1.5 and 0.5

Unstable (λ= 1.5 ) direction is θ = - 45. SequenceForm Unstable (λ= 1.5 ) direction is θ = -45.

Unstable (λ= 0.5 ) direction is θ = 71.565051177078 SequenceForm Unstable (λ= 0.5 ) direction is θ = 71.565051177078

{ { 1.5 , 0.5 } , { { 0.7071067811865475 , - 0.7071067811865475 } , { 0.3162277660168379 , 0.9486832980505138 } } }

[Graphics:HTMLFiles/Lecture-25_3.gif]

Out[71]=

GraphicsArray

In this next example, the eigenvalues are real and of opposite sign, and the system of equations has an unstable saddle point. The eigenvectors are real and correspond to directions along which the system will evolve along a straight trajectory.

In[72]:=

CritPointPlotPointsMany [ 1.25 , 0.25 , 0.75 , - 1.75 , 200 ]

Unstable

Saddle

Eigenvalues = - 1.8112494995995996 and 1.3112494995995991 SequenceForm Eigenvalues = -1.8112494995995996 and 1.3112494995995991

Stable (λ= - 1.8112494995995996 ) direction is θ = 94.6687563267693 SequenceForm Stable (λ= -1.8112494995995996 ) direction is θ = 94.6687563267693

Unstable (λ= 1.3112494995995991 ) direction is θ = 13.766192496152701 SequenceForm Unstable (λ= 1.3112494995995991 ) direction is θ = 13.766192496152701

{ { - 1.8112494995995996 , 1.3112494995995991 } , { { - 0.0813950251558419 , 0.9966819201128714 } , { 0.9712748580499135 , 0.23796039611691722 } } }

[Graphics:HTMLFiles/Lecture-25_4.gif]

Out[72]=

GraphicsArray

In this next example, the eigenvalues are complex, with a positive real part, and the system of equations has an unstable circulation pattern. The eigenvectors are complex and and there are no directions along which the system will evolve along a straight trajectory.

In[73]:=

CritPointPlotPointsMany [ - 0.25 , - 2. , 3 , 1.5 ]

Unstable

Circulation

Eigenvalues = 0.6250000000000001 + 2.287875652215391 and 0.6250000000000001 - 2.287875652215391 SequenceForm Eigenvalues = 0.62500000000000012.287875652215391 and 0.6250000000000001-2.287875652215391

{ { 0.6250000000000001 + 2.287875652215391 , 0.6250000000000001 - 2.287875652215391 } , { { - 0.22592402852876603 + 0.590726953281576 , 0.7745966692414834 + 0. } , { - 0.22592402852876603 - 0.590726953281576 , 0.7745966692414834 + 0. } } }

[Graphics:HTMLFiles/Lecture-25_5.gif]

Out[73]=

GraphicsArray

In this next example, the eigenvalues are complex, with a negative real part, and the system of equations has an stable, attractive circulation pattern. The eigenvectors are complex and and there are no directions along which the system will evolve along a straight trajectory.

In[74]:=

CritPointPlotPointsMany [ - 0.25 , - 2. , 2 , - 1.5 ]

Stable and Attractive

Circulation

Eigenvalues = - 0.875 + 1.8998355191963328 and - 0.875 - 1.8998355191963328 SequenceForm Eigenvalues = -0.8751.8998355191963328 and -0.875-1.8998355191963328

{ { - 0.875 + 1.8998355191963328 , - 0.875 - 1.8998355191963328 } , { { 0.22097086912079625 + 0.6716932893813963 , 0.7071067811865478 + 0. } , { 0.22097086912079625 - 0.6716932893813963 , 0.7071067811865478 + 0. } } }

[Graphics:HTMLFiles/Lecture-25_6.gif]

Out[74]=

GraphicsArray

In this final example, the eigenvalues are pure imaginary, and the system of equations exhibit stable orbits around a fixed point. The eigenvectors are complex and and there are no directions along which the system will evolve along a straight trajectory.

In[75]:=

CritPointPlotPointsMany [ - 0.25 , - 2. , 2 , 0.25 ]

Stable Orbits about Fixed Point

Circulation

Eigenvalues = 1.984313483298443 and - 1.984313483298443 SequenceForm Eigenvalues = 01.984313483298443 and 0-1.984313483298443

{ { - 4.316143927509186 × 10 - 17 + 1.984313483298443 , - 4.316143927509186 × 10 - 17 - 1.984313483298443 } , { { 0.7071067811865475 + 0. , - 0.08838834764831842 - 0.701560760020114 } , { 0.7071067811865475 + 0. , - 0.08838834764831842 + 0.701560760020114 } } }

[Graphics:HTMLFiles/Lecture-25_7.gif]

Out[75]=

GraphicsArray


Created by Mathematica  (November 21, 2005) Valid XHTML 1.1!