Home /
Expert Answers /
Advanced Math /
implement-using-matlab-jacobi-iterative-method-purpose-to-solve-ax-b-given-an-initial-approximati-pa970
(Solved): implement using matlab Jacobi Iterative Method. Purpose: To solve Ax=b, given an initial approximati ...
implement using matlab
Jacobi 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 Set xi?=(bi???j=1j?=i?n?aij?XOj?)/aii? Step 4. If ?x?XO?<TOL, then OUTPUT x1?,…,xn?. STOP Step 5. Set k=k+1 Step 6. For i=1,…,n set XOi?=xi?. Step 7. OUTPUT('Max number of iterations exceeded'). STOP