我正在努力使用 scipy.integrate,我使用了 tplquad,但是我怎样才能integrate
获得(截断)球体的体积?谢谢
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