-
Notifications
You must be signed in to change notification settings - Fork 0
/
task_eigenvalues.tex
50 lines (35 loc) · 1.01 KB
/
task_eigenvalues.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
% THIS IS WHERE SYMBOLIC COMPUTATION & RANDOMIZATION HAPPENS
\begin{luacode*}
symcomp = require "symcomp"
random = require "random"
local baseMatrices =
{
"[-2, 1] [12, -3]",
"[-5, -3] [-3, 3]",
"[4, -5] [-5, 4]"
}
local k = random.integer(-5, 5)
local base = symcomp.matrix(random.oneof(baseMatrices))
A = symcomp.scalarMul(k, base)
I = symcomp.identityMatrix(2)
lambdaI = symcomp.scalarMul("lambda", I)
AminusLambdaI = symcomp.matrixSub(A, lambdaI)
det = symcomp.det(AminusLambdaI)
\end{luacode*}
\question
Find all eigenvalues and eigenvectors of the matrix
\begin{equation*}
A = \scprint{A}.
\end{equation*}
\begin{solution}
Calculate $A-\lambda I_2$:
\begin{equation*}
A-\lambda I_2 = \scprint{A} - \lambda\scprint{I} = \scprint{AminusLambdaI}.
\end{equation*}
Then, calculate $\det(A-\lambda I_2)$.
\begin{equation*}
\det(A-\lambda I_2) = \scprint{det}
\end{equation*}
Now, we solve $\det(A-\lambda I_2)=0$.
\scprint{symcomp.printeigenvalues(A, "A")}
\end{solution}