필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Mupad produces expressions with very small and neglectable factors, how can I remove them from the output.

조회 수: 1 (최근 30일)
Hi, I am trying to perform a decoupling operation on a certain 3x3 matrix. The answer I get after decoupling has a lot of terms in it and it seems that the matrix is not diagonalized, but after close inspection, most of the terms have very small factors rendering them negligible. Once neglected the matrix seems diagonalized.
Here is the operation I am trying to perform:
`θ_r`:=a:`α`:=b:`ω_r`:=0:
L_th1:=matrix([[L_0_1_1-L_d_1_1*cos(2*`θ_r`-2*`α`),-0.5*L_0_1_1-L_d_1_1*cos(2*`θ_r`-2*PI/3-2*`α`),-0.5*L_0_1_1-L_d_1_1*cos(2*`θ_r`+2*PI/3-2*`α`)],[-0.5*L_0_1_1-L_d_1_1*cos(2*`θ_r`-2*PI/3-2*`α`),L_0_1_1-L_d_1_1*cos(2*`θ_r`+2*PI/3-2*`α`),-0.5*L_0_1_1-L_d_1_1*cos(2*`θ_r`-2*`α`)],[-0.5*L_0_1_1-L_d_1_1*cos(2*`θ_r`+2*PI/3-2*`α`),-0.5*L_0_1_1-L_d_1_1*cos(2*`θ_r`-2*`α`),L_0_1_1-L_d_1_1*cos(2*`θ_r`-2*PI/3-2*`α`)]]):
T_ADr1:=sqrt(2/3)*matrix([[cos(`ω_r`*t+`θ_r`-`α`),cos(`ω_r`*t+`θ_r`-2*PI/3-`α`),cos(`ω_r`*t+`θ_r`+2*PI/3-`α`)],[-sin(`ω_r`*t+`θ_r`-`α`),-sin(`ω_r`*t+`θ_r`-2*PI/3-`α`),-sin(`ω_r`*t+`θ_r`+2*PI/3-`α`)],[1/sqrt(2),1/sqrt(2),1/sqrt(2)]]):
T_ADg1:=matrix([[cos(`ω_g`*t),sin(`ω_g`*t),0],[-sin(`ω_g`*t),cos(`ω_g`*t),0],[0,0,1]]):
T_1:=1:T_3:=1:T_2:=Simplify(T_1*((-cos(2*`ω_g`*t)+1)/sin(2*`ω_g`*t))^-1):T_4:=Simplify(T_3*((cos(2*`ω_g`*t)-1)/sin(2*`ω_g`*t))):
T_new1:=matrix([[T_1,T_2,0],[T_3,T_4,0],[0,0,1]]):
T_c_new1:=Simplify(T_new1*T_ADg1*T_ADr1):
Simplify(T_c_new1*L_th1*T_c_new1^-1);
And the output I get is this:
matrix([[1.5*L_0_1_1 + 1.5*L_d_1_1 + 2.602085214*10^(-18)*L_d_1_1*cos(4*a) + 2.602085214*10^(-18)*L_d_1_1*cos(4*b) + 1.734723476*10^(-18)*L_d_1_1*cos(2*a - 2*b) - 1.301042607*10^(-18)*L_d_1_1*cos(2*a - 4*b) - 2.168404345*10^(-18)*L_d_1_1*cos(2*a + 4*b) - 1.301042607*10^(-18)*L_d_1_1*cos(4*a - 2*b) - 2.168404345*10^(-18)*L_d_1_1*cos(4*a + 2*b) + 1.517883041*10^(-18)*L_d_1_1*cos(4*a - 4*b), 0, 0], [0, 1.5*L_0_1_1 - 1.5*L_d_1_1 - 8.67361738*10^(-19)*L_d_1_1*cos(4*a) - 8.67361738*10^(-19)*L_d_1_1*cos(4*b) + 4.33680869*10^(-19)*L_d_1_1*cos(2*a - 4*b) - 4.33680869*10^(-19)*L_d_1_1*cos(2*a + 4*b) + 4.33680869*10^(-19)*L_d_1_1*cos(4*a - 2*b) - 4.33680869*10^(-19)*L_d_1_1*cos(4*a + 2*b) - 1.734723476*10^(-18)*L_d_1_1*cos(4*a - 4*b), 0], [0, 0, 0]])
Is there a way to suppress the terms with factors raised to -19 and -18 from the output?

답변 (1개)

Walter Roberson
Walter Roberson 2015년 11월 25일
편집: Walter Roberson 2015년 11월 26일
Switch from using 0.5 to using 1/2 . You are mixing symbolic and floating point arithmetic
Are your multiplications intended to be element-by-element or algebraic matrix multiplication?
Is your T_c_new1^-1 intended to indicate matrix inversion?
  댓글 수: 1
Syed Qaseem Ali
Syed Qaseem Ali 2015년 11월 26일
I used the following command
Simplify(expression, Valuation=length)
This suppresses the floating numbers from the output. I will try using fractions too.

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by