Python | Scipy integrate.tplquad() method
With the help of scipy.integrate.tplquad()
method, we can get the triple integration of a given function from limit a to b by using scipy.integrate.tplquad()
method.
Syntax : scipy.integrate.tplquad(func, a, b)
Return : Return the triple integrated value of a polynomial.
Example #1 :
In this example we can see that by using scipy.integrate.tplquad()
method, we are able to get the triple integrated value of a polynomial from limit a to b by using this method.
from scipy import integrate
gfg = lambda z, y, x: x * y * z + x * * 2 + y * * 2 + z * * 2
geek = integrate.tplquad(gfg, 1 , 3 , lambda x: 2 , lambda x: 3 ,
lambda x, y: 0 , lambda x, y: 1 )
print (geek)
|
Output :
27.000000000000004
Example #2 :
from scipy import integrate
gfg = lambda z, y, x: x * * 2 + y * * 2 + z * * 2 + 1
geek = integrate.tplquad(gfg, 1 , 3 , lambda x: 2 , lambda x: 3 ,
lambda x, y: 0 , lambda x, y: 1 )
print (geek)
|
Output :
24.0
Last Updated :
23 Jan, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...