Question: 3. Write a MATLAB function that solves pentadiagonal systems of equations of size n. A pentadiagonal matrix is a banded one with bandwidth 5 and

3. Write a MATLAB function that solves pentadiagonal systems of equations of size n. A pentadiagonal matrix is a banded one with bandwidth 5 and matrix A is symmetric. Your program should expect as input six vectors of size n, n 1 or n - 2: one right hand side b and the five nonzero diagonals of A It should calculate and return x- A-b using a Gaussian elimination variant that requires O(n) flops and consumes no additional space as a function of n i.e., in total 7n storage locations are required). Try your program on the matrix defined by n = 100,000, aii+,-ai+2,i-1, i41 ai1i-2i, and ai 8i, fora such that the relevant subscripts fall in the range 1 to n. Derive a right hand side vector bAxerct using Xeract = (1, l' . . . , 1, )". Then solve for x given this b and record 11x,rad-X112. 3. Write a MATLAB function that solves pentadiagonal systems of equations of size n. A pentadiagonal matrix is a banded one with bandwidth 5 and matrix A is symmetric. Your program should expect as input six vectors of size n, n 1 or n - 2: one right hand side b and the five nonzero diagonals of A It should calculate and return x- A-b using a Gaussian elimination variant that requires O(n) flops and consumes no additional space as a function of n i.e., in total 7n storage locations are required). Try your program on the matrix defined by n = 100,000, aii+,-ai+2,i-1, i41 ai1i-2i, and ai 8i, fora such that the relevant subscripts fall in the range 1 to n. Derive a right hand side vector bAxerct using Xeract = (1, l' . . . , 1, )". Then solve for x given this b and record 11x,rad-X112
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
