![](/img/trans.png)
[英]How can I integrate this function using the scipy.integrate library?
[英]How to use scipy.integrate tplquad for a function that requires more than three (3) arguments
我正在构建一个需要6个(六个)参数的python函数,但是返回一个包含三个变量的函数。 我要在scipy.integrate tplquad方法中使用的最后一个返回值。
让“ Function1”成为第一个说的函数,因此我定义:
def Function1(z,y,x,e,N,a):
{code}
return Function2
其中Function2 = f(z,y,x)
然后,我需要在另一个愿意使用tplquad集成方法的python函数中使用Function2,据说它需要“一个Python函数或至少包含三个变量(z,y,x)的方法”。
所以我的问题是,如何在tplquad方法中实现(如果可能的话)具有3个以上参数的函数,同时要理解三个第一个参数为'z,y,x'。
尝试tplquad(f,..., args=(e, N, a))
。 或者,传入一个lambda: tplquad(lambda z, y, x: Function1(z,y,x, e, N, a), ...)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.