Chapter 12 - Eigenvalues and Eigenvectors

Section 12.6 - The Geometry of the Ellipse Using Eigenvalues and Eigenvectors

Example 12.6.1

A={{12,-2},{-7,-1}};

UnitCircle={{Cos[t]},{Sin[t]}};

UnitCirclePlot=ParametricPlot[Flatten[UnitCircle],{t,0,2π},PlotStyle->{Blue,Thickness[0.01]}];

(ATimesUnitCircle=A.UnitCircle)//MatrixForm

ATimesUnitCirclePlot=ParametricPlot[Flatten[ATimesUnitCircle],{t,0,2π},PlotStyle->{Red,Thickness[0.01]}];

Show[UnitCirclePlot,ATimesUnitCirclePlot,PlotRange->All]

A.{{1},{0}}

Angle1=N[VectorAngle[A[[All,1]],{1,0}]]

Length1=Norm[A[[All,1]]]

A.{{0},{1}}

Angle2=N[VectorAngle[A[[All,2]],{0,1}]]

Length2=Norm[A[[All,2]]]

Manipulate[ArrowPlots={Graphics[{Arrowheads[.04],Thickness[.005],Red,Arrow[{{0,0},Flatten[A.UnitCircle]/.t->tval}]}],Graphics[{Arrowheads[.03],Thickness[.004],Blue,Arrow[{{0,0},Flatten[UnitCircle]/.t->tval}]}]};
Show[UnitCirclePlot,ATimesUnitCirclePlot,ArrowPlots,PlotRange->All],{{tval,0,"t"},0,2π,π/32}]

EigVals=Eigenvalues[A]

EigVects=Eigenvectors[A]

AEigVec1=N[EigVals[[1]] EigVects[[1]]/Norm[EigVects[[1]]]]

AEigVec2=N[EigVals[[2]] EigVects[[2]]/Norm[EigVects[[2]]]]

AEigVecPlots=Graphics[{Arrowheads[.03],Thickness[.005],Black,Arrow[{{0,0},AEigVec1}],Arrow[{{0,0},AEigVec2}]}];

Show[UnitCirclePlot,ATimesUnitCirclePlot,AEigVecPlots,PlotRange->All,AxesOrigin->{-14,-8}]

SinCos=Solve[{x,y}==Flatten[ATimesUnitCircle],{Sin[t],Cos[t]}]

G=Expand[Simplify[(((Sin[t])^2)+((Cos[t])^2)-1)/.SinCos]]

PlotG=ContourPlot[Evaluate[G==0],{x,-13,13},{y,-13,13},ContourStyle->{Red,Thickness[0.01]},PlotRange->{{-13,13},{-10,10}},Axes->True,Frame->False,AspectRatio->10/13]

B={{25/338,41/338},{41/338,37/169}};

{BEigVec1,BEigVec2}=N[Eigenvectors[B]]

α1=Solve[(G==0)/.{x->α BEigVec1[[1]],y->α BEigVec1[[2]]},α][[1]]

α2=Solve[(G==0)/.{x->α BEigVec2[[1]],y->α BEigVec2[[2]]},α][[1]]

BEigVec1.BEigVec2

BEigVecPlots=Graphics[{Arrowheads[.03],Thickness[.005],Black,Arrow[{{0,0},α BEigVec1/.α1}],Arrow[{{0,0},α BEigVec2/.α2}]}];

Show[PlotG,BEigVecPlots,PlotRange->{{-13,13},{-10,10}},AspectRatio->10/13]

{a,b}={Norm[α BEigVec2/.α2],Norm[α BEigVec1/.α1]}

PlotStandardForm=ContourPlot[{((x^2)/(a^2)) +((y^2)/(b^2)) ==1},{x,-15,15},{y,-15,15},ContourStyle->{Blue,Thickness[0.01]},PlotRange->{{-15,15},{-10,10}},Axes->True,Frame->False,AspectRatio->2/3];

Show[PlotStandardForm,PlotG]

VectorAngle[-BEigVec2,{1,0}]/Degree

Example 12.6.2

PlotOrigEllipse=ContourPlot[{5 (x^2)-8 x y+17 (y^2)==1},{x,-.6,.6},{y,-.6,.6},ContourStyle->{Red,Thickness[0.01]},PlotRange->{{-.6,.6},{-.4,.4}},Axes->True,Frame->False,AspectRatio->2/3]

(B={{5,-4},{-4,17}})//MatrixForm

BEigVals=N[Eigenvalues[B]]

(Q=Transpose[N[Eigenvectors[B]]])//MatrixForm

Q[[All,1]].Q[[All,2]]

{L1,L2}={Norm[Q[[All,1]]],Norm[Q[[All,2]]]}

(QN=Transpose[{Q[[All,1]]/L1,Q[[All,2]]/L2}])//MatrixForm

Chop[Transpose[QN].QN]//MatrixForm

{K,L}=1/Sqrt[BEigVals]

PlotNewEllipse=ContourPlot[{((x^2)/(L^2)) +((y^2)/(K^2)) ==1},{x,-.6,.6},{y,-.6,.6},ContourStyle->{Blue,Thickness[0.01]},PlotRange->{{-.6,.6},{-.4,.4}},Axes->True,Frame->False,AspectRatio->2/3];

Show[PlotOrigEllipse,PlotNewEllipse]

BEigVecPlots=Graphics[{Arrowheads[.03],Thickness[.005],Black,Arrow[{{0,0},K QN[[All,1]]}],Arrow[{{0,0},L QN[[All,2]]}]}];

Show[PlotOrigEllipse,BEigVecPlots]

VectorAngle[QN[[All,2]],{1,0}]/Degree