Gauss-Seidel Solver for Python 2.7 -


is there python 2.7 package contains gauss-siedel solver systems more 3 linear algebraic equations containing more 3 unknowns? simple example of sort of problem solve given below. if there no templates or packages available, possible solve in python? if please advise on best way of going it. thanks.

an example of 3 linear algebraic equations 3 unknowns (x,y,z):

x - 3y + z = 10

2x + 5y + z = 4

-x + y - 2z = -13

after bit of searching around found solution use numpy.linalg.solve command. command uses lapack gesv routine solve problem; not sure iterative technique uses.

here code solve problem if interested:

a = np.array([[1,-3,1],[2,5,1],[-1,1,-2]]) b = np.array([10,4,-13])  x = np.linalg.solve(a, b)  print x  print np.allclose(np.dot(a, x), b)      # check solution found 

Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -