我下面有这段代码,想在矩阵变换后计算I = Ia + Ib + Ic并将其替换为Id,Iq或Io。
从变换中我可以清楚地看到Ia + Ib + Ic = sqrt(3)* Io,但是程序返回了I = 49413911907318.0 * sqrt(2)* Io
有人可以让我知道为什么吗?
import sympy
from sympy import *
theta_c, Iq, Id, Io, Vq, Vd, Vo, Va, Vb, Vc, Ia, Ib, Ic = symbols('theta_c Iq Id Io Vq Vd Vo Va Vb Vc Ia Ib Ic')
Tabc_inv = sqrt(2/3)*Matrix([[cos(theta_c), -sin(theta_c), 1/sqrt(2)],[cos(theta_c-2*pi/3), -sin(theta_c-2*pi/3), 1/sqrt(2)],[cos(theta_c+2*pi/3), -sin(theta_c+2*pi/3), 1/sqrt(2)]])
Iabc = Tabc_inv*Matrix([Id,Iq,Io])
Ia = Iabc[0]
Ib = Iabc[1]
Ic = Iabc[2]
I_expanded = Ia + Ib + Ic
I = simplify(I_expanded)
print('\n I =',I)