您好,我想确定方程的系数A
和B
。
我发现了这个问题:Equating symbolic coefficients
并尝试使其相似,我编写了以下脚本:
pkg load symbolic
d = 0.33
J = 0.1
c_r = 0.2
L = 2
R = 4.5
k_e = 0.1
k_m = 1
syms s k_i k_p A B
G_r = k_p*(s+((k_i/k_p)/s))
G_e = (1/L)/(s+R/L)
G_m = (k_m/J)/(s+c_r/J)
G_em = (G_e*k_m*G_m)/(1+k_e*G_e*k_m*G_m);
G = (G_r*G_em)/(1+G_r*G_em)
%D = (w^2)/(s^2+s*2*d*w+w^2)
D = (B)/(s^2+s*A+B)
scoeffs = coeffs(G-D, s);
[A, B] = solve(scoeffs)
但是我收到以下错误消息:
error: Python exception: PolynomialError: 1/(A*s + B + s**2) contains an element of the generators set
如何获取系数A
和B
?