Question: MATLAB jacobi itteration Exercise 1: Poisson's Equation Consider the linear system A, = p, where An is an n n matrix with 2's on the
MATLAB jacobi itteration

Exercise 1: Poisson's Equation Consider the linear system A, = p, where An is an n n matrix with 2's on the main diagonal,-1's directly above and below the main diagonal and 0's everywhere else. For instance, As is 2-100 0 1 2-1 0 0 As=10-1 2-1 0 0 1 2-1 0 0 01 2 This is a discretized version of Poisson's equation: This equation appears very often in physics. We'll learn about discretizations of differential equations later this quarter Construct the matrix Aso in Matlab. Try reading the documentation for diag() to find a simple way to do this. Make the vector such that the jth entry in p, pj, is defined according to the formula P 2 (1-cos (23/51)) sin (23j/51) (a) Write down the matrix form of the Jacobi iteration 1 = MPa + c. Con- catenate the nnatrix M and the vector c and save the resulting 50 51 matrix as Al.dat. (b) Use Jacobi iteration to solve for given an initial guess of a column of ones. Continue to iterate the Jacobi method until every term in the vector is within 10 of the previous iteration. L.e., norm(phic,k+1) . phi(nk), Inf)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
