我正在尝试使用 sympy 来求解多项式方程,其系数具有不确定性。因此,对于不确定性,我正在尝试使用不确定性模块。有没有办法做到以下几点:
x=ufloat(10,0.2) #the xs are coefficients
x1=ufloat(8,0.01)
x3=ufloat(25,2)
L=Symbol("L")
eqn=(x*(L**2))+(x1*(L*1))+(x3*(L**0))
solve(eqn,L) #ideally this should give the value of L with it's propagated uncertainty
没有它抛出错误:
TypeError: unsupported operand type(s) for *: 'Variable' and 'Pow'