快乐星球 发表于 2022-3-11 21:21:33

sympy的diff函数求导


大佬们,我用sympy里的diff函数对一个十阶多项式求导,竟然耗时20秒

start = time.time()
x = symbols('x')
w =

f = 0
length = len(w)
for i in range(length):
    f += w*x**i
ds_1 = diff(f,x,1)
zhu =solve(ds_1, x)
end = time.time()
print(ds_1)
print(zhu)
print('求导耗时%f秒'%(end - start))
页: [1]
查看完整版本: sympy的diff函数求导