DE.06 Systems and Flows
TUTORIALS

Needs["Graphics`Colors`"];
Needs["Graphics`FilledPlot`"];

If[MemberQ[{"Global`","Graphics`Common`GraphicsCommon`","Vector3D`"}, 
    Context[ScaleFactor]],Remove["*`ScaleFactor"]];
<<"Graphics`Legend`";
<<"Graphics`Common`GraphicsCommon`";
Remove["*`ScaleFactor"];
Graphics`Colors`GosiaGreen=RGBColor[0, 0.392187, 0];
Off[General::spell];
Off[General::spell1];
Off[ParametricPlot3D::ppcom];
Off[ParametricPlot::ppcom];
Off[Plot::plnr];
Needs["Calculus`Master`"];
Off[Unique::"usym"];
SetOptions[Limit,Analytic->True];

CMView = {2.7, 1.6, 1.2};

Off[Graphics::gpt]

New Vector Drawers

(* :Title:  NewVectorDraw  *)
(* :Author: Bruce Carpenter *)
(* :Summary:  Construct 2 and 3 dimensional vectors,
     arrows, and arrowheads as graphics 
     objects.
*)
(* :Date:  Copyright 1997, Math Everywhere, Inc. 
*)
(*  :Drawbacks:  Since the vectors are drawn out of 
     context, the shapes of the arrowheads are only 
     correct with AspectRatio set to Automatic.
*)
BeginPackage["Vector3D`","Graphics`Colors`"];

Axes3D::usage = "Axes3D[a, b] creates a Graphics3D object of cartesian axes with x, y, and z running from -a/3 to a, and with axes labels b units beyond the tips of the axes.  Axes3D[a] is Axes3D[a, a/8].";

Perpend::usage = "Perpend[a] returns a unit vector which is perpendicular to the vector a.";

Arrow::usage = "Arrow[a] produces a 2 or 3 dimensional vector from the origin to a. Arrow[a, Tail -> tail] gives a vector from tail to a.";
	
Vector::usage = "Vector[a, b] gives a 2D or 3D vector from a to b.";

ArrowHead::usage = "ArrowHead[a, vec] produces an arrowhead with its tip placed at the point a, pointing in the direction of the vector vec.";

Tail::usage = "Tail -> point puts the tail of the vector at point.";

Norm::usage = "Norm[vec] returns the Euclidean length of vec.";

Normalize::usage = "Normalize[vec] returns a unit vector in the direction of vec, provided vec is nonzero.";

Aperture::usage = "Aperture is the ratio of the radius of the base to the length of the head of a vector.";

TipSize::usage = "TipSize specifies an absolute size for the inner tip length of the head of a vector.";

TipRatio::usage = "TipRatio is the ratio of the inner length of the arrowhead to the length of the shaft of a vector.";

HeadRatio::usage = "HeadRatio is the ratio of the outer length of the arrowhead to the length of the shaft of a vector.";

HeadSize::usage = "HeadSize specifies an absolute size for the head of a vector.";

ScaleFactor::usage = "ScaleFactor specifies the amount to scale a vector in length and may be either a number or a pure function.";

ZeroVectorPointSize::usage = "ZeroVectorPointSize is the size of the point used to represent a zero vector.";

Options[Vector] = Options[Arrow] = Options[ArrowHead] =
{HeadRatio -> 0.18, TipRatio -> 0.14, Aperture -> 0.3, ScaleFactor -> 1, HeadType -> Polygon, ShaftQ -> True, EdgesQ -> True, VectorColor -> RGBColor[0,0,1], ShaftWidth -> 0.005, ZeroVectorPointSize -> 0.01};
		
Begin["`Private`"];

SetOptions[ParametricPlot,AspectRatio -> Automatic];
SetOptions[Plot,AspectRatio -> Automatic];
SetOptions[Graphics,AspectRatio -> Automatic];

Axes3D[u_,v_] := 
      Graphics3D[{
            {Blue,Line[{{-u/3,0,0},{u,0,0}}]},
                    Text["x",{u + v,0,0}],
            {Blue,Line[{{0,-u/3,0},{0,u,0}}]},
                    Text["y",{0, u + v,0}],
            {Blue,Line[{{0,0,-u/3},{0,0,u}}]},
                    Text["z",{0,0,u + v}]}]; 
Axes3D[u_] := Axes3D[u,u/8];
				
Norm[a_?VectorQ] := N[Sqrt[a.a]];

Normalize[a_?VectorQ] := If[a.a == 0, a, a/Norm[a]];

Perpend[a_?VectorQ] := Normalize[{a[[2]],-a[[1]]}]/;Length[a]==2
Perpend[a_?VectorQ] := Normalize[If[a[[1]]==0,{1,0,0},{0,a[[3]],-a[[2]]}]]/;Length[a]==3

Base3D = Table[{Cos[2 k Pi/8.], Sin[2 k Pi/8.]},{k,0,8}]; 

Vector[from_?VectorQ, to_?VectorQ, opts___] := Module[
   {sq, sw, ht, hs, hr, tr, ap, sf, vc, zvps, diff = to - from, tip},
   {sq, sw, ht, hs, hr, ts, tr, ap, sf, vc, zvps} = {ShaftQ, ShaftWidth, HeadType, HeadSize, HeadRatio, TipSize, TipRatio, Aperture, ScaleFactor, VectorColor, ZeroVectorPointSize} /. {opts} /. Options[Vector];
   If[from==to, Return[Graphics[{PointSize[zvps],vc,Point[from]}]]];
   diff = If[NumberQ[N[sf]], sf diff, sf[diff]];
   tip = from + diff;
   If[NumberQ[hs], hr = hs/Norm[diff]; tr = 0.75 hr];
   If[NumberQ[ts], tr = ts/Norm[diff]];
   Graphics[{If[sq,{vc,Thickness[sw],Line[{from,tip - tr diff}]},{}],
      With[{trans = ap hr Norm[diff] Perpend[diff]},
      {vc, Thickness[sw], ht[{tip,
                   (tip - hr diff + trans),
                   (tip - tr diff),
                   (tip - hr diff - trans),tip}]}]}]
] /; Length[from]==Length[to]==2

Vector[from_?VectorQ, to_?VectorQ, opts___] := Module[
   {sq, eq, sw, hs, hr, tr,ap, sf, vc, zvps, diff = to - from, tip},
   {sq, eq, sw, hs, hr, ap, sf, vc, zvps} = {ShaftQ, EdgesQ, ShaftWidth, HeadSize, HeadRatio, Aperture, ScaleFactor, VectorColor, ZeroVectorPointSize} /. {opts} /. Options[Vector];
   If[from==to, Return[Graphics3D[{PointSize[zvps],vc,Point[from]}]]];
   diff = If[NumberQ[N[sf]], sf diff, sf[diff]];
   tip = from + diff;
   If[NumberQ[hs], hr = hs/Norm[diff]];
   tr = hr/2;
   Graphics3D[{If[sq,{vc,Thickness[sw],Line[{from,tip-tr diff}]},{}], If[eq, {}, EdgeForm[]], {SurfaceColor[vc],
      With[{temp = Perpend[diff]},
      Polygon[Append[#,tip]]& /@ Partition[(tip - hr diff + #)&/@((ap hr Norm[diff] Base3D) . {temp,Normalize[Cross[temp,diff]]}),2,1]]}}]
] /; Length[from]==Length[to]==3


Arrow[a_, Tail->b_, opts___] := Vector[b,a+b,opts]

Arrow[a_, opts___] := Vector[Table[0,{Length[a]}],a,opts]

ArrowHead[a_, b_, opts___] := Vector[a-b,a,ShaftQ->False,opts];

End[];

EndPackage[];
Null

VectorField and Phase Lines

(*  :Title: VectorAndPhase.m  *)

(*  :Author:  Bill Davis  *)

(*  :Dates:  about March, 1996 *)

(*  :Drawbacks:  I wish someone serious would come and turn these into
                 Really carefully done packages.  *)

BeginPackage["PhaseStuff`","Vector3D`",
		"Utilities`FilterOptions`"];

PhaseLine::usage = "PhaseLine[fcn,{var,a,b},tint,pos]
	makes a vertical phase line for the function, fcn, of the variable, var,
	for the variable going from a to b, with 
	a color given by tint,  at the x-coordinate pos.";
	
PhaseLine3D::usage = "PhaseLIne3D[fcn,{var,a,b},tint,loc]
	makes a vertical phase line for the function, fcn, of the variable, var,
	for the variable going from a to b, with 
	a color given by tint, and base point at loc = {x,y}";
	
VectorField::usage = "VectorField[{function,{var1,a,b,space1},{var2,c,d,space2}]
	will make a vector field of normalized vectors, colored by
	magnitude, for the function of the variables on the
	range {r1,r2} with spacing between points given by 
	{space1, space2}.  If a single function of a single variable is given,
	the vector field {1,f} will be plotted.";
	
StikPikXZ::usage = "StikPikXZ[picture,a:_0] takes a 2 dimensional
	Mathematica picture and embeds it on the XZ plane at y = a.  
	Some optional characteristics of the graphs are lost in the 
	process.  StikPikYZ and StikPikXZ are similar.";
	
StikPikYZ::usage = "StikPikYZ[picture,a:_0] takes a 2 dimensional
	Mathematica picture and embeds it on the XZ plane at y = a.  
	Some optional characteristics of the graphs are lost in the 
	process.  StikPikYZ and StikPikXZ are similar.";
	
StikPikXY::usage = "StikPikXY[picture,a:_0] takes a 2 dimensional
	Mathematica picture and embeds it on the XZ plane at y = a.  
	Some optional characteristics of the graphs are lost in the 
	process.  StikPikYZ and StikPikXZ are similar.";
	
Begin["`Private`"];	

PhaseLine[fcn_,{var_,a_,b_},tint_,pos_:0] := 
	Module[{len,len1,k,zset,zero,zero1,signs,stick,dots,pointers},
	zset = Solve[fcn==0,var];
	zero = If[Length[zset]==0,{},var/.zset];
	zero = Sort[zero];
	zero = Select[zero,((# >= a)&&(# <= b))&];
	zero1 = Sort[Union[zero,{a,b}]];
	len = Length[zero];
	len1 = Length[zero1];
	signs = Table[Sign[fcn/.var->((zero1[[k+1]] + zero1[[k]])/2)],
		{k,1,len1-1}];
	stick = {Thickness[0.007],Line[{{pos,a},{pos,b}}]};
	dots = Point[{pos,#}]&/@zero;
	dots = Join[{PointSize[0.05],tint},dots];
	heads = Table[MakeHead[zero1[[k]],zero1[[k+1]],pos,
		signs[[k]],b-a,tint],{k,1,len1-1}];
	Return[{Graphics[Join[{tint},stick,dots]],heads}]
		]
		
MakeHead[a_,b_,c_,s_,slen_,tint_] := Module[{u,v,w},
	u = Min[2(b-a),3/4 slen];
	Return[ArrowHead[{c,a(.5-s/5)+b(.5+s/5)},
		{0,s u},VectorColor->tint]]]
		
PhaseLine3D[fcn_,{var_,a_,b_},tint_,pos_:{0,0}] := 
	Module[{len,len1,k,zset,zero,zero1,signs,stick,dots,pointers},
	zset = Solve[fcn==0,var];
	zero = If[Length[zset]==0,{},var/.zset];
	zero = Sort[zero];
	zero = Select[zero,((# >= a)&&(# <= b))&];
	zero1 = Sort[Union[zero,{a,b}]];
	len = Length[zero];
	len1 = Length[zero1];
	signs = Table[Sign[fcn/.var->((zero1[[k+1]] + zero1[[k]])/2)],
		{k,1,len1-1}];
	stick = {Thickness[0.007],Line[{{pos[[1]],pos[[2]],a},
		{pos[[1]],pos[[2]],b}}]};
	dots = Point[{pos[[1]],pos[[2]],#}]&/@zero;
	dots = Join[{PointSize[0.03],tint},dots];
	heads = Table[MakeHead3D[zero1[[k]],zero1[[k+1]],pos,
		signs[[k]],b-a,tint],{k,1,len1-1}];
	Return[{Graphics3D[Join[{tint},stick,dots]],heads}]
		]
		
MakeHead3D[a_,b_,c_,s_,slen_,tint_] := Module[{u,v,w},
	u = Min[2(b-a),1/2 slen];
	Return[ArrowHead[{c[[1]],c[[2]],a(.5-s/5)+b(.5+s/5)},
		{0,0,s u},VectorColor->tint]]]
		
		
VectorField[function_List,{var1_,a_,b_,sp1_:1},{var2_,c_,d_,sp2_:1}] := 
	Module[{i,j,U,V,UU,VV,ulow,uhigh,vlow,vhigh,maxval,minval,
		lengths,directions,locations,mlen},
	mlen = Min[sp1,sp2];
	normf[uu_,vv_] = Sqrt[function[[1]]^2+function[[2]]^2]/.
		{var1->uu,var2->vv};
	lengths = Table[N[normf[U,V]],{U,a,b,sp1},{V,c,d,sp2}];
	maxval = Max[lengths]; minval = Min[lengths];
	If[minval == maxval,maxval += 1];
	locations = Table[{uu,vv},{uu,a,b,sp1},
		{vv,c,d,sp2}];
	directions = Table[If[N[normf[U,V]]==0,{0,0},
		mlen (function/.{var1->U,var2->V})/(1.3 N[normf[U,V]])],
			{U,a,b,sp1},{V,c,d,sp2}];
	{UU,VV} = Dimensions[directions][[{1,2}]];
	Return[Table[Arrow[directions[[i,j]],
			Tail->locations[[i,j]],Aperture->1,
			HeadRatio->.4,ShaftWidth->0.008, VectorColor->
			RGBColor[(lengths[[i,j]] - minval)/(maxval-minval),0,
				(maxval -lengths[[i,j]])/(maxval-minval)]],{i,UU},{j,VV}]]
		]
		
VectorField[function_,{var1_,a_,b_,sp1_:1},{var2_,c_,d_,sp2_:1}] :=
	VectorField[{1,function},{var1,a,b,sp1},{var2,c,d,sp2}]
	
	
Needs["Utilities`FilterOptions`"]

FixOptions[a_] := Module[{picture = a, opt3},
If[Options[picture] != {}, 
	opt3 = FilterOptions[Graphics3D,#]&/@Options[picture];
	(* Fix things that might carry 2D characteristics. *)
	opt3 = opt3//. {(AxesLabel -> _) ->(AxesLabel -> None),
			(PlotRange->_) -> (PlotRange->Automatic),
			(PlotRegion -> _) -> (PlotRegion -> Automatic),
			(Ticks -> _) -> (Ticks -> Automatic)};
	picture = Apply[List,picture];
	picture[[-1]] = opt3;
	picture = Apply[Graphics3D,picture]];
	Return[picture]
	]

StikPikXZ[picture_,a_:0] := Module[{PIK3 = picture},
	PIK3 = PIK3//.{Graphics->Graphics3D,
		{u_?NumberQ,v_?NumberQ}:>{u,a,v}};
	PIK3 = FixOptions[PIK3];
	Return[PIK3]
		]


StikPikYZ[picture_,a_:0] := Module[{PIK3 = picture},
	PIK3 = PIK3//.{Graphics->Graphics3D,
		{u_?NumberQ,v_?NumberQ}:>{a,u,v}};
	PIK3 = FixOptions[PIK3];
	Return[PIK3]
		]


StikPikXY[picture_,a_:0] := Module[{PIK3 = picture},
	PIK3 = PIK3//.{Graphics->Graphics3D,
		{u_?NumberQ,v_?NumberQ}:>{u,v,a}};
	PIK3 = FixOptions[PIK3];
	Return[PIK3]
		]
		
End[];

EndPackage[];
Null

ThreeAxes[u,v]

ThreeAxes[u_,v_] := 
      Graphics3D[{
            {Blue,Line[{{-u,0,0},{u,0,0}}]},
                    Text["x",{u + v,0,0}],
            {Blue,Line[{{0,-u,0},{0,u,0}}]},
                    Text["y",{0, u + v,0}],
            {Blue,Line[{{0,0,0},{0,0,u}}]},
                    Text["z",{0,0,u + v}]}]; 
ThreeAxes[u_] := ThreeAxes[u,u/8];
ThreeAxes::usage = "ThreeAxes[a,b] makes a standard cartesian axis graphics object
	with x, y, and z running from -a to a, and with axis
	labels b units beyond the tips of the axes.  ThreeAxes[a]
	is ThreeAxes[a,a/8].";

Crisscross

Clear[x];
crisscross = Plot[{Cos[x],Sin[x]},{x,Pi/8,3 Pi/8},
    PlotStyle->{{RGBColor[1,0,0],Thickness[0.02]}},
    Axes->None,AspectRatio->1/3,
    DisplayFunction->Identity];

T.1)  Flow analysis of systems of two first order diffeq's

T.1.a) This system sucks

Here's a system of differential equations:

\(Clear[m, n, x, y, t]; 
m[x_, y_]\  = \ \(-1.4\)\ x\  - \ 0.43\ y; 

    n[x_, y_]\  = \ 0.70\ x\  - \ 0.78\ y; 


    diffeqsystem\  = \ 
      \(({\(x'\)[t], \(y'\)[t]}\  == \ {m[x[t], y[t]], n[x[t], y[t]]})\); 

    ColumnForm[Thread[diffeqsystem]]\)

Do a flow analysis of this system.

To get an idea about what happens to the solutions x[t] and y[t] as t grows and grows, look at this scaled plot of   Field[x, y] = {m[x, y], n[x, y]}:

\(Clear[Field]; 
Field[x_, y_] = {m[x, y], n[x, y]}\){xlow, xhigh} = {-4, 4}; {ylow, yhigh} = {-4, 4}; jump = 0.5; \(flowplot = 
      Table[Arrow[{m[x, y], n[x, y]}, Tail -> {x, y}, 
          VectorColor -> Blue, ScaleFactor -> 0.25, 
          HeadSize -> 0.3], {x, xlow, xhigh, jump}, {y, ylow, yhigh, 
          jump}]; 


    Show[flowplot, Axes -> True, AxesLabel -> {"x", "y"}]; 
    \)

The plot makes it pretty clear that all the trajectories are sucked in toward {0, 0}. 
Interpretation: 
If {x[t], y[t]} solves:

ColumnForm[Thread[diffeqsystem]]

Then you can be very confident that
x[t] -> 0  and y[t] -> 0 as t -> ∞.
      
You can confirm this by dropping in some corks.
Try a cork at a random starting point;

{xstarter, ystarter} = {Random[Real, {xlow, xhigh}], 
        Random[Real, {ylow, yhigh}]}; endtime = 8; starterpoint = {xstarter, ystarter}
Clear[x, y, t];
xdiffeq=x'[t]==m[x[t], y[t]];
ydiffeq=y'[t]==n[x[t], y[t]];xstartereqn = x[0] == xstarter; ystartereqn = y[0] == ystarter; \(ndssol = 
      NDSolve[{xdiffeq, ydiffeq, xstartereqn, ystartereqn}, {x[t], y[t]}, {t, 
          0, endtime}]; 

Clear[trajectory]; 

    trajectory[t_] = {
        x[t] /. ndssol[[1]], 
        y[t] /. ndssol[[1]]}; 

    trajectoryplot = 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
        PlotStyle -> {{CadmiumOrange, Thickness[0.015]}}, 
        DisplayFunction -> Identity]; 

    starterplot = Graphics[{Red, PointSize[0.06], Point[starterpoint]}]; 


    Show[flowplot, starterplot, trajectoryplot, PlotRange -> All, 
      Axes -> True, AxesLabel -> {"x", "y"}, 
      DisplayFunction -> $DisplayFunction]; \)

Sucked into {0, 0} everytime.

T.1.b) This system propels

Here's a new system of differential equations:

\(Clear[m, n, x, y, t]; 
m[x_, y_]\  = \ 1.2\ x\  - \ 0.2\ y; 

    n[x_, y_]\  = \ \(-0.2\)\ \ x\  + \ 0.7\ y; 


    diffeqsystem\  = \ 
      \(({\(x'\)[t], \(y'\)[t]}\  == \ {m[x[t], y[t]], n[x[t], y[t]]})\); 

    ColumnForm[Thread[diffeqsystem]]\)

Do a flow analysis of this system.

To get an idea about what happens to the solutions x[t] and y[t] as t grows and grows,  look at this scaled plot of  Field[x, y] = {m[x, y], n[x, y]}:

\(Clear[Field]; 
Field[x_, y_] = {m[x, y], n[x, y]}; 

    \({xlow, xhigh} = {\(-4\), 4}; \)\){ylow, yhigh} = {-4, 4}; jump = 0.5; scalefactor = 0.35; \(flowplot = 
      Table[Arrow[{m[x, y], n[x, y]}, Tail -> {x, y}, 
          VectorColor -> Blue, ScaleFactor -> 0.4, 
          HeadSize -> 0.4], {x, xlow, xhigh, jump}, {y, ylow, yhigh, 
          jump}]; 


    Show[flowplot, Axes -> True, AxesLabel -> {"x", "y"}]; 
    \)

A vector orgasm.
The plot makes it pretty clear that all the trajectories are propelled away from {0, 0}. 
Interpretation: 
If {x[t], y[t]} solves:

ColumnForm[Thread[diffeqsystem]]

Then you can be very confident that
       either Abs[x[t]] or Abs[y[t]]
(and probably both) will be very large when t is big. You can confirm this by dropping in some corks.
Try a cork starting at a random point near {0, 0}.

h = 0.3; s = Random[Real, {0, 2 π}]; {xstarter, ystarter} = {h Cos[s], h Sin[s]}; endtime = 5; starterpoint = {xstarter, ystarter};

Clear[x, y, t];
xdiffeq=x'[t]==m[x[t], y[t]];
ydiffeq=y'[t]==n[x[t], y[t]];xstartereqn = x[0] == xstarter; ystartereqn = y[0] == ystarter; \(ndssol = 
      NDSolve[{xdiffeq, ydiffeq, xstartereqn, ystartereqn}, {x[t], y[t]}, {t, 
          0, endtime}]; 

Clear[trajectory]; 

    trajectory[t_] = {
        x[t] /. ndssol[[1]], 
        y[t] /. ndssol[[1]]}; 

    trajectoryplot = 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
        PlotStyle -> {{CadmiumOrange, Thickness[0.015]}}, 
        DisplayFunction -> Identity]; 

    starterplot = Graphics[{Red, PointSize[0.06], Point[starterpoint]}]; 


    Show[flowplot, starterplot, trajectoryplot, 
      PlotRange -> {{xlow - 1, xhigh + 1}, {ylow - 1, yhigh + 1}}, 
      Axes -> True, AxesLabel -> {"x", "y"}, 
      DisplayFunction -> $DisplayFunction]; \)

Away it goes off the screen.

T.1.c) This system sucks and propels

Here's another system of differential equations:

\(Clear[m, n, x, y, t]; 
m[x_, y_]\  = \ 1.2\ y; 

    n[x_, y_]\  = \ 0.7\ x; 


    diffeqsystem\  = \ 
      \(({\(x'\)[t], \(y'\)[t]}\  == \ {m[x[t], y[t]], n[x[t], y[t]]})\); 

    ColumnForm[Thread[diffeqsystem]]\)

Do a flow analysis of this system.

To get an idea about what happens to the solutions x[t] and y[t] as t grows and grows, you look at this scaled plot of  Field[x, y] = {m[x, y],  n[x, y]}:

\(Clear[Field]; 
Field[x_, y_] = {m[x, y], n[x, y]}; 

    \({xlow, xhigh} = {\(-4\), 4}; \)\){ylow, yhigh} = {-4, 4}; jump = 0.5; scalefactor = 0.4; \(flowplot = 
      Table[Arrow[{m[x, y], n[x, y]}, Tail -> {x, y}, 
          VectorColor -> Blue, ScaleFactor -> 0.4, 
          HeadSize -> 0.4], {x, xlow, xhigh, jump}, {y, ylow, yhigh, 
          jump}]; 


    Show[flowplot, Axes -> True, AxesLabel -> {"x", "y"}]; 
    \)

In and out.
The plot makes it pretty clear that all the trajectories are eventually propelled away from {0, 0}, but many of them have been sucked toward {0, 0} first.
Interpretation: 
If {x[t], y[t]} solves:

ColumnForm[Thread[diffeqsystem]]

Then you can be very confident that
         Abs[x[t]] and Abs[y[t]] will be very large when t is big. 
You can confirm this by dropping in some corks.
Try a cork in the flow starting at a random point:;

h = Random[Real, {1, 3}];
s = Random[Real, {0, 2 π}];
{xstarter, ystarter} = {h Cos[s], h Sin[s]};
endtime = 5;
starterpoint = {xstarter, ystarter};

Clear[x, y, t];
xdiffeq=x'[t]==m[x[t], y[t]];
ydiffeq=y'[t]==n[x[t], y[t]];
xstartereqn = x[0] == xstarter;
ystartereqn = y[0] == ystarter;ndssol = 
        NDSolve[{xdiffeq, ydiffeq, xstartereqn, ystartereqn}, {x[t], y[t]}, {
            t, 0, endtime}];

Clear[trajectory];
trajectory[t_] = {
          x[t] /. ndssol[[1]], 
          y[t] /. ndssol[[1]]};

trajectoryplot = 
        ParametricPlot[trajectory[t], {t, 0, endtime}, 
          PlotStyle -> {{CadmiumOrange, Thickness[0.015]}}, 
          DisplayFunction -> Identity];starterplot = 
        Graphics[{Red, PointSize[0.06], Point[starterpoint]}];

Show[flowplot, starterplot, trajectoryplot, 
        PlotRange -> {{xlow - 1, xhigh + 1}, {ylow - 1, yhigh + 1}}, 
        Axes -> True, AxesLabel -> {"x", "y"}, 
        DisplayFunction -> $DisplayFunction];

Sucked in toward {0, 0} and then propelled away.
See the individual solution plots for the last one:

Plot[
      x[t] /. ndssol[[1]], {t, 0, 
        endtime}, PlotStyle -> {{Thickness[0.01], Magenta}}, 
      AxesLabel -> {"t", "x[t]"}, 
      PlotRange -> {xlow - 10, xhigh + 10}, AspectRatio -> (1/2)];

Plot[
      y[t] /. ndssol[[1]], {t, 0, 
        endtime}, PlotStyle -> {{Thickness[0.01], Red}}, 
      AxesLabel -> {"t", "y[t]"}, 
      PlotRange -> {ylow - 10, yhigh + 10}, AspectRatio -> (1/2)];

Play until you're comfortable.

T.1.d) This system oscillates

Here's another system of differential equations:

\(Clear[m, n, x, y, t]; 
m[x_, y_]\  = \ \ 1.3\ y; 

    n[x_, y_]\  = \ \(-0.7\)\ x; 


    diffeqsystem\  = \ 
      \(({\(x'\)[t], \(y'\)[t]}\  == \ {m[x[t], y[t]], n[x[t], y[t]]})\); 

    ColumnForm[Thread[diffeqsystem]]\)

Do a flow analysis of this system.

To get an idea about what happens to the solutions as t grows and grows, look at this scaled plot of Field[x, y] = {m[x, y], n[x, y]}:

\(Clear[Field]; 
Field[x_, y_] = {m[x, y], n[x, y]}; 

    \({xlow, xhigh} = {\(-4\), 4}; \)\){ylow, yhigh} = {-4, 4}; jump = 0.5; scalefactor = 0.4; \(flowplot = 
      Table[Arrow[{m[x, y], n[x, y]}, Tail -> {x, y}, 
          VectorColor -> Blue, ScaleFactor -> 0.4, 
          HeadSize -> 0.5], {x, xlow, xhigh, jump}, {y, ylow, yhigh, 
          jump}]; 


    Show[flowplot, Axes -> True, AxesLabel -> {"x", "y"}]; 
    \)

Whirl.
The plot gives the strong message that all the trajectories oscillate around {0,0}. Throw in an actual trajectory to confirm:

h = Random[Real, {1, 3}]; s = Random[Real, {0, 2 π}]; {xstarter, ystarter} = {h Cos[s], h Sin[s]}; endtime = 8; starterpoint = {xstarter, ystarter}; xdiffeq=x'[t]==m[x[t], y[t]];ydiffeq=y'[t]==n[x[t], y[t]];xstartereqn = x[0] == xstarter; ystartereqn = y[0] == ystarter; \(ndssol = 
      NDSolve[{xdiffeq, ydiffeq, xstartereqn, ystartereqn}, {x[t], y[t]}, {t, 
          0, endtime}]; 

Clear[trajectory]; 

    trajectory[t_] = {
        x[t] /. ndssol[[1]], 
        y[t] /. ndssol[[1]]}; 

    trajectoryplot = 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
        PlotStyle -> {{CadmiumOrange, Thickness[0.015]}}, 
        DisplayFunction -> Identity]; 

    starterplot = Graphics[{Red, PointSize[0.06], Point[starterpoint]}]; 


    Show[flowplot, starterplot, trajectoryplot, 
	PlotRange -> All, 
      Axes -> True, AxesLabel -> {"x", "y"}, 
      DisplayFunction -> $DisplayFunction]; \)

Flow interpretation: 
If {x[t], y[t]} solves:

ColumnForm[Thread[diffeqsystem]]

Then you can be very confident that both 
x[t] and y[t] will cycle over and over like shifted sine or cosine curves.
Take a look for a random starting point:

{xstarter, ystarter} = {Random[Real, {xlow, xhigh}], 
        Random[Real, {ylow, yhigh}]}; endtime = 15;

Clear[x, y, t];
xdiffeq=x'[t]==m[x[t], y[t]];
ydiffeq=y'[t]==n[x[t], y[t]];xstartereqn = x[0] == xstarter; ystartereqn = y[0] == ystarter; ndssol = 
      NDSolve[{xdiffeq, ydiffeq, xstartereqn, ystartereqn}, {x[t], y[t]}, {t, 
          0, endtime}]; x[t_] = x[t] /. ndssol[[1]]; \(y[t_] = y[t] /. ndssol[[1]]; 


    Plot[x[t], {t, 0, endtime}, 
      PlotStyle -> {{Thickness[0.01], Magenta}}, 
      AxesLabel -> {"t", "x[t]"}, AspectRatio -> 1\/2, 
      PlotLabel -> "x[t] solution plot"]; 


    Plot[y[t], {t, 0, endtime}, PlotStyle -> {{Thickness[0.01], Red}}, 
      AxesLabel -> {"t", "y[t]"}, AspectRatio -> 1\/2, 
      PlotLabel -> "y[t] solution plot"]; \)

Yessiree Beavis.

T.1.e) This system sucks and whirls

Here's another system of differential equations:

\(Clear[m, n, x, y, t]; 
m[x_, y_]\  = \ \ \(-1.2\)\ x\  + \ 2.6\ y; 

    n[x_, y_]\  = \ \(-0.7\)\ x\  + \ 0.2\ y; 


    diffeqsystem\  = \ 
      \(({\(x'\)[t], \(y'\)[t]}\  == \ {m[x[t], y[t]], n[x[t], y[t]]})\); 

    ColumnForm[Thread[diffeqsystem]]\)

Do a flow analysis of this system.

To get an idea about what happens to the solutions as t grows and grows, you look at this scaled plot of Field[x, y] = {m[x, y], n[x, y]}:

\(Clear[Field]; 
Field[x_, y_] = {m[x, y], n[x, y]}\){xlow, xhigh} = {-4, 4}; {ylow, yhigh} = {-4, 4}; jump = 0.5; \(flowplot = 
      Table[Arrow[{m[x, y], n[x, y]}, Tail -> {x, y}, 
          VectorColor -> Blue, ScaleFactor -> 0.2, 
          HeadSize -> 0.4], {x, xlow, xhigh, jump}, {y, ylow, yhigh, 
          jump}]; 


    Show[flowplot, Axes -> True, AxesLabel -> {"x", "y"}]; 
    \)

Whirl and suck.
The plot gives the strong message that all the trajectories oscillate and that all the trajectories are sucked toward {0, 0}. 
Throw in an actual trajectory to confirm:

{xstarter, ystarter} = {Random[Real, {xlow, xhigh}], 
        Random[Real, {ylow, yhigh}]}; endtime = 12; starterpoint = {xstarter, ystarter}; xdiffeq=x'[t]==m[x[t], y[t]];ydiffeq=y'[t]==n[x[t], y[t]];xstartereqn = x[0] == xstarter; ystartereqn = y[0] == ystarter; \(ndssol = 
      NDSolve[{xdiffeq, ydiffeq, xstartereqn, ystartereqn}, {x[t], y[t]}, {t, 
          0, endtime}]; 

Clear[trajectory]; 

    trajectory[t_] = {
        x[t] /. ndssol[[1]], 
        y[t] /. ndssol[[1]]}; 

    \(trajectoryplot = 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
        PlotStyle -> {{CadmiumOrange, Thickness[0.015]}}, 
        DisplayFunction -> Identity]; \)\)\(starterplot = Graphics[{Red, PointSize[0.06], Point[starterpoint]}]; 


    Show[flowplot, starterplot, trajectoryplot, PlotRange -> All, 
      Axes -> True, AxesLabel -> {"x", "y"}, 
      DisplayFunction -> $DisplayFunction]; \)

Swirling down the drain at {0, 0}.
Flow interpretation: 
If {x[t], y[t]} solves:

ColumnForm[Thread[diffeqsystem]]

Then you can be very confident that both x[t] and y[t] oscillate but fall in size towards 0 as time t gets larger and larger.
Take a look the correspong solution plots for the last one:

\(x[t_]\  = \ x[t] /. ndssol[\([1]\)]; 

    y[t_]\  = \ y[t] /. ndssol[\([1]\)]; 

    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
\ 
    Plot[x[t], {t, 0, endtime}, 
	\ 
      PlotStyle -> {{Thickness[0.01], Magenta}}, \ 
      AxesLabel -> {"t", "x[t]"}, 
\ \ \ \ \ AspectRatio -> 1/2, 
      PlotRange -> All, PlotLabel -> "x[t] solution plot"]; 


    Plot[y[t], {t, 0, endtime}, 
\ \ \ \ \ 
      PlotStyle -> {{Thickness[0.01], Red}}, 
      AxesLabel -> {"t", "y[t]"}, 
\ \ \ \ \ AspectRatio -> 1/2, 
      PlotRange -> All, PlotLabel -> "y[t] solution plot"]; \)

Squashed oscillations.

T.1.f) This system propels and oscillates

Here's yet another system of differential equations:

\(Clear[m, n, x, y, t]; 

    m[x_, y_]\  = \ \ 0.2 \((\ 1.3\ x\  - \ 1.6\ y)\)\ ; 

    n[x_, y_]\  = \ \ 0.2 \((\ 0.9\ x\  - \ 0.2\ y)\); 


    diffeqsystem\  = \ 
      \(({\(x'\)[t], \(y'\)[t]}\  == \ {m[x[t], y[t]], n[x[t], y[t]]})\); 

    ColumnForm[Thread[diffeqsystem]]\)

Do a flow analysis of this system.

To get an idea about what happens to the solutions as t grows and grows, you look at this scaled plot of Field[x, y] = {m[x, y], n[x, y]}:

\(Clear[Field]; 
Field[x_, y_] = {m[x, y], n[x, y]}; 

    \({xlow, xhigh} = {\(-4\), 4}; \)\){ylow, yhigh} = {-4, 4}; jump = 0.5; \(flowplot = 
      Table[Arrow[{m[x, y], n[x, y]}, Tail -> {x, y}, 
          VectorColor -> Blue, ScaleFactor -> 0.9, 
          HeadSize -> 0.4], {x, xlow, xhigh, jump}, {y, ylow, yhigh, 
          jump}]; 


    Show[flowplot, Axes -> True, AxesLabel -> {"x", "y"}]; 
    \)

Whirl and propel.
The plot gives the strong message that all the trajectories oscillate and that all the trajectories are propelled away from {0, 0}. 
Throw in a random trajectory to confirm:

\(\(h\  = \ Random[Real, {0.2, 1}]; 
s\  = \ Random[Real, {0, \ 2\ Pi}]; 
    
\({xstarter, ystarter}\  = \ {h\ \ Cos[s], h\ Sin[s]}; \); 

    endtime\  = \ 30; 
starterpoint\  = \ {xstarter, ystarter}; 

    xdiffeq\  = \ \((\(x'\)[t]\  == \ m[x[t], y[t]])\); 

    ydiffeq\  = \ \((\(y'\)[t]\  == \ n[x[t], y[t]])\); 

    xstartereqn\  = \ \((x[0]\  == \ xstarter)\); 

    ystartereqn\  = \ \((y[0]\  == \ ystarter)\); 


    ndssol\  = \ 
      NDSolve[{xdiffeq, ydiffeq, 
		xstartereqn, ystartereqn}, {x[t], 
          y[t]}, {t, 0, endtime}]; 
\ \ \ 
Clear[trajectory]; 

    trajectory[t_]\  = 
      \ {x[t] /. ndssol[\([1]\)], 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        y[t] /. ndssol[\([1]\)]}; 


    trajectoryplot\  = \ 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
\ \ \ \ \ \ \ 
        PlotStyle -> {{CadmiumOrange, Thickness[0.015]}}, 

        \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ DisplayFunction -> Identity]; 

    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 

    starterplot\  = \ 
      Graphics[{Red, PointSize[0.06], 

          \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Point[starterpoint]}]; 
    
\ \ \ \ \ 

    Show[flowplot, starterplot, trajectoryplot, 
\ \ \ \ \ 
      PlotRange -> {{xlow\  - 5, xhigh + 5}, {ylow - 5, yhigh + 5}}, 
      Axes -> True, AxesLabel -> {"x", "y"}, 
\ \ \ \ \ 
      DisplayFunction -> $DisplayFunction]; 

    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)\)

And away it goes.
Flow interpretation: 
If {x[t], y[t]} solves:

ColumnForm[Thread[diffeqsystem]]

Then you can be very confident that both x[t] and y[t] oscillate above and below 0; the oscillations increase in size as time t goes on.
Take a look at the corresponding individual solution plots for the last one:

\(x[t_]\  = \ x[t] /. ndssol[\([1]\)]; 

    y[t_]\  = \ y[t] /. ndssol[\([1]\)]; 

    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 

    Plot[x[t], {t, 0, endtime}, 
\ \ \ \ \ 
      PlotStyle -> {{Thickness[0.01], Magenta}}, 
      AxesLabel -> {"t", "x[t]"}, 
\ \ \ \ \ AspectRatio -> 1\/2, 
      PlotLabel -> "x[t] solution plot"]; 

    Plot[y[t], {t, 0, endtime}, 
\ \ \ \ \ 
      PlotStyle -> {{Thickness[0.01], Red}}, 
      AxesLabel -> {"t", "y[t]"}, 
\ \ \ \ \ AspectRatio -> 1\/2, 
      PlotLabel -> "y[t] solution plot"]; \)

Yes ma'am.

T.2)  Damped oscillators and undamped oscillators

T.2.a) An undamped oscillator

Go with c = 2 and look at:

\(c\  = \ 2; 
Clear[t, y]; 

    oscillatordiffeq\  = \ \((\(\(y'\)'\)[t]\  + \ c\ y[t]\  == \ 0)\)\)

To make this second order differential equation into a system of two first order differential equations, you put 
             x[t]=y'[t] 
and then replace y'[t] by x[t] and replace (y^′)′[t] by x'[t]:

\(Clear[x]; 

    ColumnForm[
      Thread[{new\  = \ \((\(y'\)[t]\  == \ x[t])\), 

          oscillatordiffeq /. {\(y'\)[t] -> x[t], 
              \(\(y'\)'\)[t] -> \(x'\)[t]}}]\ ]\)

Clean this up:

\(Clear[m, n, x, y, t]; 
m[x_, y_]\  = \ \(-c\)\ y; 

    n[x_, y_]\  = \ \ x; 


    diffeqsystem\  = \ 
      \(({\(x'\)[t], \(y'\)[t]}\  == \ {m[x[t], y[t]], n[x[t], y[t]]})\); 

    ColumnForm[Thread[diffeqsystem]]\)

Now look at:

\(Clear[Field]; 
Field[x_, y_] = {m[x, y], n[x, y]}; 

    \({xlow, xhigh} = {\(-4\), 4}; \)\){ylow, yhigh} = {-4, 4}; jump = 0.5; \(flowplot = 
      Table[Arrow[{m[x, y], n[x, y]}, Tail -> {x, y}, 
          VectorColor -> Blue, ScaleFactor -> 0.4, 
          HeadSize -> 0.5], {x, xlow, xhigh, jump}, {y, ylow, yhigh, 
          jump}]; 


    Show[flowplot, Axes -> True, AxesLabel -> {"x", "y"}]; 
    \)

Throw in a trajectory:

\(\({a, b}\  = \ {1, 2}; 
starterpoint\  = \ {a, b}; 
Clear[x, y, t]; 

    equationx\  = \ \((\(x'\)[t]\  == \ m[x[t], y[t]])\); 

    equationy\  = \ \((\(y'\)[t]\  == \ n[x[t], y[t]])\); 

    starterx\  = \ \((x[0]\  == \ a)\); 
startery\  = \ \((y[0]\  == \ b)\); 
    
endtime\  = \ 8.0; 


    ndssol\  = \ 
      NDSolve[{equationx, equationy, 
		starterx, startery}, {x[t], 
          y[t]}, {t, 0, endtime}]; 
\ \ \ 
Clear[trajectory]; 

    trajectory[t_]\  = 
      \ {x[t] /. ndssol[\([1]\)], 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        y[t] /. ndssol[\([1]\)]}; 


    trajectoryplot\  = \ 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
\ \ \ \ \ \ \ 
        PlotStyle -> {{CadmiumOrange, Thickness[0.015]}}, 

        \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ DisplayFunction -> Identity]; 

    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 

    starterplot\  = \ 
      Graphics[{Red, PointSize[0.06], 

          \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Point[starterpoint]}]; 
    
\ \ \ \ \ 

    phaseportrait\  = \ 
      Show[flowplot, starterplot, 
\ \ \ \ \ trajectoryplot, 
        PlotRange -> All, Axes -> True, AxesLabel -> {"y'", "y"}, 

        \ \ \ \ \ \ \ \ DisplayFunction -> $DisplayFunction]; 

    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)\)

What information about solutions of 
         (y^′)′[t]  +  2 y[t]  =  0 
do you pick up from this plot?

Take another look:

Show[phaseportrait];

As t increases, y[t] (along the vertical axis) oscillates between positive and negative values and because the trajectory goes right through the starter point, y[t] repeats its action over and over.
It cycles:

Plot[
      y[t] /. ndssol[[1]], {t, 0, 
        endtime}, PlotStyle -> {{Thickness[0.01], Red}}, 
      AxesLabel -> {"t", "y[t]"}, AspectRatio -> 1];

Try it out for random starting data for y[0] and y'[0]:

Clear[t, y];
oscillatordiffeq=y''[t]+2 y[t]==0;
{ystart, yprimestart} = {Random[Real, {-2, 2}], 
            Random[Real, {-2, 2}]}
Clear[y, t, approxy];
endtime = 30;
solution=NDSolve[{oscillatordiffeq,y[0] == ystart,y'[0]==yprimestart},y[t],{t, 0, endtime}];\(approxy[t_] = y[t] /. solution[[1]]; 
    

Plot[approxy[t], {t, 0, endtime}, 
      PlotStyle -> {{Thickness[0.01], Red}}, 
      AxesLabel -> {"t", "y[t]"}, 
      AspectRatio -> 1\/GoldenRatio]; \)

Yep.
y[t] repeats itself over and over. That's why folks call y[t] an oscillator.
And that's why folks like to say that 
               (y^′)′[t]  +  2 y[t]  =  0
is a differential equation of a harmonic oscillator.

T.2.b) A damped oscillator

Go with c=2 and look at:

c = 2; Clear[t, y];
oscillatordiffeq=y''[t]+c y[t]==0

This is a differential equation of an undamped oscillator. 
To get the differential equation of a damped oscillator, you go with a small, positive 
number  b, and you put:

\(c\  = \ 2; 
b\  = \ 0.5; 
Clear[t, y]; 

    dampedoscillatordiffeq\  = \ 
      \((\(\(y'\)'\)[t] + \ b\ \(y'\)[t]\  + \ c\ y[t]\  == \ 0)\)\)

To make this second order differential equation into a system of two first order differential equations, you put 
             x[t]=y'[t] 
and then replace y'[t] by x[t] and replace (y^′)′[t] by x'[t]:

\(Clear[x]; 

    ColumnForm[
      Thread[{new\  = \ \((\(y'\)[t]\  == \ x[t])\), 

          dampedoscillatordiffeq /. {\(y'\)[t] -> x[t], 
              \(\(y'\)'\)[t] -> \(x'\)[t]}}]\ ]\)

Clean this up:

Clear[m, n, x, y, t];
m[x_, y_] = -b x - c y;
n[x_, y_] = x;

diffeqsystem={x'[t],y'[t]}=={m[x[t], y[t]], n[x[t], y[t]]}

Now look at:

\(Clear[Field]; 
Field[x_, y_] = {m[x, y], n[x, y]}; 

    \({xlow, xhigh} = {\(-4\), 4}; \)\){ylow, yhigh} = {-4, 4}; jump = 1; \(flowplot = 
      Table[Arrow[{m[x, y], n[x, y]}, Tail -> {x, y}, 
          VectorColor -> Blue, ScaleFactor -> 0.3, 
          HeadSize -> 0.4], {x, xlow, xhigh, jump}, {y, ylow, yhigh, 
          jump}]; 


    Show[flowplot, Axes -> True, AxesLabel -> {"x", "y"}]; 
    \)

Throw in a trajectory:

\(starterpoint\  = \ {1, 2}; 
Clear[x, y, t]; 

    equationx\  = \ \((\(x'\)[t]\  == \ m[x[t], y[t]])\); 

    equationy\  = \ \((\(y'\)[t]\  == \ n[x[t], y[t]])\); 

    starterx\  = \ \((x[0]\  == \ starterpoint[\([1]\)])\); 

    startery\  = \ \((y[0]\  == \ starterpoint[\([2]\)])\); 

    endtime\  = \ 12.0; 


    ndssol\  = \ 
      NDSolve[{equationx, equationy, 
		starterx, startery}, {x[t], 
          y[t]}, {t, 0, endtime}]; 
\ \ \ 
Clear[trajectory]; 

    trajectory[t_]\  = 
      \ {x[t] /. ndssol[\([1]\)], 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        y[t] /. ndssol[\([1]\)]}; 


    trajectoryplot\  = \ 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
\ \ \ \ \ \ \ 
        PlotStyle -> {{CadmiumOrange, Thickness[0.015]}}, 

        \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ DisplayFunction -> Identity]; 

    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 

    starterplot\  = \ 
      Graphics[{Red, PointSize[0.06], 

          \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Point[starterpoint]}]; 
    
\ \ \ \ \ 

    phaseportrait\  = \ 
      Show[flowplot, starterplot, 
\ \ \ \ \ trajectoryplot, 
        PlotRange -> All, Axes -> True, AxesLabel -> {"y'", "y"}, 

        \ \ \ \ \ \ \ \ DisplayFunction -> $DisplayFunction]; \)

What information about solutions of 
         (y^′)′[t] + 0.5 y'[t] + 2 y[t] = 0 
do you pick up from this plot?

Take another look:

Show[phaseportrait];

As t increases, y[t] (along the vertical axis) oscillates between positive and negative values. But as time t advances, y[t] finds itself drawn toward 0:

\(y[t_] = y[t] /. ndssol[[1]]; 


    Plot[y[t], {t, 0, endtime}, PlotStyle -> {{Thickness[0.01], Red}}, 
      AxesLabel -> {"t", "y[t]"}, PlotRange -> All, 
      AspectRatio -> 1]; \)

Just as the trajectory revealed.
Try it out for random starting data on y[0] and y'[0]:

Clear[t, y];
dampedoscillatordiffeq=y''[t]+0.5 y'[t]+2 y[t]==0;
{ystart, yprimestart} = {Random[Real, {-2, 2}], 
            Random[Real, {-2, 2}]}
Clear[y, t, approxy];
endtime = 12;
ndssol=NDSolve[{dampedoscillatordiffeq,y[0] == ystart,y'[0]==yprimestart},y[t],{t, 0, endtime}];\(y[t_] = y[t] /. ndssol[[1]]; 


    Plot[y[t], {t, 0, endtime}, PlotStyle -> {{Thickness[0.01], Red}}, 
      AxesLabel -> {"t", "y[t]"}, PlotRange -> All, 
      AspectRatio -> 1]; \)

Yes.
Damped oscillations.

Another:

Clear[t, y];
dampedoscillatordiffeq=y''[t]+0.5 y'[t]+2 y[t]==0;
{ystart, yprimestart} = {Random[Real, {-2, 2}], 
            Random[Real, {-2, 2}]}
Clear[y, t, approxy];
endtime = 12;
ndssol=NDSolve[{dampedoscillatordiffeq,y[0] == ystart,y'[0]==yprimestart},y[t],{t, 0, endtime}];\(y[t_] = y[t] /. ndssol[[1]]; 


    Plot[y[t], {t, 0, endtime}, PlotStyle -> {{Thickness[0.01], Red}}, 
      AxesLabel -> {"t", "y[t]"}, PlotRange -> All, 
      AspectRatio -> 1]; \)

Damped oscillations. 
It will happen everytime.

T.3)  A pursuit model

T.3.a.i)

Bubba is really enjoying one of those big-time keg parties out in the woods. Having learned to monitor his blood alcohol level in earlier Calculus&Mathematica lessons, Bubba took his bicycle to the party instead of driving his car.  At time (in minutes) t = 0, Bubba leaves the party and gets on his bicycle to ride home. 
At time t, after leaving the party, Bubba is at the point 
        {2 t + (1/2) Sin[4 t], t  +  (E^(-t)) Sin[3 t]}.  
Here is his route:

\(Clear[bubbax, bubbay, t]; 
    
{bubbax[t_], bubbay[t_]} = {2\ t + 1\/2\ Sin[4\ t], 
        t + E\^\(-t\)\ Sin[3\ t]}; 


    bubbaroute = 
      ParametricPlot[{bubbax[t], bubbay[t]}, {t, 0, 5}, 
        PlotStyle -> {{Thickness[0.01], Red}}, 
        AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; 

    \(pointplot = {Graphics[{PointSize[0.06], Point[bubba[0]]}], 
        Graphics[{PointSize[0.06], Point[bubba[5]]}]}; \)\)\(labels = {Graphics[Text["Party", bubba[0], {\(-2\), 0}]], 
        Graphics[Text["Home", bubba[5], {0, 5}]]}; 


    Show[bubbaroute, pointplot, labels, AspectRatio -> Automatic, 
      PlotRange -> All, DisplayFunction -> $DisplayFunction]; \)

Slightly unsteady is your friend Bubba.
While Bubba was at the party, his Blue Tick Hound Dog was sleeping at the point {0,  2}.  As Bubba left the party, the dog woke up and chased after Bubba. 

Here is the dog's scheme:
If the dog is at 
     {dogx[t], dogy[t]} 
at time t, then the dog leaves {dogx[t], dogy[t]} with instantaneous velocity
    {bubbax[t], bubbay[t]}  -  {dogx[t], dogy[t]}. 
This means that at any time t, the dog is always running toward the point {bubbax[t], bubbay[t]}, which is Bubba's current position. 

Does the dog catch up with Bubba before Bubba gets home and locks the dog out?

You guessed it.
This is a job for a system of differential equations.
Put:

\(Clear[dogvelx, dogvely, x, y, t]; 
    
{dogvelx[t_], dogvely[t_]} = {bubbax[t], bubbay[t]} - {x[t], y[t]}\)

The system of differential equations is:

equationx=x'[t]==dogvelx[t]

equationy=y'[t]==dogvely[t]

starterx = x[0] == 0

startery = y[0] == 2

Here comes an approximate plot of the dog's route for the first five minutes:

endtime = 5; \(Clear[x, y, dogx, dogy, t]; 

    ndssol = NDSolve[{equationx, equationy, starterx, startery}, {x[t], 
          y[t]}, {t, 0, endtime}]; 

    \(dogx[t_] = x[t] /. ndssol[[1]]; 
    \)\)dogy[t_] = y[t] /. ndssol[[1]]; 
    \(dogplot = 
      ParametricPlot[{dogx[t], dogy[t]}, {t, 0, endtime}, 
        PlotStyle -> {{Blue, Thickness[0.02]}}, 
        DisplayFunction -> Identity]; 


    outcome = 
      Show[dogplot, bubbaroute, pointplot, labels, 
        AspectRatio -> Automatic, PlotRange -> All, 
        DisplayFunction -> $DisplayFunction]; \)

The dog didn't make it.
Hope it doesn't rain.

T.3.a.ii)

Illustrate the dog's strategy by making a movie reviewing the chase.

Set up the movie code and look at one sample frame:

Clear[bubbapoint, bubbavelocityvector, dogpoint, dogvelocityvector, 
        situation, t];
bubbapoint[t_] := {
          Graphics[{Red, PointSize[0.04], Point[{bubbax[t], bubbay[t]}]}], 
          Graphics[Text["Bubba", {bubbax[t], bubbay[t]} + {0, 0.3}]]};
dogpoint[t_] := 
        Graphics[{{Blue, PointSize[0.04], Point[{dogx[t], dogy[t]}]}, 
            Text["dog", {dogx[t], dogy[t]} - {0, 0.3}]}];
dogvelocityvector[t_]:=Arrow[{dogx'[t],dogy'[t]},Tail -> {dogx[t], dogy[t]},VectorColor -> Blue,HeadSize -> 0.6];\(situation[t_] := 
      Show[pointplot, labels, bubbapoint[t], dogpoint[t], 
        dogvelocityvector[t], AspectRatio -> Automatic, 
        PlotRange -> {{0, 12}, {0, 6}}, Axes -> True, 
        DisplayFunction -> Identity]; 


    Show[situation[3], bubbaroute, DisplayFunction -> $DisplayFunction]; 
    \)

See the whole chase from beginning to end:

Table[Show[situation[t], DisplayFunction -> $DisplayFunction]; 
      , {t, 0, endtime, (endtime/7)}];

The dog almost catches up with Bubba early in the chase.
Bubba is going so fast when he gets to his home that you've got to be nervous about whether or not he crashes right through the front door.

T.3.a.iii)

What could the dog have done to catch Bubba?

Answer:

Common sense says that the dog should have run faster. 
Here's what could have happened if the dog had run 5 times faster than he did above:

\(Clear[x, y, t, newdogvelx, newdogvely]; 
r = 5; 

    \({newdogvelx[t_], newdogvely[t_]} = r\ {dogvelx[t], dogvely[t]}; \)\)equationx=x'[t]==newdogvelx[t];equationy=y'[t]==newdogvely[t];starterx = x[0] == 0; startery = y[0] == 2; \(endtime = 5; 

Clear[x, y, t]; 

    ndssol = NDSolve[{equationx, equationy, starterx, startery}, {x[t], 
          y[t]}, {t, 0, endtime}]; 

Clear[newdogx, newdogy]; 

    newdogx[t_] = x[t] /. ndssol[[1]]; 

    \(newdogy[t_] = y[t] /. ndssol[[1]]; 
    \)\)\(newdogplot = 
      ParametricPlot[{newdogx[t], newdogy[t]}, {t, 0, endtime}, 
        PlotStyle -> {{Blue, Thickness[0.02]}}, 
        DisplayFunction -> Identity]; 


    outcome = 
      Show[newdogplot, bubbaroute, pointplot, labels, 
        AspectRatio -> Automatic, PlotRange -> All, 
        DisplayFunction -> $DisplayFunction]; \)

The smart money bets that the dog trotted through the door only seconds after Bubba opened the door. In fact, the dog was running only slightly behind Bubba for most of the chase. 
Take a look at the whole chase:

\(Clear[bubbapoint, bubbavelocityvector, newdogpoint, newdogvelocityvector, 
      newsituation, t]; 

    bubbapoint[t_] := {
        Graphics[{Red, PointSize[0.03], Point[{bubbax[t], bubbay[t]}]}], 
        Graphics[Text["Bubba", {bubbax[t], bubbay[t]} + {0, 0.3}]]}; 

    \(newdogpoint[t_] := 
      Graphics[{{Blue, PointSize[0.04], Point[{newdogx[t], newdogy[t]}]}, 
          Text["dog", {newdogx[t], newdogy[t]} - {0, 0.3}]}]; \)\)newdogvelocityvector[t_]:=Arrow[{newdogx'[t],newdogy'[t]},Tail -> {newdogx[t], newdogy[t]},VectorColor -> Blue,HeadSize -> 0.6];\(newsituation[t_] := 
      Show[pointplot, labels, bubbapoint[t], newdogpoint[t], 
        newdogvelocityvector[t], AspectRatio -> Automatic, 
        PlotRange -> {{0, 12}, {0, 6}}, Axes -> True, 
        DisplayFunction -> Identity]; 


    Table[\(Show[newsituation[t], DisplayFunction -> $DisplayFunction]; 
      \), {t, 0, endtime, endtime\/9}]; \)

The dog is with him almost all the way.
Surely the wise old dog got through the door before Bubba locked the door and passed out.
And the dog is no fool; the dog knows that it's safer to run behind Bubba than to run in front of him.

T.4)  Troubleshooting plots of vector fields

To get a good visualization of a vector field, you can plot the field as it comes:

\(Clear[Field, x, y]; 
Field[x_, y_] = {x\^2 + 1, y\^2}; 

    fieldplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}, 
          VectorColor -> Blue], {x, \(-3\), 3, 0.5}, {y, \(-3\), 3, 
          0.5}]; 


    Show[fieldplot, Axes -> Automatic, 
      AxesLabel -> {"x", "y"}]; \)

In some cases, such as this one, the vectors plot out so long that you have a hard time visualizing the flow of the field.
Other times, the field vectors might plot out so short that you can't see them clearly.
In such cases, you might want to apply a ScaleFactor:

scalefactor = 0.2;
scaledfieldplot=Table[Arrow[Field[x, y],Tail -> {x, y},VectorColor -> Blue,ScaleFactor -> scalefactor],{x, -3, 3, 0.5},{y, -3, 3, 0.5}];

Show[scaledfieldplot, Axes -> Automatic, 
        AxesLabel -> {"x", "y"}];

In a scaled plot such as this one, the lengths of the vectors are proportional to the speed of the flow, just as they were in the unscaled plot. 

To clean things up, you can also adjust the size of the tips of the arrows.
Look at the messy plot below:

\(scaledfieldplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}, 
          VectorColor -> BlueViolet, ScaleFactor -> 0.2, 
          HeadSize -> 1.3], {x, \(-3\), 3, 0.5}, {y, \(-3\), 3, 0.5}]; 

    
Show[scaledfieldplot, Axes -> Automatic, 
      AxesLabel -> {"x", "y"}]; \)

Those tips are too big!
Reduce their size using HeadSize:

scaledfieldplot=Table[Arrow[Field[x, y],Tail -> {x, y},VectorColor -> BlueViolet,ScaleFactor -> 0.2,HeadSize -> 0.4],{x, -3, 3, 0.5},{y, -3, 3, 0.5}];

Show[scaledfieldplot, Axes -> Automatic, 
        AxesLabel -> {"x", "y"}];

That's better.

Sometimes you can't get any satisfactory scaled plot.  In this case you might want to to scale each vector so that they all turn out to be unit vectors.  You can do this by setting ScaleFactor -> Normalize.

unitfieldplot = Table[Arrow[Field[x, y],Tail -> {x, y},
      VectorColor -> BlueViolet,ScaleFactor -> Normalize,HeadSize -> 0.3],       
         {x, -3, 3, 0.5},{y, -3, 3, 0.5}];

\(Show[unitfieldplot, Axes -> Automatic, 
\ 
          AxesLabel -> {"x", "y"}]\);

This plot of unitField[x, y] shows only direction but not the speed of the flow.

If you want a field plot using unit vectors, and don't want to lose magnitude information, there is a way to get around it.  You can plot a scaled unit field plot, and color the vectors according to their magnitudes.  It's not too hard to do, but does require a little work first.

\(Clear[colorfieldplot, max, color]; 

    max = Max[
        Flatten[Table[
            Norm[N[Field[x, y]]], {x, \(-3\), 3,  .5}, {y, \(-3\), 
              3,  .5}]]]; 

    \(color[x_, y_] := 
      RGBColor[N[Norm[Field[x, y]]]\/max, 0, 
        1.  - N[Norm[Field[x, y]]]\/max]; \)\)\(colorfieldplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}, 
          VectorColor -> Evaluate[color[x, y]], 
          ScaleFactor -> Normalize, HeadSize -> 0.3], {x, \(-3\), 
          3,  .5}, {y, \(-3\), 3,  .5}]; 


    Show[colorfieldplot, Axes -> Automatic, 
      AxesLabel -> {"x", "y"}]; \)

The larger (magnitude) vectors are red and the smaller are blue.  
Not bad, huh?
Some folks feel that these color-coded plots are an information overload. 
What do you think?