Author: Not specified Language: text
Description: Not specified Timestamp: 2017-06-26 04:44:58 +0000
View raw paste Reply
  1. #!/usr/local/bin/python3
  2.  
  3. import numpy as np
  4. from scipy.integrate import simps
  5.  
  6. def f(x):
  7.     return (x + x/2)**2
  8.  
  9. x = np.array([1, 2])
  10. y = f(x)
  11. i = simps(y, x)
  12.  
  13. print(i)
  14.  
View raw paste Reply