DE.06 Systems and Flows
 LITERACY

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];

L.1)

Here's a rather detailed plot of a certain vector field:

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

    \(scalefactor = 0.2; \)\)\(Fieldplot = 
      Table[Arrow[scalefactor\ Field[x, y], Tail -> {x, y}, 
          VectorColor -> Blue], {x, \(-5\), 5, 6\/10}, {y, \(-5\), 5, 
          6\/10}]; 

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

Visible in this plot are four straight line trajectories and four other families of trajectories.
Pencil in the straight line trajectories and one trajectory of each of the four other families.

L.2)

You are given a system of differential equations
     x'[t]=2 - x[t]^( 2)
     y'[t]=-y[t].
You decide to look at the flow of the trajectories and you get:

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

    \(scalefactor = 0.2; \)\)\(Fieldplot = 
      Table[Arrow[scalefactor\ Field[x, y], Tail -> {x, y}, 
          VectorColor -> Blue], {x, \(-2\), 2, 4\/10}, {y, \(-2\), 2, 
          4\/10}]; 

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

To get this plot, you plotted a vector field 
          Field[x, y] = {m[x, y], n[x, y]}
with tails at {x, y} for a selection of points {x, y}.
The question here: 
What are the exact formulas for m[x, y] and n[x, y] ?

L.3)

Here is the flow plot of a certain system
         x'[t]=m[x[t], y[t]]
         y'[t]=n[x[t], y[t]]
together with a trajectory resulting from starter data
         x[0] = -1.3 and y[0] = 1.7:

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

    Field[x_, y_] = {2 - x\^2 + 0.5\ y, \(-y\) + 0.2\ x}; 

    \({m[x_, y_], n[x_, y_]} = Field[x, y]; \)\)scalefactor = 0.2; \(Fieldplot = 
      Table[Arrow[scalefactor\ Field[x, y], Tail -> {x, y}, 
          VectorColor -> Blue], {x, \(-2\), 2, 4\/12}, {y, \(-2\), 2, 
          4\/12}]; 
\({a, b} = {\(-1.3\), 1.7}; \)\)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 = 2; approxsolutions = 
      NDSolve[{equationx, equationy, starterx, startery}, {x[t], y[t]}, {t, 
          0, endtime}]; \(Clear[trajectory]; 

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

    \(trajectoryplot = 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
        PlotStyle -> {{Red, Thickness[0.015]}}, 
        DisplayFunction -> Identity]; \)\)starterplot = Graphics[{Red, PointSize[0.06], Point[starterpoint]}]; Show[Fieldplot, starterplot, trajectoryplot, PlotRange -> All, 
      Axes -> True, AxesLabel -> {"x", "y"}, 
      DisplayFunction -> $DisplayFunction];

Which way is the trajectory going?
In what sense does the flow plot guide the trajectory along its way?

L.4)

Here is the flow plot of a certain system
       x'[t]=m[x[t], y[t]]
       y'[t]=n[x[t], y[t]]
 of differential equations shown with two curves:

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


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

    
{m[x_, y_], n[x_, y_]} = Field[x, y]; 
\({a, b} = {2.5, \(-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 = 13; approxsolutions = 
      NDSolve[{equationx, equationy, starterx, startery}, {x[t], y[t]}, {t, 
          0, endtime}]; \(Clear[trajectory]; 

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

    \(trajectoryplot = 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
        PlotStyle -> {{Thickness[0.016], Red}}, 
        DisplayFunction -> Identity]; \)\)starterplot = Graphics[{PointSize[0.03], Point[starterpoint]}]; othercurve = 
      Plot[-0.32 (t^2), {t, -3.26, 2.5}, 
        PlotStyle -> {{Red, Thickness[0.016]}}, 
        DisplayFunction -> Identity]; Show[vectorfieldplot, starterplot, othercurve, trajectoryplot, 
      PlotRange -> All, Axes -> True, 
      AxesLabel -> {"x", "y"}, 
      DisplayFunction -> $DisplayFunction];

One of these curves is a genuine trajectory. 
The other is bogus. 
Identify the trajectory and discuss the information that led to your choice.

L.5)

Can two trajectories of a system
       x'[t]=m[x[t], y[t]]
       y'[t]=n[x[t], y[t]]
ever cross each other like this?

\(Clear[x]; 

    Plot[{Cos[x], Sin[x]}, {x, π\/8, \(3\ π\)\/8}, 
      PlotStyle -> {{Red, Thickness[0.01]}}, Axes -> None, 
      AspectRatio -> 1\/3]; \)

Why or why not?

L.6)

The system of differential equations is
        x'[t]=x[t]^( 2) + 3 y[t]
        y'[t]=x[t] - y[t]^2
You are given that a trajectory {x[t], y[t]} passes through {2, 1} at a certain time\(\(\ t = \(t\^*\)\)\) .  
Your job is to write down the vector 
           {x'[\(t\^*\)],y'[\([\(t\^*\)]\)} 
which is tangent to the trajectory at {2, 1}.

L.7)

a) Explain this: 
When you convert the single second order differential equation
           y''[t]+2 y'[t]+8 y[t]=0
into a system of two first order differential equations by putting x[t]=y'[t], you get
           x'[t]=-2 x[t] - 8 y[t]
           y'[t]=x[t]

b) Are plots of solutions
           y''[t]+2 y'[t]+8 y[t]=0
the same as plots of trajectories of the system
           x'[t]=-2 x[t] - 8 y[t]
           y'[t]=x[t]?

L.8)

a) Convert the single second order ordinary oscillator differential equation
          y''[t]+1.3 y'[t]+8.2 y[t]=0
into a system of two first order differential equations by putting x[t]=y'[t].

b) Explain why you need starter data on both y[0] and y'[0] to nail down and plot a specific solution of 
          y''[t]+1.3 y'[t]+8.2 y[t]=0.

L.9)

a) Convert the pendulum oscillator differential equation
          y''[t]+0.2 y'[t]+6.5 Sin[y[t]]=0.
into a system of two first order differential equations by putting x[t]=y'[t].

b) Explain why you need starter data on both y[0] and y'[0] to nail down and plot a specific solution of 
          y''[t]+0.2 y'[t]+6.5 Sin[y[t]]=0.

L.10)

Here is the flow plot for the system
       x'[t]=0.5 x[t] - 1.7 y[t]
       y'[t]=-2.8 x[t] + 2.3 y[t].

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

    Field[x_, y_] = \(-{\(-0.5\)\ x + 1.7\ y, 2.8\ x - 2.3\ y}\); 

    \({m[x_, y_], n[x_, y_]} = Field[x, y]; \)\)scalefactor = 0.1; \(Fieldplot = 
      Table[Arrow[scalefactor\ Field[x, y], Tail -> {x, y}, 
          VectorColor -> Blue], {x, \(-3\), 3, 6\/12}, {y, \(-3\), 3, 
          6\/12}]; 

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

Shade in regions consisting of points {a, b} in which you think the behavior of the trajectories is extremely sensitive to errors in the starting data {x[0], y[0]} = {a, b}.

L.11)

Here are plots of the solutions of
          y''[t]+4.7 y[t]=0
          y''[t]+0.3 y'[t]+4.7 y[t]=0,
          y''[t]+1.3 y'[t]+4.7 y[t]=0,
          y''[t]+7.3 y'[t]+4.7 y[t]=0,
all with the same starter data
          y[0] = 2 and y'[0]=3.
The plots are not in order.  Your job is to match the differential equation with the plot of its solution.

Clear[y, t, y1, y2, y3, y4];
sol1=DSolve[{y''[t]+0.3 y'[t]+4.7 y[t]==0,y[0] == 2,y'[0]==3},y[t],t];
y1[t_] = 
        y[t] /. sol1[[1]]; sol2=DSolve[{y''[t]+1.3 y'[t]+4.7 y[t]==0,y[0] == 2,y'[0]==3},y[t],t];y2[t_] = y[t] /. sol2[[1]]; sol3=DSolve[{y''[t]+7.3 y'[t]+4.7 y[t]==0,y[0] == 2,y'[0]==3},y[t],t];y3[t_] = y[t] /. sol3[[1]]; sol4=DSolve[{y''[t]+4.7 y[t]==0,y[0] == 2,y'[0]==3},y[t],t];y4[t_] = Chop[y[t] /. sol4[[1]]]; 
    endtime = 8; Plot[y3[t], {t, 0, endtime}, PlotStyle -> {{Thickness[0.01], Blue}}, 
      AxesLabel -> {"t", ""}, AspectRatio -> (2/endtime), 
      PlotRange -> {-2.5, 2.5}, PlotLabel -> "Plot A"]; Plot[y2[t], {t, 0, endtime}, PlotStyle -> {{Thickness[0.01], Blue}}, 
      AxesLabel -> {"t", ""}, AspectRatio -> (2/endtime), 
      PlotRange -> {-2.5, 2.5}, PlotLabel -> "Plot B"]; Plot[y4[t], {t, 0, endtime}, PlotStyle -> {{Thickness[0.01], Blue}}, 
      AxesLabel -> {"t", ""}, AspectRatio -> (2/endtime), 
      PlotRange -> {-2.5, 2.5}, PlotLabel -> "Plot C"]; Plot[y1[t], {t, 0, endtime}, PlotStyle -> {{Thickness[0.01], Blue}}, 
      AxesLabel -> {"t", ""}, AspectRatio -> (2/endtime), 
      PlotRange -> {-2.5, 2.5}, PlotLabel -> "Plot D"];

How does the starter data signal that each plot must go up before it can go down?

L.12)

Here are three oscillator differential equations:
        y''[t]+0.1 y'[t]+5.8 y[t]=0,
        y''[t]+5.8 y[t]=0,
        y''[t]+1.4 y'[t]+5.8 y[t]=0.
One is a differential equation of an undamped oscillator; the other two are differential equations of damped oscillators. Which is which?
Of the two damped oscillator differential equations, which one is the more heavily damped?

L.13)

An ordinary damped oscillator comes from the differential equation 
         y''[t]+0.4 y'[t]+6.2 y[t]=0
with 
        y[0] = 2.7 and y'[0]=-1.2. 
Putting 
        x[t]=y'[t] 
gives the equivalent linear system
        x'[t]=-0.4 x[t] - 6.2 y[t]
        y'[t]=x[t]
with 
        x[0] = -1.2 and y[0] = 2.7.
You use the machine to solve this system numerically and you get three plots as follows:

endtime = 12; Clear[x, y, t];
sols=NDSolve[{x'[t]==-0.4 x[t] - 6.2 y[t],y'[t]==x[t],x[0] == -1.2,y[0] == 2.7},{x[t], y[t]},{t, 0, endtime}];
{x[t_], y[t_]} = {x[t], y[t]} /. 
          sols[[1]]; ParametricPlot[{x[t], y[t]}, {t, 0, endtime}, 
      PlotStyle -> {{Thickness[0.01], Blue}}, 
      AxesLabel -> {"x", "y"}]; Plot[x[t], {t, 0, endtime}, PlotStyle -> {{Thickness[0.01], Blue}}, 
      AxesLabel -> {"t", "x"}]; Plot[y[t], {t, 0, endtime}, PlotStyle -> {{Thickness[0.01], Blue}}, 
      AxesLabel -> {"t", "y"}];

One of these plots is a plot of the solution of
         y''[t]+0.4 y'[t]+6.2 y[t]=0 
with 
         y[0] = 2.7 and y'[0]=-1.2.

Another is a plot of the derivative of  the solution of
         y''[t]+0.4 y'[t]+6.2 y[t]=0 
with 
         y[0] = 2.7 and y'[0]=-1.2.

Yet another is a plot of a trajectory in the equivalent system
         x'[t]=-0.4 x[t] - 6.2 y[t]
         y'[t]=x[t]
with 
         x[0] = -1.2 and y[0] = 2.7. 

Which is which?

L.14)

An ordinary damped oscillator comes from the differential equation 
          y''[t]+b y'[t]+c y[t]=0
with 
          y[0] = d and y'[0]=v.
So far the exact values of the constants b, c, d and v are not known. 

You are given that when this differential equation is converted to an equivalent system by putting
          x[t]=y'[t], 
the resulting system is 
          x'[t]=-1.6 x[t] - 2.3 y[t]
          y'[t]=x[t]
with 
        x[0] = 2.2 and y[0] = 3.9.
What are the exact values of b, c, d, and v?

L.15)

Here are six plots of trajectories for six different systems of the form
        x'[t]=m[x[t], y[t]]
        y'[t]=n[x[t], y[t]]
all with {x[0], y[0]} = {2, 4}:

\(Clear[m, n, x, y, t]; 
m[x_, y_] = \(-y\); 
\(n[x_, y_] = x; \)\)starterpoint = {2, 4}; {a, b} = starterpoint; 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 = 24.0; approxsolutions1 = 
      NDSolve[{equationx, equationy, starterx, startery}, {x[t], y[t]}, {t, 
          0, endtime}]; \(Clear[trajectory]; 

    trajectory[t_] = {
        x[t] /. approxsolutions1[[1]], 
        y[t] /. approxsolutions1[[1]]}; 
    
\(trajectoryplot1 = 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
        PlotStyle -> {{Red, Thickness[0.015]}}, 
        DisplayFunction -> Identity]; \)\)starterplot = Graphics[{Red, PointSize[0.06], Point[starterpoint]}]; firstyplot = 
      Plot[y[t] /. 
          approxsolutions1[[1]], {t, 0, 
          endtime}, PlotStyle -> {{Red, Thickness[0.01]}}, 
        AxesLabel -> {"t", "y[t]"}, AspectRatio -> (1/5), 
        DisplayFunction -> Identity]; firstphaseportrait = 
      Show[starterplot, trajectoryplot1, PlotRange -> All, 
        Axes -> True, AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; c = 0.3; \(Clear[m, n, x, y, t]; 
m[x_, y_] = \(-y\) - c\ x; 
\(n[x_, y_] = x; 
    \)\)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 = 24.0; approxsolutions2 = 
      NDSolve[{equationx, equationy, starterx, startery}, {x[t], y[t]}, {t, 
          0, endtime}]; \(Clear[trajectory]; 

    trajectory[t_] = {
        x[t] /. approxsolutions2[[1]], 
        y[t] /. approxsolutions2[[1]]}; 
    
\(trajectoryplot2 = 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
        PlotStyle -> {{Red, Thickness[0.015]}}, 
        DisplayFunction -> Identity]; \)\)secondyplot = 
      Plot[y[t] /. 
          approxsolutions2[[1]], {t, 0, 
          endtime}, PlotStyle -> {{Red, Thickness[0.01]}}, 
        AxesLabel -> {"t", "y[t]"}, PlotRange -> All, 
        AspectRatio -> (1/2), DisplayFunction -> Identity]; secondphaseportrait = 
      Show[starterplot, trajectoryplot2, PlotRange -> All, 
        Axes -> True, AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; c = -0.1; \(Clear[m, n, x, y, t]; 
m[x_, y_] = \(-y\) - c\ x; 
\(n[x_, y_] = x; 
    \)\)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 = 24.0; approxsolutions3 = 
      NDSolve[{equationx, equationy, starterx, startery}, {x[t], y[t]}, {t, 
          0, endtime}]; \(Clear[trajectory]; 

    trajectory[t_] = {
        x[t] /. approxsolutions3[[1]], 
        y[t] /. approxsolutions3[[1]]}; 
    
\(trajectoryplot3 = 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
        PlotStyle -> {{Red, Thickness[0.015]}}, 
        DisplayFunction -> Identity]; \)\)thirdyplot = 
      Plot[y[t] /. 
          approxsolutions3[[1]], {t, 0, 
          endtime}, PlotStyle -> {{Red, Thickness[0.01]}}, 
        AxesLabel -> {"t", "y[t]"}, PlotRange -> All, 
        AspectRatio -> (1/2), DisplayFunction -> Identity]; thirdphaseportrait = 
      Show[starterplot, trajectoryplot3, PlotRange -> All, 
        Axes -> True, AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; \(Clear[m, n, x, y, t]; 
m[x_, y_] = \(-\((y\^2 - 1)\)\)\ x - y; 

    \(n[x_, y_] = x; \)\)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 = 24.0; approxsolutions4 = 
      NDSolve[{equationx, equationy, starterx, startery}, {x[t], y[t]}, {t, 
          0, endtime}]; \(Clear[trajectory]; 

    trajectory[t_] = {
        x[t] /. approxsolutions4[[1]], 
        y[t] /. approxsolutions4[[1]]}; 
    
\(trajectoryplot4 = 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
        PlotStyle -> {{Red, Thickness[0.015]}}, 
        DisplayFunction -> Identity]; \)\)fourthyplot = 
      Plot[y[t] /. 
          approxsolutions4[[1]], {t, 0, 
          endtime}, PlotStyle -> {{Red, Thickness[0.01]}}, 
        AxesLabel -> {"t", "y[t]"}, PlotRange -> All, 
        AspectRatio -> (1/2), DisplayFunction -> Identity]; fourthphaseportrait = 
      Show[starterplot, trajectoryplot4, PlotRange -> All, 
        Axes -> True, AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; \(Clear[m, n, x, y, t]; 
m[x_, y_] = 1.7\ x + 2.1\ y; 

    \(n[x_, y_] = 2.1\ x - 0.75\ y; \)\)endtime = 1; equationx=x'[t]==m[x[t], y[t]];equationy=y'[t]==n[x[t], y[t]];starterx = x[0] == a; startery = y[0] == b; approxsolutions5 = 
      NDSolve[{equationx, equationy, starterx, startery}, {x[t], y[t]}, {t, 
          0, endtime}]; \(Clear[trajectory]; 

    trajectory[t_] = {
        x[t] /. approxsolutions5[[1]], 
        y[t] /. approxsolutions5[[1]]}; 
    
\(trajectoryplot5 = 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
        PlotStyle -> {{Red, Thickness[0.015]}}, 
        DisplayFunction -> Identity]; \)\)fifthyplot = 
      Plot[y[t] /. 
          approxsolutions5[[1]], {t, 0, 
          endtime}, PlotStyle -> {{Red, Thickness[0.01]}}, 
        AxesLabel -> {"t", "y[t]"}, PlotRange -> All, 
        AspectRatio -> (1/2), DisplayFunction -> Identity]; fifthphaseportrait = 
      Show[starterplot, trajectoryplot5, PlotRange -> All, 
        Axes -> True, AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; \(Clear[m, n, x, y, t]; 
m[x_, y_] = \(-x\) + 0.4\ y; 

    \(n[x_, y_] = 0.2\ x - 1.75\ y; \)\)endtime = 6; equationx=x'[t]==m[x[t], y[t]];equationy=y'[t]==n[x[t], y[t]];starterx = x[0] == a; startery = y[0] == b; approxsolutions6 = 
      NDSolve[{equationx, equationy, starterx, startery}, {x[t], y[t]}, {t, 
          0, endtime}]; \(Clear[trajectory]; 

    trajectory[t_] = {
        x[t] /. approxsolutions6[[1]], 
        y[t] /. approxsolutions6[[1]]}; 
    
\(trajectoryplot6 = 
      ParametricPlot[trajectory[t], {t, 0, endtime}, 
        PlotStyle -> {{Red, Thickness[0.015]}}, 
        DisplayFunction -> Identity]; \)\)sixthyplot = 
      Plot[y[t] /. 
          approxsolutions6[[1]], {t, 0, 
          endtime}, PlotStyle -> {{Red, Thickness[0.01]}}, 
        AxesLabel -> {"t", "y[t]"}, PlotRange -> All, 
        AspectRatio -> (1/2), DisplayFunction -> Identity]; sixthphaseportrait = 
      Show[starterplot, trajectoryplot6, PlotRange -> All, 
        Axes -> True, AxesLabel -> {"x", "y"}, 
        DisplayFunction -> Identity]; Show[GraphicsArray[{{firstphaseportrait, secondphaseportrait, 
            thirdphaseportrait}, {fourthphaseportrait, fifthphaseportrait, 
            sixthphaseportrait}}]];

Here are the plots of solutions, y[t], of the same six systems,
all with the same starter data {x[0], y[0]} = {2, 4}:

Show[
      GraphicsArray[{{fourthyplot, secondyplot, sixthyplot}, {firstyplot, 
            thirdyplot, fifthyplot}}]];

Your job is to pair the solution plots with the corresponding trajectory plots.

L.16)

You are using the computer to get the flow plot for the system 
        x'[t]=-0.8 x[t] + 0.3 y[t]
        y'[t]=  0.6 x[t] - 1.1 y[t]
and you get this:

\(A = {{\(-0.8\), 0.3}, {0.6, \(-1.1\)}}; 
\(MatrixForm[A]; \)\)Eigenvalues[A]; Clear[x, y, t];
matrixlinearsystem={x'[t],y'[t]}==A . {x[t], y[t]};
ColumnForm[Thread[matrixlinearsystem]]\(Clear[Field]; 
Field[x_, y_] = A . {x, y}; 
\(scalefactor = 0.3; \)\)\(flowplot = 
      Table[Arrow[scalefactor\ Field[x, y], Tail -> {x, y}, 
          VectorColor -> Blue], {x, \(-2\), 2, 4\/12}, {y, \(-2\), 2, 
          4\/12}]; 

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

Use the flow plot as best you can to determine whether you agree or disagree with the following statements:

a) If the given starter data on {x[0], y[0]} is a point in the plotted region and {x[t], y[t]} is the corresponding solution of this system, then you can expect that  
         x[t] -> 0  and  y[t] -> 0
as t -> ∞.

b) If the given starter data on {x[0], y[0]} is a point in the plotted region and {x[t], y[t]} is the corresponding solution of this system, then you can expect that the plots of both x[t] and y[t] oscillate above and below 0 as t advances.

L.17)

You are using the computer to get the flow plot for the system 
        x'[t]=  0.8 x[t] - 0.7 y[t]
        y'[t]=-0.5 x[t] - 0.4 y[t]
and you get this:

A = -{{-0.8, 0.7}, {-0.5, -0.4}}; MatrixForm[A]; Eigenvalues[A]; Clear[x, y, t];
matrixlinearsystem={x'[t],y'[t]}==A . {x[t], y[t]};
ColumnForm[Thread[matrixlinearsystem]]\(Clear[Field]; 
Field[x_, y_] = A . {x, y}; 
\(scalefactor = 0.3; \)\)\(flowplot = 
      Table[Arrow[scalefactor\ Field[x, y], Tail -> {x, y}, 
          VectorColor -> Blue], {x, \(-2\), 2, 4\/12}, {y, \(-2\), 2, 
          4\/12}]; 

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

Use the flow plot as best you can to determine whether you agree or disagree with the following statements:

a) If the given starter data on {x[0], y[0]} is a point in the plotted region and {x[t], y[t]} is the corresponding solution of this system, then you can expect that  
         x[t] -> 0 and  y[t] -> 0 
as t -> ∞.

b) If the given starter data on {x[0], y[0]} is a point in the plotted region and {x[t], y[t]} is the corresponding solution of this system, then you can expect that the plots of both x[t] and y[t] oscillate above and below 0 as t advances.

LT.18)

Here is a system of differential equations:
       x'[t]=a x[t] + b y[t]
       y'[t]=c x[t] + d y[t].
Here a, b, c, and d stand for numerical constants.
Write down the little matrix A that allows you to express this system in the form
       {x'[t],y'[t]}=A . {x[t], y[t]}.