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

### Syed Qaseem Ali (view profile)

on 25 Nov 2015
Latest activity Edited by Walter Roberson

### Walter Roberson (view profile)

on 26 Nov 2015
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:
`&theta;_r`:=a:`&alpha;`:=b:`&omega;_r`:=0:
L_th1:=matrix([[L_0_1_1-L_d_1_1*cos(2*`&theta;_r`-2*`&alpha;`),-0.5*L_0_1_1-L_d_1_1*cos(2*`&theta;_r`-2*PI/3-2*`&alpha;`),-0.5*L_0_1_1-L_d_1_1*cos(2*`&theta;_r`+2*PI/3-2*`&alpha;`)],[-0.5*L_0_1_1-L_d_1_1*cos(2*`&theta;_r`-2*PI/3-2*`&alpha;`),L_0_1_1-L_d_1_1*cos(2*`&theta;_r`+2*PI/3-2*`&alpha;`),-0.5*L_0_1_1-L_d_1_1*cos(2*`&theta;_r`-2*`&alpha;`)],[-0.5*L_0_1_1-L_d_1_1*cos(2*`&theta;_r`+2*PI/3-2*`&alpha;`),-0.5*L_0_1_1-L_d_1_1*cos(2*`&theta;_r`-2*`&alpha;`),L_0_1_1-L_d_1_1*cos(2*`&theta;_r`-2*PI/3-2*`&alpha;`)]]):
T_1:=1:T_3:=1:T_2:=Simplify(T_1*((-cos(2*`&omega;_g`*t)+1)/sin(2*`&omega;_g`*t))^-1):T_4:=Simplify(T_3*((cos(2*`&omega;_g`*t)-1)/sin(2*`&omega;_g`*t))):
T_new1:=matrix([[T_1,T_2,0],[T_3,T_4,0],[0,0,1]]):
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?

### Walter Roberson (view profile)

on 25 Nov 2015
Edited by Walter Roberson

### Walter Roberson (view profile)

on 26 Nov 2015

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?

Syed Qaseem Ali

### Syed Qaseem Ali (view profile)

on 26 Nov 2015
I used the following command
Simplify(expression, Valuation=length)
This suppresses the floating numbers from the output. I will try using fractions too.