Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. Consider the linear system 21 2-1 -1 2 -1 -1 2 bi b2 b3 -1 13 -1 -1 In-1 bn-1 2 -1 2 br
3. Consider the linear system 21 2-1 -1 2 -1 -1 2 bi b2 b3 -1 13 -1 -1 In-1 bn-1 2 -1 2 br (a) Write a function x = trisolve1(b) which solves the system Tx = b, where T is the above tridiagonal matrix. Use the MATLAB backslash operator (x = T\b). Test your script for b (1,0,0,0,1) corresponding to the exact solution x = (1,1,1,1,1). (b) Show that an LU decomposition of T consists of two bi-diagonal matrices, u -1 1 12 u2 -1 13 1 u3 -1 L= U= In-1 un-1 -1 1 In 1 where li = -(i-1)/i and U; = (i+1)/i and no permutations are required. You may verify this by matrix mutiplication. Design an algorithm which takes advantage of zero elements to solve LUX = b, implement your algorithm as the function x = trisolve2(b). Test your script on the same example in (a). (c) Use both trisolvel or trisolve2 to solve for x when b = rand(n,1) for n = 200, 400, 800, 1600, 3200, 6400, 12800, and make a table with the solution times (use tic/toc). Also represent the data in your table graphically (one plot). Interpret the results
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started