Advertisement
High_Light

решение мариц python

May 23rd, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. from numpy import sqrt
  2. from scipy.optimize import minimize
  3. import numpy as np
  4.  
  5. A= np.array([[3.0, 1.0],[3.0,-1.0]])
  6. B= np.array([2.0, 7.0, 9.0, -4.0])
  7. #print np.linalg.det(A)
  8.  
  9.  
  10.  
  11. G=([[5.0, 1.0, -2.0, 1.0],[1.0, -1.0, 1.0, -1.0],[1.0, 1.0, 1.0, 1.0],[1.0, -2.0 ,-1.0, 1.0]])
  12.  
  13. a_1= np.linalg.inv(G)
  14. #rint a_1
  15.  
  16. print np.dot( a_1, B)
  17. print np.linalg.solve(G, B)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement