Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- from scipy import linalg
- from scipy import matrix
- a = np.array([[1, 2], [3, 4]])
- d = linalg.det(a)
- print(a.dtype)
- b = linalg.inv(a)
- print(linalg.inv(a))
- print(np.dot(a, b))
- print(b[1][1])
- c = np.array([[-2., 1.], [ 1.5, -0.5]])
- print(b - c)
- print(np.dot(a, c))
- #a = np.array([[1, 2], [2, 4]])
- #print(linalg.inv(a))
- print(matrix.trace(a))
- print(matrix.transpose(a))
- print(linalg.eig(a)[1])
- a = np.array([[1, 2, 3], [1, 5, 6], [0, 0, 4]])
- b = np.array([0, 0, 1])
- c = linalg.solve_triangular(a, b)
- print(np.dot(a, c))
- from scipy.integrate import *
- print(quad(np.sin, 0, np.pi / 2))
- print(quad(lambda x : x * x, 0, 1))
- print(quadrature(np.sin, 0, np.pi/2, tol=0.5e-6))
- print(dblquad(lambda x, y: x * y, 0, 1, lambda x: 0, lambda x: x))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement