buildMatrix[λ1_,λ2_,v1_,v2_]:=Quiet[If[(Divide@@v1==Divide@@v2)||(Im[λ1]≠0&&(v1=={0,0}||v2=={0,0}))||(λ1==λ2==0),{{0,0},{0,0}},If[Im[λ1]==0,
Transpose[{v1,v2}].DiagonalMatrix[{λ1,λ2}].Inverse@Transpose[{v1,v2}],Chop[Transpose[{(v1+v2 I),(v1+v2 I)\[Conjugate]}].DiagonalMatrix[{λ1,λ1\[Conjugate]}].Inverse@Transpose[{(v1+v2 I),(v1+v2 I)\[Conjugate]}]]]]//N]

Manipulate[If[λ1[[2]]≠0,λ2=λ1*{1,-1},λ2[[2]]=0];
vField=buildMatrix[λ1.{1,I},λ2.{1,I},eVec[[1]],eVec[[2]]].{x,y};
StreamPlot[vField,{x,-(zoom^3),(zoom^3)},{y,-(zoom^3),(zoom^3)},Epilog->{Red,Thick,
Tooltip[Arrow[{{0,0},eVec[[1]]}],Text@Style[Row[{"Eigenvalue: ",
If[λ1[[2]]≠0,Row[{λ1[[1]]," ± ",λ1[[2]]}],Chop@λ1.{1,I}],If[λ1[[2]]==0," - Eigenvector: "," - Real part of Eigenvector: ",],eVec[[1]]}]]],Green,
Tooltip[Arrow[{{0,0},eVec[[2]]}],Text@Style[Row[{"Eigenvalue: ",If[λ1[[2]]≠0,Row[{λ1[[1]]," ± ",λ1[[2]]}],Chop@λ2.{1,I}],If[λ1[[2]]==0," - Eigenvector: "," - Im part of Eigenvector: ",],eVec[[2]]}]]]},Axes->True,Frame->False,AxesOrigin->{0,0},
StreamPoints->ControlActive[Coarse,Medium]],

Row[
{Text[Style[Column[{"↑",
"Im","↓"},Alignment->Center]]],
Column[
{Text@Style[
"Eigenvalues:",Bold,FontSize->12],
Text@Style[
"←  Real ->"],Control@{{λ1,{1,0},""},{-5,-5},{5,5},{0.5,0.5}},
Dynamic@Text@Style[
Row[{"λ1 = ",
λ1.{1,I}}],Bold,Red,FontSize->12]},Alignment->Center],"     ",
Column[
{"","",Dynamic@If[λ1[[2]]==0,Control@{{λ2,{3,0},""},{-5,-5},{5,5}},
Control@{{λ2,{3,0},""},{-5,-5},{5,5},Enabled->False}],
Dynamic@Text@Style[
Row[{"λ2 = ",
λ2.{1,I}}],Bold,Green,FontSize->12]},Alignment->Center],"               ",
Dynamic@Text@Style[Column[{"System:","",
Row[{" (dx/dt) = ",Chop@vField[[1]]}],"",Row[{" (dy/dt) = ",Chop@vField[[2]]}]}],FontSize->12]}
],

{{eVec,{{-2,1},{1,3}}},Locator,Appearance->None},

{{vField,{{1,0},{0,1}}},ControlType->None},


Item[Column[{" ",
Text@Style["Zoom"],
Control@{{zoom,2,""},0.01,10,ControlType->VerticalSlider}},Alignment->Center],ControlPlacement->Left],

SaveDefinitions->True
]

Eigenvalue Explorer

Eigenvalues, eigenvectors, and the phase plane

- Marcus McGuff, Austin Community College

You can change the eigenvectors by dragging the vectors on the graph.  If you choose a complex eigenvalue, the red vector represents the real part of the eigenvector (corresponding to λ1) and the green one represents the imaginary part.  (The other eigenvector is of course the complex conjugate in this case.)  In order to choose a complex eigenvalue, you must use λ1; when its imaginary part becomes non-zero, λ2 automatically becomes its complex conjugate.

buildMatrix[λ1_,λ2_,v1_,v2_] :=Quiet@N@
If[Divide @@ v1 == Divide @@v2 || 
(Im[λ1] != 0 && (v1 == {0, 0} || v2 =={0, 0})) || λ1 == λ2 == 0,{{0, 0}, {0, 0}}, 
        If[Im[λ1] == 0, 
         Transpose[{v1,v2}].DiagonalMatrix[{λ1, λ2}].Inverse[Transpose[{v1,v2}]], 
         Chop[Transpose[{v1+v2*I,Conjugate[v1 + v2*I]}].DiagonalMatrix[{λ1,Conjugate[λ1]}].Inverse[Transpose[{v1 + v2*I,Conjugate[v1+v2*I]}]]]]
]

Manipulate[
If[λ1[[2]]!= 0,λ2 = λ1*{1, -1},λ2[[2]] = 0];

If[viewType≠"2-D control",λ1={λ1a,λ1b};λ2b=-λ1b;λ2={λ2a,λ2b}];

vField = buildMatrix[λ1 . {1, I}, 
      λ2 . {1, I}, eVec[[1]], 
      eVec[[2]]] . {x, y}; 

StreamPlot[vField, {x, -zoom^3, zoom^3}, {y, -zoom^3, zoom^3}, 
Epilog -> 
{Red, Thick,
Tooltip[Arrow[{{0, 0}, eVec[[1]]}],
Text[Style[
Row[{"Eigenvalue: ", 
If[λ1[[2]] != 0, Row[{λ1[[1]], " ± ", λ1[[2]]}], Chop[λ1].{1, I}],
If[λ1[[2]] == 0, " - Eigenvector: ", " - Real part of Eigenvector: "], 
eVec[[1]]}]]]], 
Green, 
Tooltip[Arrow[{{0, 0}, eVec[[2]]}], 
Text[Style[Row[{"Eigenvalue: ", 
If[λ1[[2]] != 0, Row[{λ1[[1]], " ± ",λ1[[2]]}], Chop[λ2].{1, I}], 
If[λ1[[2]] == 0, " - Eigenvector: "," - Im part of Eigenvector: "], 
eVec[[2]]}]]]]}, 
Axes -> True, Frame -> False, AxesOrigin ->{0, 0}, 
StreamPoints -> ControlActive[Coarse, Medium]], 

Column[{
Text[Style["System:", Bold, FontSize -> 12]],""
Dynamic@Text[Style[Row[{
Row[{"     ","(dx/dt) = ", Chop[vField[[1]]]}], "         ",
 Row[{"(dy/dt) = ", Chop[vField[[2]]]}]}], FontSize -> 12]],""}],
Column[{
Control@{{viewType,"2-D control",""},{"2-D control","Slider control"}},"",

Row[{ 
Text[Style["Eigenvalues:", Bold, FontSize -> 12]],
"         ",
Dynamic@If[viewType=="2-D control",Text[Style[Column[{"↑", "Im", "↓"}, Alignment -> Center]]],""], 

Dynamic@If[viewType=="2-D control",
Column[{
Text[Style["←  Real ->"]],
Control@{{λ1, {1, 0}, ""}, {-5, -5}, {5, 5},{0.5, 0.5}, ControlPlacement -> 1},
Dynamic[Text[Style[Row[{"λ1 = ", λ1 . {1, I}}], Bold, Red, FontSize -> 12]]]}, 
Alignment -> Center],
Column[{
Text[Style["←  Real ->"]],
Control@{{λ1a,1, ""}, -5,5,ImageSize->Small},
Text[Style["←  Im  ->"]],
Control@{{λ1b,0, ""}, -5,5,ImageSize->Small},
Dynamic[Text[Style[Row[{"λ1 = ", λ1a," + ",λ1b,"I"}], Bold, Red, FontSize -> 12]]]}, 
Alignment -> Center]], 
"     ", 

Dynamic@If[viewType=="2-D control",
Column[{"",
Dynamic[
If[λ1[[2]] == 0, 
Control@{{λ2, {3, 0}, ""}, {-5, -5}, {5, 5}},  
Control@{{λ2, {3, 0}, ""}, {-5, -5}, {5, 5}, 
Enabled -> False}]], 
Dynamic[Text[Style[Row[{"λ2 = ", λ2 . {1, I}}], Bold, Green, FontSize -> 12]]]}, 
Alignment -> Center],
Column[{ 
Text[Style["←  Real ->"]],
Control@{{λ2a,3, ""}, -5,5,ImageSize->Small},
Text[Style["←  Im  ->"]],
Control@{{λ2b,0, ""}, -5,5,ImageSize->Small,Enabled -> False},
Dynamic[Text[Style[Row[{"λ2 = ", λ2a," + ",λ2b,"I"}], Bold, Red, FontSize -> 12]]]}, 
Alignment -> Center]]
}]}],

 
 
{{eVec, {{-2, 1}, {1, 3}}}, Automatic, ControlType -> Locator, Appearance -> None}, 
{{vField, {1x + 0.5y, 0.8x + 2y}}, ControlType -> None}, 

Item[Column[{" ", Text[Style["Zoom"]], 
Control@{{zoom, 2, ""}, 0.01, 10, ControlType -> VerticalSlider,ControlPlacement -> 4}}, 
Alignment -> Center], 
ControlPlacement -> Left],

SaveDefinitions->True]