MATH 3511 HW 3 Due: Thu Feb 8, 2018 Name: Date: Question ...

MATH 3511

HW 3

Due: Thu Feb 8, 2018

Name:

Date:

Collaborators: (Collaborators submit their individually written assignments together)

Question: 1 2 3 4 5 6 Total

Points:

30 20 15 20 15 10 110

Score:

Instructor/grader comments:

Page 1 of 4

MATH 3511

HW 3

Due: Thu Feb 8, 2018

Condition numbers

1. Compute the condition numbers of the following matrices relative to |?|. Use matlab to calculate inverted matrices.

(a) (10 points)

1 -1 -1

A = 00

1 0

--11

(b) (10 points)

1/25 1/100 -1/100

B

=

1/ 5 1

1/ 2 2

-1/ 5 4

(c) (10 points)

C=

1 1.00001

2 2

Steepest descent method

2. (20 points) Program in matlab the following algorithm:

Given the inputs A, b, a starting value x, a maximum number of iterations imax, and an error tolerance :

i=0

r = b - Ax = rt ? r

0 = while i < imax and > 0

q = Ar

=

r t ?q

x = x + r

if mod (i, 50) == 0

r = b - Ax

else

r = r - q

end = rt ? r

i =i+1

end

Page 2 of 4

MATH 3511

HW 3

Due: Thu Feb 8, 2018

3. (15 points) Use the code to conduct numerical experiments regarding the performance of the steepest descent method.

Use the following parameters:

4 -1 0 0 0 0

A = -00001

4 -1 0 0 0

-1 4 -1 0 0

0 -1 4 -1 0

0 0 -1 4 -1

-00401

0 b = -50662

x = zeros(6,1), maxit = 100, eps = 0.0000000001.

Plot the convergence parameter vs the iteration number. Clearly describe your conclusions in your project's readme file. Place the code you wrote for this part of the homework in a single matlab file, e.g. hw03a.m

Conjugate gradient method

4. (20 points) Program in matlab the following algorithm:

Given the inputs A, b, a starting value x, a maximum number of iterations imax, and an error tolerance :

i=0

r = b - Ax

d=r new = rt ? r 0 = new while i < imax and new > 0

q = Ad

=

new d t ?q

x = x + d

if mod (i, 50) == 0

Page 3 of 4

MATH 3511

HW 3

Due: Thu Feb 8, 2018

r = b - Ax

else

r = r - q

end

old = new

new = rt ? r

=

new old

d = r + d

i =i+1

end

5. (15 points) Use the code to conduct numerical experiments to compare the performance of the steepest descent method and the conjugate gradient method.

Use the following parameters:

4 -1 0 0 0 0

A = -00001

4 -1 0 0 0

-1 4 -1 0 0

0 -1 4 -1 0

0 0 -1 4 -1

-00401

0 b = -50662

x = zeros(6,1), maxit = 100, eps = 0.0000000001.

On the same graph plot the convergence parameter vs the iteration number for all methods. Clearly describe your conclusions in your project's readme file. Place the code you wrote for this part of the homework in a single matlab file, e.g. hw03b.m

Gitlab

6. (10 points) Create a gitlab project called hw03 (name it exactly as shown). Upload all required matlab code and create your readme file. Share the project with the instructor.

Page 4 of 4

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download