0% found this document useful (0 votes)
22 views

CSE 403 Programming Assignment 2: Jacobi Method

This document provides instructions for Programming Assignment 2 which involves implementing the Jacobi method to solve a system of linear equations. Students are asked to write a MATLAB function that takes matrices A and b as input, along with an initial guess x0, tolerance, and maximum number of iterations. The function should return the solution x and error at each iteration, check that inputs are valid, and display convergence or divergence messages.

Uploaded by

haftamu_hailu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

CSE 403 Programming Assignment 2: Jacobi Method

This document provides instructions for Programming Assignment 2 which involves implementing the Jacobi method to solve a system of linear equations. Students are asked to write a MATLAB function that takes matrices A and b as input, along with an initial guess x0, tolerance, and maximum number of iterations. The function should return the solution x and error at each iteration, check that inputs are valid, and display convergence or divergence messages.

Uploaded by

haftamu_hailu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CSE 403 Programming Assignment 2

Jacobi Method Write a MATLAB function to implement the Jacobi-Method to solve a system of linear equations of the form Ax=b function [x, err] = jacobi(A, %input % A = the matrix A in Ax = % b = the matrix b in Ax = % x0 = initial guess % maxIter = maximum number %output %x = Solution %err = ||Ax b|| endfunction Display the history of the solution(matrix), and the iteration level Determine whether the iterations will converge or may diverge, and displays an appropriate message. (NB: You can only know if it will for sure converge, but not if it will for sure diverge.) Check if the matrix A is square, and display an error message that it can not handle it. (NB: it can be handled, but I don't want u to do that now) Check if the matrix b is a column vector Check if the initial guess, x0, is a column vector of the same as the matrix b Check if the matrix A and the matrix b have the compatible dimensions, and display an error message and exits if that is not satisfied. Check if tolerance and maximum iteration values are numeric and display appropriate messages if they are not. b, x0, tol, maxIter) b b of iterations

Deadline: department specific Weight: 10% Work: Individual Submission media: moodle

You might also like