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