![]() array (solutionArrayBase ) print ( "Solution Matrix B: " ,b ) initial_guess = np. array (QuestionMatrix ) print ( "Matrix A: " ,A ) b = np. #Assiging the values to a function residual_convergence = 1e - 5 omega = 1.7 A = np. matmul (A, phi ) - b ) step += 1 print ( "Step ". shape ) : if j != i : sigma += A * phi phi = ( 1 - omega ) * phi + (omega / A ) * (b - sigma ) residual = np. ![]() This program implements GaussSeidel Method in python programming language. This method is also known as Liebmann method or the method of successive displacement. ![]() Gauss-Seidel method is defined as the iterative technique that helps us solve a number of linear equations. Its name is based on Carl Friedrich Gauss and Philipp Ludwig von Seidel, known as great German Mathematicians. #Updating the secondary and tertiary diagonals to -1 for i in range ( len (QuestionMatrix ) ) : for j in range ( len (QuestionMatrix ) ) : if not i =j : if i - 3 convergence_criteria : for i in range (A. GaussSeidel method is an iterative method to solve a set of linear equations and very much similar to Jacobi's method. Gauss-Seidel method is a mathematical method used to solve the linear equations of the given system. diag (lengthArrayBase ) QuestionMatrix = * len (lengthArrayBase ) for _ in range ( len (lengthArrayBase ) ) ] for i, e in enumerate (lengthArrayBase ) : QuestionMatrix = e ![]() LengthArrayBase = * 50 #Array of 50 element where each entry is 5 solutionArrayBase = * 50 #Array of 50 element where each entry is 2 solutionArrayBase = 1 #Updating the first entry to 1 solutionArrayBase = 1 #Updating the last entry to 1 initialConditionArray = * 50 #Array of 50 element where each entry is 0 #Diagnalizing the matrix by 5 np.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |