{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

This preview shows pages 1–2. Sign up to view the full content.

COT 3502 Computer Model Formulation Spring 2008 1 Homework # 5 Due Tuesday, March 4 All problems except problem #3 should be done without using VB. 1. (3 points) Prove that the matrix product is associative, i.e. that A ( BC ) = ( AB ) C for any three n × n matrices A , B , and C . 2. (3 points) Solve Problem 9.8 from the textbook. 3. (9 points) Write a VB subroutine Gauss to solve the system of equa- tions A x = b using the “naive” Gaussian elimination, i.e. the Gaussian elimination without pivoting. This subroutine should be completely self- contained, i.e. the user should specify the matrix size N , an N × N matrix A , and an N -dimensional vector b . The subroutine should return an N - dimensional vector x containing the solution. For example, the main program calling this subroutine may look as fol- lows: Sub main() Dim N As Integer Dim A() As Double, b() As Double, x() as Double()

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.

Unformatted text preview: Call read_matrix(N, A) Call read_vector(N, b) Call Gauss(N,A,b,x) Call write_vector(N, x) End Sub Here, read_matrix , read_vector , and write_vector are the input/output subroutines discussed in class. Test your code for the system of equations from Problem 9.8 of the text-book. 4. (3 points) Solve the following system of equations LU x = 1 1 1 1 1 2 4 4 1 2 1 u v w = 2 2 (1) COT 3502 Computer Model Formulation Spring 2008 2 without multiplying matrices L and U . 5. (3 points) Use the Gauss-Jordan method to invert the following matrix: A = 2-1-1 2-1-1 2 (2)...
View Full Document

{[ snackBarMessage ]}