Monday, November 18, 2024
Google search engine
HomeLanguagesPython | Scipy integrate.tplquad() method

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.




# import scipy.integrate.tplquad
from scipy import integrate
  
gfg = lambda z, y, x: x * y*z + x**2 + y**2 + z**2
  
# using scipy.integrate.tplquad() method
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 :




# import scipy.integrate.tplquad
from scipy import integrate
gfg = lambda z, y, x: x**2 + y**2 + z**2 + 1
  
# using scipy.integrate.tplquad() method
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

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments