This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Homework 2 – Math 104B, Winter 2011 Due on Thursday, January 20th, 2011 Problem 1: Repeat the additional problem from homework assignment 1 using Choleski’s factorization to solve the system of equations. Write a subroutine that takes as input the matrix A , and returns the matrix L in the Choleski factorization. Then write a subroutine that takes as input the matrix L and the right hand side b , and returns the solution vector x . In order to test your program, consider the n × n matrix with entries A i,j = 1 if i = j 1 ( i + j ) 2 otherwise For n = 10 and n = 100, pick the right hand side b so that the solution to A x = b is the vector x = (1 , 2 , . . . , n ) (do this in your program, before calling your subroutine). Then solve the system of equations and compute the relative error in the solution. In order to do this, define the absolute error as:  x y  ∞ = max { x 1 y 1  ,  x 2 y 2  , . . . ,  x n y n } Notes: Do not print the solution or the matrix. You must compute theDo not print the solution or the matrix....
View
Full Document
 Fall '08
 Ceniceros,H
 Numerical Analysis, Addition, Equations, Boundary value problem, right hand

Click to edit the document details