December 2017
Intermediate to advanced
386 pages
10h 42m
English
The whole preceding process is implemented in code as follows:
from scipy import linalg
A=[[1,3,5],[2,5,1],[2,3,8]]b=[[10],[8],[3]]
Now, we will look into the function used to solve the equation A*x = b.
Method 1 (using the functions we have learnt so far)
Multiply the inverse of A with b.
np.dot(linalg.inv(A),b)
Method 2 (using the solve function)
Using the solve function within the scipy package helps in solving the equation straight away:
scipy.linalg.solve(x, b)
The output of either of the preceding methods is the solution, as follows:
array([[-9.28], [ 5.16], [ 0.76]])
Calculating the ...
Read now
Unlock full access