是否有一个sympy函数来提取负幂单项式的系数?

问题描述 投票:0回答:2

我有一个多项式:eps * x ^ 3-x ^ 2 + 2 + 3 * x * eps ^(-2)。如何获得包括负数在内的所有系数的列表?

我已经尝试过coeffs()all_coeffs()方法,但它们不适用于epsilon的负幂:

x, eps = sp.symbols('x E')
expr = eps * x**3 - x**2 + 2 + 3 * x * eps**(-2)
coeffs_list = sp.Poly(expr, eps).coeffs()

我想获取诸如[x^3, x^2 + 2, 3*x]的系数列表>

我有一个多项式:eps * x ^ 3-x ^ 2 + 2 + 3 * x * eps ^(-2)。如何获得包括负数在内的所有系数的列表?我尝试了coeffs()和all_coeffs()方法,但它们不适用于...

python sympy polynomials coefficients
2个回答
1
投票

乘以大功率的eps有助于获得系数。


0
投票

如果不确定eps的负幂是多少,可以将表达式的系数放在公分母上:

© www.soinside.com 2019 - 2024. All rights reserved.