我想使用Python查找任何顺序的Chebysev多项式的根。我已经看到勒让德多项式的similar threads。但是,我使用here定义为
的方法构造了多项式import numpy as np
import sympy as sp
f0 = lambda x: chebyt(0,x)
f1 = lambda x: chebyt(1,x)
f2 = lambda x: chebyt(2,x)
f3 = lambda x: chebyt(3,x)
f4 = lambda x: chebyt(4,x)
plot([f0,f1,f2,f3,f4],[-1,1])
我曾尝试使用np.roots(f4)
,但收到以下错误:TypeError: float() argument must be a string or a number, not 'function'
。此外,即使可以,it seems that也不适用于高阶多项式。