Unformatted text preview: i = 1 , . . . , 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) . This linear system arises when approximating the diﬀerential equationx 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 (1t ). Hint : Use ’for’ loops to assign the matrix values. For example, n=1000; a=zeros(n,n); for i=1:n1 a(i,i) = 2; a(i,i+1) = 1; a(i+1,i) = 1; end a(n,n) = 2;...
View
Full Document
 Spring '08
 N/A
 Vector Space, Boundary value problem, LU factorization

Click to edit the document details