![](/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.