Returns, which is different in the last decimal place than the key showsįrom what I understand, my equation should work, as according to the Gauss-Seidel method, I'm using the new value of x and y for the iterations.
To test your function, note that gs1_method(2) should return the list
(x 0, y 0) = (0, 0) as your starting approximation. Negative integer n, and returns a list, where x_n and y_n are the values of x_n and y_n respectively for the Gauss-Seidel method when applied to system (1) above. Returns ĭefine a function, called gs1_method, which accepts as input a single non. So I know I have this first iteration right as To test your function, note that gs1_iteration(3,5) should return In other words, gs1_iteration(x,y) should return the results of performing one iteration of the Gauss-Seidel method for system (1) on the inputs x, y. Using the Gauss-Seidel method and equations (2) and (3).
, where new_x is the updated value x_n and new_y is the updated value y_n X and y (which we think of as being x n-1 and y n-1 respectively), and returns a list Define a function, called gs1_iteration, which accepts as input values for