4
scipy.integrate를 사용하는 데 어려움을 겪고 있습니다. tplquad를 사용했는데, integrate
을 사용하여 (잘린) 구의 볼륨을 얻으려면 어떻게해야합니까? 감사합니다scipy.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
odeint은 미분 방정식,하지 적분을 해결하기 위해 사용된다. 나는 정말로 보지 않는다. 당신이 왜 그것을 여기에서 사용하고 싶어하는지. 또한 마지막 두 치수를 분석적으로 통합하여 통합을 단순화 할 수 있으므로 단일 통합으로 남습니다. –