Question

In: Advanced Math

(a) Solve the linear system Az = b using the following three methods: I. The GE+PP...

(a) Solve the linear system Az = b using the following three methods:

I. The GE+PP algorithm for sparse (banded) linear systems, which is the default algorithm used by Matlab’s “\” operator when the matrix (call it Asparse) is of sparse type. You may find it easiest to set up the matrix using the spdiags command.

II. The GE+PP algorithm for dense linear systems, again using “\”. Here, you need a dense version of A which you can obtain either with the diag command or more simply by typing Adense = full(Asparse)

III. The Gauss-Seidel iterative algorithm, also using the matrix Asparse. You may make use of the gs2 code from lectures, setting the parameters tol = 1e-8 and maxiter = 1e5, and taking initial guess z0 = (1, 1, . . . , 1)T .

For each method, compute the solution with n = 100 and n = 1000 points. How do the three methods compare in terms of cost? (use elapsed time from Matlab’s tic / toc as a proxy for cost). How well do your three answers agree with each other? (use the vector 2-norm to compare the differences). Which result do you think is most accurate?

Solutions

Expert Solution


Related Solutions

Solve the linear system Az = b using the following methods: I. The GE+PP algorithm for...
Solve the linear system Az = b using the following methods: I. The GE+PP algorithm for sparse (banded) linear systems, which is the default algorithm used by Matlab’s “\” operator when the matrix (call it Asparse) is of sparse type. You may find it easiest to set up the matrix using the spdiags command.
Write a function to solve a system of linear equations of the form Ax= b using...
Write a function to solve a system of linear equations of the form Ax= b using the iterative Gauss-Seidel method. You are free to use any basic MATLAB operation to implement the algorithm (i.e. you may use any combination of loops, indexing, math, etc.), but avoid “built-in” solution methods — you would not be allowed to use the GaussSeidel function if such a function existed. The function must also test for a number of possible issues. If an issue is...
Set and solve a linear system find a polynomial pp of degree 4 such that p(0)=1,...
Set and solve a linear system find a polynomial pp of degree 4 such that p(0)=1, p(1)=1, p(2)=11, p(3)=61, and p(4)=205. Your answer will be an expression in x. Modifying your calculation, and without starting from scratch, find a polynomial qq of degree 4 such that q(0)=2, q(1)=3, q(2)=34, q(3)=167, and q(4)=522. q(x) = ?
Solve the following linear program using both the graphical and the simplex methods: Max 2X1 +...
Solve the following linear program using both the graphical and the simplex methods: Max 2X1 + 8 X2 s.t. 3X1 + 9X2 <= 15 2X1 + X2 >= 12 X1, X2 >= 0 Show graphically how the simplex method moves from one basic feasible solution to another. Find the coordinates of all extreme points of the feasible region. From the graphic I can see there's no solution , but how to prove it through simplex method? Thank you!
Describe at least three distinct ways to solve a system of equations using linear algebra. (Distinct...
Describe at least three distinct ways to solve a system of equations using linear algebra. (Distinct means that the approach is fundamentally different.) Be specific and detailed using linear algebra vocabulary. It might be helpful to pick an example problem and illustrate each of the three methods.   Suppose T1 and T2 are linear transformations from Rn to Rn. Let T(x) = T2(T1(x)) The responses should be very clear like you are writing instructions to someone who doesn’t know the process.  ...
Write a python program that can solve system of linear equations in three variables using input...
Write a python program that can solve system of linear equations in three variables using input function. Paste your program in a word document or notepad. Note that I am using pycharm. please use a not really complex codes, thanks
SET UP BUT DO NOT SOLVE the following system of linear equations: A company sells three...
SET UP BUT DO NOT SOLVE the following system of linear equations: A company sells three sizes of fruit trays. The small size contains 200 gr of watermelons and 100 gr of grapes. The medium size contains 400 gr of watermelons, 100 gr of pineapples, and 300 gr of grapes. The large size contains 600 gr of watermelons, 200 gr of pineapples, and 400 gr of grapes. Suppose that the company receives an order for 28 kg of watermelons, 6...
Solve the linear system of equations Ax = b, and give the rank of the matrix...
Solve the linear system of equations Ax = b, and give the rank of the matrix A, where A = 1 1 1 -1 0 1 0 2 1 0 1 1 b = 1 2 3
Question 1 Using MATLAB solve the following system of linear simultaneous equations 3x + 2y -...
Question 1 Using MATLAB solve the following system of linear simultaneous equations 3x + 2y - z = 10........... [1] -x + 3y + 2z = 5........... [2] x - y - z = -1 .................[3] s + 2t - 3u + 4v = 12........... [1] 2s + 2t - 2u + 3v = 10......... [2] t + u = -1............................ [3] s - t + u - 2v = -4................ [4]
in parts a and b use gaussian elimination to solve the system of linear equations. show...
in parts a and b use gaussian elimination to solve the system of linear equations. show all algebraic steps. a. x1 + x2 + x3 = 2 x1 - x3 = -2 2x2 + x3 = -1 b. x1 + x2 + x3 = 3 3x1 + 4x2 + 2x3 = 4 4x1 + 5x2 + 3x3 = 7 2x1 + 3x2 + x3 = 1
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT