DE.08 Linearizations
 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];

Pendulum Stuff

modticksX[gr_Graphics,m_] :=
   Module[{f,x},
     f[{a_,"",st___}] := {a,""};
     f[{a_,b_,st___}] := {a,b m};
     Show[gr,
        AxesOrigin->Reverse[FullOptions[gr,AxesOrigin]],
        Ticks->{Map[f,FullOptions[gr,Ticks][[1]]],
                Automatic}]
]

modticksY[gr_Graphics,m_] :=
   Module[{f,x},
     f[{a_,"",st___}] := {a,""};
     f[{a_,b_,st___}] := {a,b m};
     Show[gr,
        AxesOrigin->Reverse[FullOptions[gr,AxesOrigin]],
        Ticks->{Automatic,
                Map[f,FullOptions[gr,Ticks][[2]]]
               }]
]

Clear[center,angle,length,a,l,pendulum,calibratedpendulum];

pendulum[length_,angle_]:=
Module[
{center:={length Sin[Pi-angle],length Cos[Pi-angle]}},

Show[

Graphics[{Blue,Thickness[.01],
Line[{{0,0},{0,-(length+3)}}]}],

Graphics[{Blue,
Polygon[{{-5,-(length+3)},{-5,-(length+3.5)},{-5.3,-(length+3.5)},
{-5.3,-(length+4)},{5.3,-(length+4)},{5.3,-(length+3.5)},
{5,-(length+3.5)},{5,-(length+3)},{-5,-(length+3)}}]}],

Graphics[{Black,
Disk[{0,0},length,{(-Pi/2+angle-Pi/84),(-Pi/2+angle+Pi/84)}]}],

Graphics[{Black,
Disk[center,length,{(Pi/2+angle-Pi/500),(Pi/2+angle+Pi/500)}]}],

Graphics[{Red,PointSize[.05],Point[{0,0}]}],

Graphics[{Red,
Disk[center,length/5,{0,360 Degree}]}],

Graphics[{GoldenrodLight,
Disk[center,length/6,{330 Degree,350 Degree}]}],

Graphics[{Red,
Disk[center,length/7,{0,360 Degree}]}],

Graphics[{Black,PointSize[.02],Point[center]}],


AspectRatio->Automatic,
PlotRange->{{length+5,-(length+3)},{(length+4),-(length+4)}},
AxesOrigin->{0,0},
DisplayFunction->Identity]
]

calibratedpendulum[length_,angle_]:=
Module[
{center:={length Sin[Pi-angle],length Cos[Pi-angle]}},

Show[

Graphics[{Blue,Thickness[.01],
Line[{{0,0},{0,-(length+3)}}]}],

Graphics[{Blue,
Polygon[{{-5,-(length+3)},{-5,-(length+3.5)},{-5.3,-(length+3.5)},
{-5.3,-(length+4)},{5.3,-(length+4)},{5.3,-(length+3.5)},
{5,-(length+3.5)},{5,-(length+3)},{-5,-(length+3)}}]}],

Graphics[{Black,
Disk[{0,0},length,{(-Pi/2+angle-Pi/84),(-Pi/2+angle+Pi/84)}]}],

Graphics[{Black,
Disk[center,length,{(Pi/2+angle-Pi/500),(Pi/2+angle+Pi/500)}]}],

Graphics[{Red,PointSize[.05],Point[{0,0}]}],

Graphics[{Red,
Disk[center,length/5,{0,360 Degree}]}],

Graphics[{GoldenrodLight,
Disk[center,length/6,{330 Degree,350 Degree}]}],

Graphics[{Red,
Disk[center,length/7,{0,360 Degree}]}],

Graphics[{Black,PointSize[.02],Point[center]}],

Graphics[Text[StringForm["y[t] =  ``",angle],
{8 length/8 Sin[15 Pi/12], 8 length/8 Cos[5Pi/6]}]],

AspectRatio->Automatic,
PlotRange->{{length+5,-(length+3)},{(length+4),-(length+4)}},
AxesOrigin->{0,0},DisplayFunction->Identity]
]

L.1)

Here is a system:
    x'[t]=-x[t] y[t] +  1
    y'[t]=  x[t] y[t] -  y[t]
     
a) Explain how you know that this system is non-linear.

b) Explain how you know that {x, y} = {1, 1} is an equilibrium point of this system.

c) What information do you seek when you linearize at this equillibrim point?

d) Linearize this system at {1, 1} and write down the resulting coefficient matrix.

e) The eigenvalues of a cleared matrix 
           A=(({{a, b}, {c, d}}))
are given by 
          (1/2) (Trace[A] + (Sqrt[Trace[A]^2 - 4 Det[A]]))
and
          (1/2) (Trace[A] - (Sqrt[Trace[A]^2 - 4 Det[A]]))
where 
          Trace[A] = a + d
and 
          Det[A] = a d - b c.
Use these formulas and a cheap calculator and apply them to the matrix you came up with in part d) above to determine whether the equillibrium point {1, 1} is an attractor, a repeller (or neither) of the given system.

L.2)

a) What do you mean when you say that {a, b} is an equilibrium point of a given system
          x'[t]=m[x[t], y[t]]
          y'[t]=n[x[t], y[t]]?
          
b) Given that {a, b} is an equilibrium point of a given system
          x'[t]=m[x[t], y[t]]
          y'[t]=n[x[t], y[t]], 
come up with exact formulas for the solutions x[t] and y[t] with starter data x[0] = a and y[0] = b.

L.3)

What good is the fact that near the equilibrium point of a given system, the linearization approximates the given system very, very well?

L.4)

a) Here is a scaled plot of the flow of a certain system
         x'[t]=m[x[t], y[t]]
         y'[t]=n[x[t], y[t]]
 centered on an equilibrium point:

\(Clear[m, n, x, y, t]; 
m[x_, y_] = \(-4.3\)\ Sin[x] + 0.17\ y; 

    \(n[x_, y_] = \(-0.50\)\ x - 1.29\ y + 1.2; \)\)diffeqsystem={x'[t],y'[t]}=={m[x[t], y[t]], n[x[t], y[t]]};
ColumnForm[Thread[diffeqsystem]]\(Clear[Field]; 
Field[x_, y_] = {m[x, y], n[x, y]}; 

    \({xequilib, yequilib} = {0.04, 0.9}; \)\){xlow, xhigh} = {xequilib - 2, xequilib + 2}; {ylow, yhigh} = {yequilib - 2, yequilib + 2}; jump = (1/3); flowplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}, VectorColor -> Blue, 
          ScaleFactor -> 0.25, HeadSize -> 0.2], {x, xlow, xhigh, 
          jump}, {y, ylow, yhigh, jump}]; nonlinearflow = 
      Show[flowplot, Axes -> True, AxesLabel -> {"x", "y"}, 
        Epilog -> {PointSize[0.04], Red, Point[{xequilib, yequilib}]}];

Is the equilibrium point a repeller or an attractor?

b) Here is the flow of the linearization of the system in part a):

\(Clear[A, gradm, gradn, h]; 

    gradm[x_, y_] = {∂\_x m[x, y], ∂\_y m[x, y]}; 

    \(gradn[x_, y_] = {∂\_x n[x, y], ∂\_y n[x, y]}; \)\)A[x_, y_] = {gradm[x, y], gradn[x, y]}; h = 2; linearized={x'[t],y'[t]}==Chop[Expand[
              A[xequilib, yequilib] . {x[t] - xequilib, y[t] - yequilib}]]
            ;\(Clear[linearizedField]; 

    linearizedField[x_, y_] = 
      A[xequilib, yequilib] . {x - xequilib, y - yequilib}; 

    \(linearizedflow = 
      Table[Arrow[linearizedField[x, y], Tail -> {x, y}, 
          VectorColor -> Red, ScaleFactor -> 0.25, 
          HeadSize -> 0.2], {x, xlow, xhigh, jump}, {y, ylow, yhigh, 
          jump}]; \)\)linearizedflowplot = 
      Show[linearizedflow, 
        PlotRange 
          -> {{xequilib - h, xequilib + h}, {yequilib - h, 
              yequilib + h}}, Axes -> True, 
        AxesLabel -> {"x", "y"}, 
        PlotLabel -> "Linearized at equilibrium"];

Here are both flows together:

Show[linearizedflowplot, nonlinearflow, 
      PlotLabel -> "Linearized and Original Flows"]

How does this plot signal that the original system was not linear?

c) Take another look at the plot of both flows. What principle about a system and its linearization at an equilibrium point does this plot display?

d) You are given starter data and you go to the linearization to come up with approximate formulas for the solutions of the original nonlinear system. 
If you are given starter data {x[0], y[0]} = {2, 2.5}, would you trust the formula you get from the linearization to be a
trustworthy approximations of the real thing?  Why or why not?

If you are given starter data {x[0], y[0]} = {0.5, 2.5}, would you trust the formula you get from the linearization to be a
trustworthy approximations of the real thing?  Why or why not?

L.5)

The damped pendulum oscillator is modeled by the second order differential equation
         y''[t]+((b y'[t])/(L M))+((g Sin[y[t]])/L)=0.
          where
g is gravity, L is the length of the pendulum, M is the mass of the bob, and b is friction.  Convert this system to a system of two first order differential equations, linearize it, and then convert the linearization back into a single second order differential equation.

L.6)

Use your experience to help write a few words about when the pendulum oscillator is well approximated by its linearization and when it is not.

L.7)

a) The coefficient matrix of the linearization of a certain system at an equilibrium point has eigenvalues
       0.3 + 1.3 I and 0.3 - 1.3 I.
Is this enough to tell you that the equilibrium point is definitely a repeller?

b) The coefficient matrix of the linearization of a certain system at an equilibrium point has eigenvalues
       -0.3 + 1.3 I and -0.3 - 1.3 I.
Is this enough to tell you that the equilibrium point is definitely a attractor?

c) The coefficient matrix of the linearization of a certain system at an equilibrium point has eigenvalues
        0.4 I and -0.4 I.
Is this enough to tell you that trajectories of this system oscillate around the equilibrium point on closed curves?

d) Here is the flow of a nonlinear system in the vicinity of an equilibrium point:

Clear[m, n, x, y, t, a, b, c, d]; a = 0.2; b = 0.1; c = 0.8; d = 0.4; m[x_, y_] = a x - b x y + 0.8 (((x - 2))^2); n[x_, y_] = -c y + d x y; diffeqsystem={x'[t],y'[t]}=={m[x[t], y[t]], n[x[t], y[t]]};\(Clear[Field]; 
Field[x_, y_] = {m[x, y], n[x, y]}; 

    \({xequilib, yequilib} = {2, 2}; \)\){xlow, xhigh} = {xequilib - 1, xequilib + 1}; {ylow, yhigh} = {yequilib - 1, yequilib + 1}; jump = (1/6); flowplot = 
      Table[Arrow[Field[x, y], Tail -> {x, y}, VectorColor -> Blue, 
          ScaleFactor -> 0.5, HeadSize -> 0.2], {x, xlow, xhigh, 
          jump}, {y, ylow, yhigh, jump}]; nonlinearflow = 
      Show[flowplot, Axes -> True, AxesLabel -> {"x", "y"}, 
        Epilog -> {PointSize[0.04], Red, Point[{xequilib, yequilib}]}];

This makes it clear that the equilibrium point is a repeller.  But the eigenvalues of the linearization at the equilibrium point are 
         0.4 I and -0.4 I.
So the linearization predicts neither a repeller nor an attractor. Does this make you want to change your answers to any of the previous parts? Why or why not?

L.8)

What are Lyapunov's rules?

L.9)

You are dealing with a gradient system
        x'[t]=m[x[t], y[t]]
        y'[t]=n[x[t], y[t]]
This means that there is a function f[x, y] with 
        m[x, y] = (∂_x) f[x, y]
and 
        n[x, y] = (∂_y) f[x, y];
i.e. 
        {m[x, y], n[x, y]} = ▽f[x, y] (gradient).
Remember that the ▽f[x, y]points in the direction of greatest initial increase of f[x, y] as {x, y} leaves {a, b}.

a) When you linearize a gradient system at an equilibrium point {xx, yy} and find that the eigenvalues of the resulting matrix are both negative, which do you expect:
i)    f[xx, yy] > f[x, y] for {x, y} nearby {xx, yy}; i.e. the equilibrium point is a local maximizer of f[x, y]: 
ii)   f[xx, yy] < f[x, y] for {x, y} nearby {xx, yy}; i.e. the equilibrium point is a local minimizer f[x, y];  
iii)  f[xx, yy] < f[x, y] for some {x, y} nearby {xx, yy} and f[xx, yy] > f[x, y] for some other {x, y} nearby {xx, yy}; i.e. the equilibrium point is a saddle point of f[x, y].

b) When you linearize a gradient system at an equilibrium point {xx, yy} and find that the eigenvalues of the resulting matrix are both positive, which do you expect:
i)    f[xx, yy] > f[x, y] for {x, y} nearby {xx, yy}; i.e. the equilibrium point is a local maximizer of f[x, y]: 
ii)   f[xx, yy] < f[x, y] for {x, y} nearby {xx, yy}; i.e. the equilibrium point is a local minimizer f[x, y];  
iii)  f[xx, yy] < f[x, y] for some {x, y} nearby {xx, yy} and f[xx, yy] > f[x, y] for some other {x, y} nearby {xx, yy}; i.e. the equilibrium point is a saddle point of f[x, y].

c) When you linearize a gradient system at an equilibrium point {xx, yy} and find that one of the eigenvalues of the resulting matrix is positive and the other eigenvalue is negative, which do you expect:
i)    f[xx, yy] > f[x, y] for {x, y} nearby {xx, yy}; i.e. the equilibrium point is a local maximizer of f[x, y]: 
ii)   f[xx, yy] < f[x, y] for {x, y} nearby {xx, yy}; i.e. the equilibrium point is a local minimizer f[x, y];  
iii)  f[xx, yy] < f[x, y] for some {x, y} nearby {xx, yy} and f[xx, yy] > f[x, y] for some other {x, y} nearby {xx, yy}; i.e. the equilibrium point is a saddle point of f[x, y].

L.10)

You have a friend who was looking at a math cook book and thought that the cook book said that to check the nature of an equilibrium point {p, q} of a given system
         x'[t]=m[x[t], y[t]]
         y'[t]=n[x[t], y[t]]
you look at the eigenvalues of the matrix

       (({{(∂_x) m[x, y], (∂_y) m[x, y]}, {(∂_x) n[x, y], (∂_y) n[x, y]}}))/.{x -> p,  y -> q}

Was your friend right?