U. Washington
AMATH 352  Winter 2010
Homework 2  Due on 01/22/10
The first exercise should be submitted via Scorelator (4 attempts are available). Remember to use
the command
save
with the flag
ascii
to output your results. Upload only your “.m” files.
1. (15 points) The goal of the exercise is to program the power method, which is the simplest
iterative algorithm to compute the largest eigenpair of a matrix,
i.e.
the pair
(
x
, λ
)
with the
largest value
λ
∈
R
such that
Ax
=
λ
x
. The algorithm goes as follows
•
Input
A
,
x
0
, and
M
.
•
for
k
= 1
to
M
do,
–
y
=
Ax
k

1
–
r
k
= (
y
)
2
/
(
x
k

1
)
2
–
x
k
=
y
/
k
y
k
2
•
end do
where
(
y
)
2
denotes the second component of
y
. Use the matrix and the initial vector
A
=
6
5

5
2
6

2
2
5

1
x
0
=

1
1
1
.
Set
M
= 30
.
The vector
x
30
is the vector
x
k
with
k
= 30
, i.e.
after 30 steps in the loop.
Output the vector
x
30
(in x30.dat) and the ratio
r
30
(in r30.dat). To validate your code, I
recommend that you compute by hand
x
1
,
r
1
,
x
2
, and
r
2
and you compare these values with
the ones from your code.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Winter '07
 Leveque
 Linear Algebra, Derivative, Vector Space, U. Washington

Click to edit the document details