Scipy.integrate.tplquad дает неправильный результат для интеграла по большому объему ⇐ Python
Scipy.integrate.tplquad дает неправильный результат для интеграла по большому объему
I'm trying to integrate a function of 3 variables f(x,y,z) over all space.
When I integrate over a small volume, I get roughly the right result. However, when I increase the volume of integration, python says that the integral is zero.
I'm fairly confident that the issue here is that the function f is only non-zero in a small region of space, and tplquad dosen't sample over this region enough when the integration volume is large. I found an answer to a similar problem in 1D at this link; scipy.integrate.quad gives wrong result on large ranges. The solution in 1D was to pass an argument 'points' to scipy.integrate.quad, and this helped quad focus on the interval where the integral was non-zero.
My question is; is there a similar argument to 'points' for tplquad?
Or perhaps some other way I can instruct tplquad to focus on a particular region of space?
Источник: https://stackoverflow.com/questions/512 ... rge-volume
I'm trying to integrate a function of 3 variables f(x,y,z) over all space.
When I integrate over a small volume, I get roughly the right result. However, when I increase the volume of integration, python says that the integral is zero.
I'm fairly confident that the issue here is that the function f is only non-zero in a small region of space, and tplquad dosen't sample over this region enough when the integration volume is large. I found an answer to a similar problem in 1D at this link; scipy.integrate.quad gives wrong result on large ranges. The solution in 1D was to pass an argument 'points' to scipy.integrate.quad, and this helped quad focus on the interval where the integral was non-zero.
My question is; is there a similar argument to 'points' for tplquad?
Or perhaps some other way I can instruct tplquad to focus on a particular region of space?
Источник: https://stackoverflow.com/questions/512 ... rge-volume
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как векторизовать scipy.integrate.quad для вычисления поэлементного интеграла матрицы
Anonymous » » в форуме Python - 0 Ответы
- 70 Просмотры
-
Последнее сообщение Anonymous
-