You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes. you're right. This example is wrong. You can also check it on sympy online shell .
In addition to the solvers in the solver.py file, we can solve the system Ax=b by passing the b vector to the matrix A’s LUsolve function. Here we’ll cheat a little choose A and x then multiply to get b. Then we can solve for x and check that it’s correct:
`
a = Matrix([ [2, -1, 0], [-1, 2, -1], [0, -1, 2] ])
b = Matrix(3,1,[7,3,2])
x = a.LUsolve(b)
x
`
Which will return a fraction version of the solution.
can you take a look at the LUdecomp.py for the Doolittle algorithm.
If you take the matrix:
a = np.array([[2, -1, 0],
[-1, 2, -1],
[0, -1, 2]],float)
b = np.array([7,3,2], float)
x = array([7.2500, 7.5000, 4.7500])
Which you can get by simply running LUSolve(a,b)
When reading the book, it mentions that the following steps are required:
LUsolve(LUdecomp(a), b)
but this gives:
array([7.6667, 8.3333, 5.6667])
I think this example may be incorrect?
I have checked this with ColeskiSol
choleskiSol(choleski(A),b)
array([7.2500, 7.5000, 4.7500])
Is my assumption correct?
The text was updated successfully, but these errors were encountered: