446proj4

# 446proj4 - 1 In Matlab this is c=ones(n,1 Deﬁne the...

This preview shows page 1. Sign up to view the full content.

MATH 446 / OR 481 SAUER SPRING 2010 Project 4 Gaussian Elimination and Error Magniﬁcation In theory, Gaussian Elimination computes the exact solution of a system of equations. This project explores what happens when we implement the algorithm in ﬂoating-point arithmetic. If we com- pute in double precision, can we expect solutions that are correct to double precision, or somewhat near to double precision? This would be equivalent to Relative Forward Error 10 - 16 . 1. Implement the Matlab code for Gaussian Elimination of Section 2.1 of the text (no row exchanges etc. need be done). Verify that your code is correct by demonstrating on a system Ax=b of four equations in four unknowns. Check your answer by multiplying A times your output x and comparing with b . 2. Deﬁne the n × n matrix A whose (i,j) entry is A ij = 2 i + 3 j ( i + j ) 2 . Deﬁne the “correct solution” vector c to have all components equal to
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 . In Matlab, this is c=ones(n,1) . Deﬁne the vector b=A * c . Then solve Ax = b for x using your Gaussian elimination code, and determine the relative forward error and relative backward error of your computed solution x . Make a table of RFE, RBE, and the ratio of the two Error Magniﬁcation Factor = RFE RBE for n = 6 , 8 , 10 , 12 , 14 . 3. Repeat Step 2 for the matrix B ij = 2 i + 3 j ( i + j ) 2 ( mod 1) . The matrix B consists of the fractional parts of the entries of the matrix A . You may want to use Matlab’s mod or rem command to ﬁnd the fractional part of a number. Compare the results you obtained with matrix A with those of matrix B . Begin your report by answering the three questions above. Print out the Matlab code used and your Matlab session, and include these with your report. Due: Thurs., March 18...
View Full Document

## This note was uploaded on 10/27/2010 for the course MATH 446 taught by Professor Staff during the Spring '08 term at George Mason.

Ask a homework question - tutors are online