Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def numint(f,alpha,beta,N,b,c):
- x = np.linspace(alpha,beta,N).reshape(N,1);
- h = np.ones(N,dtype=float)*(x[1] - x[0]);
- h = h.reshape(N,1);
- c1 = np.array(c).reshape(1,np.size(c));
- functionResult = f(x+h*c1);
- print(b*functionResult);
- #dif = np.diff(functionResult);
- #print(dif);
- result = 0;
- result = np.sum(h[1:N+1] * np.sum(b*functionResult));
- return result;
Advertisement
Add Comment
Please, Sign In to add comment