MATH 105LA Linear System and SOR Iterative Method Matlab Program

User Generated

Qayooo

Mathematics

MATH 105LA

MATH

Description

Please follow the instruction and write a matlab program to answer the three questions. All the requirements are attached in the document.

Unformatted Attachment Preview

Math 105LA Computer Assignment 6 Due Sun Dec 6 1. Consider the linear system  4 −1 0  x1   −1       −1 4 −1 x 2  =  4        0 −1 4  x 3   −5 a). Find the exact solution of the system. b). Let Tω is the iteration matrix for the SOR method applied to the above linear system. What is the optimal value of the relaxation parameter ω = ω * ? And what is the spectral radius ρ(Tω ) ? Refer to Theorem 7.26 below. c). Write a matlab code for computing the approximate solutions for a linear system using the SOR method. Solve the above system using the optimal choice of ω * , as * well as ω * /2 and 2 ω . Explain your results. SOR Iterative Method Purpose: To solve Ax = b , given an initial approximation x (0). INPUT: The number of equations and unknowns n; the matrix (A )ij = aij , the entries bi , the entries of XO = x (0) , for 1 ≤ i, j ≤ n ; the error tolerance TOL; the maximum number of iterations N. OUTPUT: The approximate solution x1 ,, xn or a message that the number of iterations was exceeded. Step 1. Set k = 1 Step 2. While k ≤ N do Steps 3-6. Step 3. For i=1,…,n ω i−1 Set x i = (1 − ω )XOi +  bi − ∑ aij x j − aii  j =1   ∑ aij XO j  j =i+1  n Step 4. If || x − XO ||< TOL , then OUTPUT x1,..., x n . STOP Step 5. Set k = k +1 Step 6. For i=1,..,n set XOi = x i . Step 7. OUTPUT(‘Max number of iterations exceeded’). STOP
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hi, here is your assignment with matlab file,,if you have questions, please let me know.

Math 105LA Computer Assignment 6
Due Sun Dec 6

Question 1:
Matlab code:
% Part a: the exact solution of the system
A=[4 -1 0;-1 4 -1;0 -1 4];
b=[-1;4;-5];
fprintf('exact solution is')
x=linsolve(A,b)
%Part b: Let T? is the iteration matrix for the SOR method applied to
%the above linear system.What is the o...


Anonymous
Just what I needed. Studypool is a lifesaver!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags