◼
Vector Transformations and Eigenvectors of 2*2 Matrix
◼
This entire manipulate module with notebook code is available from Wolfram Demonstrations Project at https://demonstrations.wolfram.com/VectorTransformationsAndEigenvectorsOf22Matrix/
◼
Just run the manipulate cell and then make your changes to the module panel output without adjusting any code.
In[]:=
Manipulate[Module[{A,x,result},A=Function[t,ToExpression[{{aa,bb},{cc,dd}}]][t];x=Function[t,ToExpression[{x1,x2}]][t];result=A.x;Text@Column[{Framed[Labeled[Row[{MatrixForm[{StringForm["(``×``)+(``×``)",Style[aa,FontColorRed],Style[x1,FontColorBlue],Style[bb,FontColorBrown],Style[x2,FontColorPurple]],StringForm["(``×``)+(``×``)",Style[cc,FontColorOrange],Style[x1,FontColorBlue],Style[dd,FontColorGreen],Style[x2,FontColorPurple]]}]," = ",MatrixForm[{{aa,bb},{cc,dd}}.{x1,x2}]}],Row[{"matrix vector product ",Style["A·x",Italic]," = ",Style["b",Italic]}],Top]],Framed[Labeled[MatrixForm[StringForm["(``×``)-(``×``)",Style[aa,FontColorRed],Style[dd,FontColorGreen],Style[bb,FontColorBrown],Style[cc,FontColorOrange]]],Row[{"determinant ",Style["A",Italic]," calculation"}],Top]],Framed[Labeled[(StringForm["(1/((``×``)-(``×``)))",Style[aa,FontColorRed],Style[dd,FontColorGreen],Style[bb,FontColorBrown],Style[cc,FontColorOrange]])×MatrixForm[{{StringForm["``",Style[dd,FontColorGreen]],StringForm["``",Style[-bb,FontColorBrown]]},{StringForm["``",Style[-cc,FontColorOrange]],StringForm["``",Style[aa,FontColorRed]]}}],Row[{"inverse ",Style["A",Italic]," calculation"}],Top]],Framed[TableForm[Table[{Eigensystem[A][[1,n]],MatrixForm[Eigensystem[A][[2,n]]]},{n,1,Length[Eigensystem[A][[1]]]}],TableHeadings{None,{"eigenvalue λ",Row[{"eigenvector ",Style["y",Italic]}]}}]],Row[{"matrix ",Style["A",Italic]," moves black vector ",Style["x",Italic]," to ",Style["b",Italic]}],Graphics[{{Black,Arrowheads[.05],Thick,Arrow[{{0,0},x}]},{color,Arrowheads[.05],Thick,Arrow[{{0,0},result}]}},AxesTrue,GridLinesAutomatic,ImageSize{200,200},AspectRatio1]},ItemSize{30,Automatic}]],Row[{"matrix ",Style["A",Italic]," = ",TraditionalForm[MatrixForm[{{a,b},{c,d}}]]," = ",Dynamic[MatrixForm[{{aa,bb},{cc,dd}}]]}],Grid[{{Control@{{aa,1,Style["a",Italic]},-20,20,1,ImageSizeTiny},Control@{{bb,2,Style["b",Italic]},-20,20,1,ImageSizeTiny}},{Control@{{cc,4,Style["c",Italic]},-20,20,1,ImageSizeTiny},Control@{{dd,7,Style["d",Italic]},-20,20,1,ImageSizeTiny}}}],"",Row[{"vector ",Style["x",Italic]," = ",TraditionalForm[MatrixForm[{{j},{k}}]]," = ",Dynamic[MatrixForm[{{x1},{x2}}]]}],{{x1,5,Style["j",Italic]},-20,20,1,ImageSizeTiny},{{x2,6,Style["k",Italic]},-20,20,1,ImageSizeTiny},"",{{color,Red},Red},"",Row[{"determinant ",Style["A",Italic]," = ",Dynamic[Det[{{aa,bb},{cc,dd}}]]}],"",Row[{"inverse ",Style["A",Italic]," = ",Dynamic[If[Det[{{aa,bb},{cc,dd}}]≠0,MatrixForm[Inverse[{{aa,bb},{cc,dd}}]],"This matrix is not invertible."]]}],"","first eigenvalue × first eigenvector",Row[{Subscript["λ","1"],"×",Subscript[Style["y",Italic],"1"]," = ",Dynamic[MatrixForm[Eigensystem[{{aa,bb},{cc,dd}}][[1,1]]×Eigensystem[{{aa,bb},{cc,dd}}][[2,1]]]]}],"","second eigenvalue × second eigenvector",Row[{Subscript["λ","2"],"×",Subscript[Style["y",Italic],"2"]," = ",Dynamic[MatrixForm[Eigensystem[{{aa,bb},{cc,dd}}][[1,2]]×Eigensystem[{{aa,bb},{cc,dd}}][[2,2]]]]}],ControlPlacementLeft]
Out[]=