是否可以定义方程并求解该方程中的变量?
D_PWM, Rsense, A = symbols('D_PWM, Rsense, A')
i_out = D_PWM * (A/Rsense)
print i_out
solve(i_out, Rsense)
结果:
A*D_PWM/Rsense
[]
答案 0 :(得分:9)
i_out 尚未声明为符号。
>>> from sympy import *
>>> var('D_PWM, Rsense, A i_out')
(D_PWM, Rsense, A, i_out)
>>> eqn=Eq(i_out,D_PWM * (A/Rsense))
>>> solve(eqn,Rsense)
[A*D_PWM/i_out]