MATLAB Answers


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

Asked by Syed Qaseem Ali on 25 Nov 2015
Latest activity Edited by Walter Roberson
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:
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?


Sign in to comment.

1 Answer

Answer by Walter Roberson
on 25 Nov 2015
Edited by Walter Roberson
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?

  1 Comment

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

Sign in to comment.