summaryrefslogtreecommitdiff
path: root/homeworks/hw-7.org
blob: 2c28af2d7e7e58275753f676a5ea3a91cc7a3ae5 (plain)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#+TITLE: Homework 7
#+AUTHOR: Elizabeth Hunt
#+LATEX_HEADER: \notindent \notag  \usepackage{amsmath} \usepackage[a4paper,margin=1in,portrait]{geometry}
#+LATEX: \setlength\parindent{0pt}
#+OPTIONS: toc:nil

* Question One
See ~UTEST(eigen, dominant_eigenvalue)~ in ~test/eigen.t.c~ and the entry
~Eigen-Adjacent -> dominant_eigenvalue~ in the LIZFCM API documentation.
* Question Two
See ~UTEST(eigen, leslie_matrix_dominant_eigenvalue)~ in ~test/eigen.t.c~
and the entry ~Eigen-Adjacent -> leslie_matrix~ in the LIZFCM API
documentation.
* Question Three
See ~UTEST(eigen, least_dominant_eigenvalue)~ in ~test/eigen.t.c~ which
finds the least dominant eigenvalue on the matrix:

\begin{bmatrix}
2 & 2 & 4 \\
1 & 4 & 7 \\
0 & 2 & 6 
\end{bmatrix}

which has eigenvalues: $5 + \sqrt{17}, 2, 5 - \sqrt{17}$ and should thus produce $5 - \sqrt{17}$.

See also the entry ~Eigen-Adjacent -> least_dominant_eigenvalue~ in the LIZFCM API
documentation.
* Question Four
See ~UTEST(eigen, shifted_eigenvalue)~ in ~test/eigen.t.c~ which
finds the least dominant eigenvalue on the matrix:

\begin{bmatrix}
2 & 2 & 4 \\
1 & 4 & 7 \\
0 & 2 & 6 
\end{bmatrix}

which has eigenvalues: $5 + \sqrt{17}, 2, 5 - \sqrt{17}$ and should thus produce $2.0$.

With the initial guess: $[0.5, 1.0, 0.75]$.

See also the entry ~Eigen-Adjacent -> shift_inverse_power_eigenvalue~ in the LIZFCM API
documentation.
* Question Five
See ~UTEST(eigen, partition_find_eigenvalues)~ in ~test/eigen.t.c~ which
finds the eigenvalues in a partition of 10 on the matrix:

\begin{bmatrix}
2 & 2 & 4 \\
1 & 4 & 7 \\
0 & 2 & 6 
\end{bmatrix}

which has eigenvalues: $5 + \sqrt{17}, 2, 5 - \sqrt{17}$, and should produce all three from
the partitions when given the guesses $[0.5, 1.0, 0.75]$ from the questions above.

See also the entry ~Eigen-Adjacent -> partition_find_eigenvalues~ in the LIZFCM API
documentation.

* Question Six
Consider we have the results of two methods developed in this homework: ~least_dominant_eigenvalue~, and ~dominant_eigenvalue~
into ~lambda_0~, ~lambda_n~, respectively. Also assume that we have the method implemented as we've introduced,
~shift_inverse_power_eigenvalue~.

Then, we begin at the midpoint of ~lambda_0~ and ~lambda_n~, and compute the
~new_lambda = shift_inverse_power_eigenvalue~
with a shift at the midpoint, and some given initial guess.

1. If the result is equal (or within some tolerance) to ~lambda_n~ then the closest eigenvalue to the midpoint
   is still the dominant eigenvalue, and thus the next most dominant will be on the left. Set ~lambda_n~
   to the midpoint and reiterate.
2. If the result is greater or equal to ~lambda_0~ we know an eigenvalue of greater or equal magnitude
   exists on the right. So, we set ~lambda_0~ to this eigenvalue associated with the midpoint, and
   re-iterate.
3. Continue re-iterating until we hit some given maximum number of iterations. Finally we will return
   ~new_lambda~.