Here we want to solve Ax = b using various iterative methods, where A ∈ â„10x10 is given by:
A =
3 1 3 1
1 3 1 1
3 1 3 1
1 3 1 3
and b = (1,...,1)áµ€. Choose câ‚€ = (0,....0)áµ€ as initial guess.
1. Implement the Jacobi iteration method in Python. Your routine should work for any given non-singular matrix A and right-hand side b. Test your routine by solving our sample problem. Record the number of iterations it takes to achieve an iteration error ||k+1 - k|| less than 10â»Â¹âµ.
2. Implement the Gauss-Seidel iteration method in Python. Follow the steps from the previous question.
3. Consider the matrix:
1 1 1
Use Python to produce a plot of the spectral radius of the Jacobi iteration matrix and the Gauss-Seidel iteration matrix as a function of α for α ∈ [2, 8] using 50 equally spaced α values in this interval. What patterns do you see?
4. Adapt your basic Gaussian Elimination code (without pivoting) to take advantage of the structure available if the matrix A is tridiagonal. You need to do this for both the elimination and the back substitution steps! Submit your function and a script which runs your code for matrices of various sizes and times the calculation time. Verify that your code solves these systems in O(n) operations by including sufficient numerical evidence and properly interpreting that numerical evidence.