title: how to use scipy.integrate to get the volume of a truncated sphere?
body: <p>I'm struggling with using scipy.integrate, I used tplquad, but how can I used <code>integrate</code> to get the volume of (truncated)sphere? Thanks</p>
  
  <pre><code>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
  </code></pre>