Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please post your matlab code. Thanks! Note: This problem uses the same setup as the Jacobi and Gauss-Seidel questions, but you are asked to calculate

image text in transcribedimage text in transcribedPlease post your matlab code. Thanks!

Note: This problem uses the same setup as the Jacobi and Gauss-Seidel questions, but you are asked to calculate different values. It will probably be useful to copy code from those problems, but make sure that you alter your final answers accordingly. Any matrix A can be composed into a diagonal, upper and lower part: 411 0 0 0 42 - 01 0 0...00 0 0 0 DO 2 - 0 221 0 -- 0 0 1. U = and L= 100 ...a 0 0 - 4-1 al 4,2 - 0,-1 0 lo 0 ... 0 so that A=D+U+L. You can easily find these matrices in Matlab with the commands diag, triu and tril. These matrices are useful for devising different matrix splitting methods. For instance, in the Jacobi method we let A = P +T where P=D and T =U +L, and in the Gauss-Seidel method we set P=D+L and T = U. Another common matrix splitting method is called successive over-relaxation (SOR). It is exactly the same as the splitting methods we have already seen, except we set P=ID+L and T =W-1D+U, where w is a constant between 1 and 2. (Notice that if a = 1 then this is exactly the same as Gauss-Seidel.) We will use this method to solve the system A 103 =p that was described in the Jacobi and Gauss-Seidel problems. As a reminder, the setup for those problems is included at the bottom of this page. I have not included pretests for A, rho or phi in this problem, since you already know how to define them. Instead, you should define the matrices D, U and L for this problem and save them in variables named D, U and L. For any given , the SOR method can be written as De = M01-1+c. For w= 1.6, find the largest in magnitude) eigenvalue of M and save its magnitude in a variable named ans1. (Remember that you can find the magnitude of a number in Matlab with the abs command. Your answer should be a positive real number.) For every value of w between w = 1 and w= 1.99 in increments of 0.01, find the largest in magnitude) eigenvalue of M. Find the value of that gives you the smallest maximum eigenvalue and save this w in a variable named ans2. (That is, find the value of a for which this matrix splitting method will converge the fastest.) Use SOR to solve for with the optimal you found in ans2. Your initial guess should be a vector of all 1's and you should stop when 0- 1

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

US accounting is the best in the world.' Discuss.

Answered: 1 week ago

Question

2. Follow through with fair consequences.

Answered: 1 week ago

Question

5. Explain the supervisors role in safety.

Answered: 1 week ago

Question

7. Explain how an employee could reduce stress at work.

Answered: 1 week ago