{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hw5 - 999 Take the vector b such that b i = 2 001 2 Use LU...

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

ASE 211 Homework 5 Due: In class, Wednesday, February 23rd. 1. By hand, compute the LU factorization, without row pivoting, of the following matrix: A = 6 3 1 3 1 0 2 2 4 . Check your result using the matlab lu function. 2. Write matlab routines forsolve.m and backsolve.m which solve L y = b and U x = y once the LU factorization of A is computed. Test your routines on the matrix above with right hand side b = (22 , 8 , 32) . Remember you have to permute the rows of b before the forward solve. Hand in your scripts and your diary. 3. In engineering applications, we often have to solve differential equations numerically. Depending on the differential equation, this can lead to a linear algebra problem. For example, take A to be a 1000 by 1000 matrix, with a ii = 2 , i = 1 , . . . , 1000 and a i,i +1 = a i +1 ,i = - 1 , i = 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 999 . Take the vector b such that b i = 2 * ( . 001) 2 . Use LU factorization and forward and back substitution to solve A x = b and plot the vector x using the matlab command plot(x) . Hand in your scripts and your diary. This linear system arises when approximating the diﬀerential equation ±-x 00 ( t ) = 2 , < t < 1 , x (0) = x (1) = 0 using a ﬁnite diﬀerence method (which we’ll discuss later in the semester). This problem is called a two point boundary value problem. The exact solution is x ( t ) = t (1-t ) . Hint : Use “for” loops to assign the matrix values. For example, n=1000; a=zeros(n,n); for i=1:n-1 a(i,i) = 2; a(i,i+1) = -1; a(i+1,i) = -1; end a(n,n) = 2;...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online