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 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
- Spring '08
- Vector Space, Boundary value problem, LU factorization