Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. MATLAB PORTION (1) For the following matrix: 201 1 -111 -1 3 3 -1 -1 4 1 2 1 (a) The operations required to

image text in transcribed

1. MATLAB PORTION (1) For the following matrix: 201 1 -111 -1 3 3 -1 -1 4 1 2 1 (a) The operations required to perform Gaussian Elimination on this matrix can be expressed as matrix multiplication with a series of unit lower diagonal matrices. I'LLAU Each 1 matrix zerok out ane column below the dinganal. Define 15', and Li' in your Matlab script and save them as A11L3inv, A11L2iny, and AllLlins. The command eye(n), which produces and nx n identity matrix may be useful. Check that each matrix does what you expect. (b) Calculate L-LLLSave as All Lin. (c) Compute the inverses LLand Lin Matlab. Save them as A11L3, A 11L2, and AIILI (d) Compute L-L LL, and save it as ALIL. Check that LU - A. (2) Consider the same matrix as before 2 0 1 1 -111 -1 3 3 -1 -1 4 1 2 1 Use the LU factorization function (lufact.m) we wrote in the lecture (also found on LMS) to find the LU decomposition of the above matrix. Compare to problem 1. (3) BONUS QUESTION (optional) Modify the code in lufact.m so that it gives as output L.U and P. That is your new function should perform pivoting if needed. Save your new function and submit it as lufact.pivoting.m. (4) Use the formulas from the lectures and the codes on pages: 164-165 from the book to construct two functions jacobi.m and gseid.m that take as input a matrix A, vector B, an initial guess P, an error error and max number of iterations mar it and gives as output x the solution to AX - B using Jacobi and Gas-Seidel iterations methods respectively Test your codes and solve the following system (if the iterations converge) starting 1 with P-0. 4r-y-15 1+ 5y - 9

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Understand the post-crisis debate on HRM and pedagogy

Answered: 1 week ago

Question

2. (1 point) Given AABC, tan A b b

Answered: 1 week ago