如何用Python解决这个隐式方程?

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

任何人都可以通过python或Octave或Matlab提供此方程的解吗?

我们必须为不同的'c'值找到'x'的解。

enter image description here非常感谢您的帮助。谢谢

python matlab math octave
2个回答
1
投票

使用Solvers

# this is an example
>>> from sympy.solvers import solve
>>> from sympy import Symbol
>>> x = Symbol('x')
>>> solve(x ** 2 - 1, x)
[-1, 1]

0
投票

由于等式具有一些浮点常量,所以最好使用nsolve进行数值求解:

from sympy import Eq, log, exp, nsolve
from sympy.abc import x

c = 267
sol = nsolve(Eq(x ** 0.22 * (c * exp(-c * x ** 0.22) - 1), c * log(0.7657)), x, 1)
print(sol)  # 264587674.024352
© www.soinside.com 2019 - 2024. All rights reserved.