Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
わかりました、私は何が間違っているのですか?Scipyのromberg積分器はベクトル関数を処理できるはずですが、エラーが発生します...
import numpy from numpy import array from scipy import integrate f = lambda x:array([1, x, x**2]) result = integrate.romberg(f, 0, 1, vec_func=True) print(result)
の文書にrombergは次のように書かれています。
romberg
vec_func : bool、オプション func が配列を引数として扱うかどうか (つまり、「ベクトル」関数かどうか)。デフォルトは偽です。
vec_func : bool、オプション
func が配列を引数として扱うかどうか (つまり、「ベクトル」関数かどうか)。デフォルトは偽です。
したがって、引数 x はベクトルにすることができます。