#MACM #Discrete Maths

profilepaavni
CA2-macm.pdf

MACM 316 - Computing Assignment 2

• Read the Guidelines for Assignments first. • Submit a one-page PDF report to Crowdmark and upload your Matlab scripts (as

m-files) to Canvas. Do not use any other file formats. • Keep in mind that Canvas discussions are open forums. • You must acknowledge any collaborations/assistance from colleagues, TAs,

instructors etc.

From the textbook, Burden and Faires (10th edition):

Consider the matrix equation in Applied Exercise 14a of Section 7.3. We shall refer to the corresponding matrix as , the vector as . The iterate of a numerical approximation will be denoted . (a) Write your own Jacobi code for solving the system with a general and a stopping criterion

Approximate the solution with and . How many iterations are needed for each ? Plot the approximation for

(b) Solve the system using Matlab’s “backslash operator” for

. We shall assume that the backslash operator gives the exact solutions.

Once again, approximate the solution with using your code, but now iterate until the relative error is less than . Find a mathematical relationship between and the number of iterations.

(c) Do the number of iterations in part (a) and (b) agree? Explain why this result occurs.

A [P1, P2, …, Pn−1] T

p kth p(k)

n

| | p(k) − p(k−1) | |∞ | | p(k) | |∞

< TOL

n = 20, 40, 80 TOL = 10−3 n

n = 80.

n = 20,40,80

n = 20,40,80 TOL = 10−3

n

MACM 316 - Computing Assignment 2

Continued on page 2.

Submit your 1 page report for this question to Crowdmark in .pdf format according the Assignment Guidelines described in the syllabus.

Submit your Matlab code to Canvas "Computing Assignment 2 - Matlab Code”. Do not include identifying information on your report.

After marking, we will post a few exemplary reports as sample solutions. We appreciate your support on this. If you do not wish to have your report posted, please state so at the top of your report.