how to use scipy.integrate to get the volume of a truncated sphere?
I'm struggling with using scipy.integrate, I used tplquad, but how can I used integrate to get the volume of (truncated)sphere? Thanks import scipy from scipy.integrate import quad, dblquad, tplquad from math import* from numpy import * R = 0.025235 #radius theta0 = acos(0.023895) #the angle from the edge of truncated plane to the center of sphere def f_1(phi,theta,r): return r**2*sin(theta)*phi**0 Volume = tplquad(f_1, 0.0,R, lambda y: theta0, lambda y: pi, lambda y,z: 0.0,lambda y,z: 2*pi) print Volume To truncate by angle it is convenient to use a spherical coordinate systems. Assuming the