Message Boards Message Boards

0
|
4405 Views
|
7 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Simplify symbolic matrix determinant?

Posted 2 years ago

I am trying to calculate the determinant of the following matrix: enter image description here

the determinant is obviously a linear expression in u, v and w. However, the term I get is enter image description here

which does not look linear in u,v,w. I tried to use the commands "Simplify", "Fullsimplify" to reduce numerator and denominator, but with no success. The term I get is much more complicated than the one that should be derived. Any suggestions are welcome. Thanks.

POSTED BY: Nir Nir
7 Replies
0        0   0   (4*z)/3 5 (4*z)/3 0   0   5 (4*z)/3 0   0  
w*a[2]   9   0   0       0 0       0   0   0 5/2     0   0  
v*a[3]   0   9   0       0 5/2     0   0   0 0       0   0  
u*z*a[4] 4*z 4*z 9*z     0 0       0   0   0 0       0   0  
w*a[5]   0   0   0       9 0       2*z 0   0 5/2     0   0  
v*a[6]   0   0   0       4 9       5   4*z 0 0       0   0  
0        5   0   (4*z)/3 0 (4*z)/3 9*z 0   0 (4*z)/3 0   5*z
u*a[8]   0   0   5/2     0 0       2*z 9*z 0 0       0   0  
v*a[9]   0   0   0       0 5/2     0   0   9 0       2*z 0  
w*a[10]  0   0   0       0 0       0   0   4 9       5   4*z
0        0   5   (4*z)/3 0 (4*z)/3 0   5*z 0 (4*z)/3 9*z 0  
u*a[12]  0   0   5/2     0 0       0   0   0 0       2*z 9*z

If you calculate the determinant and FullSimplify you get:

27/4 z^3 (-375 + 5654 z) (v (63125 + 12 z (-15875 + 9512 z)) a[3] + 
   u (-28125 + 4 (31625 - 53286 z) z) a[4] + 
   v (169025 - 198744 z) z a[6] + 
   v (-63125 - 381390 z + 49504 z^2) a[9] + 
   w ((63125 + 12 z (-15875 + 9512 z)) a[
        2] + (-63125 - 381390 z + 49504 z^2) a[
        5] + (169025 - 198744 z) z a[10]) + 
   u (50625 + 8 z (-26175 + 13468 z)) (a[8] + a[12]))

Substitute the a with your values and it is ok, linear in u,v,w.

Robert

POSTED BY: Robert Nowak

Hi Nir you could try to replace all the real coefficients of, u,v,w with symbolic constants

a[1]    0 0 0 0 0 0 0 0 0 0 0
w*a[2]  0 0 0 0 0 0 0 0 0 0 0
v*a[3]  0 0 0 0 0 0 0 0 0 0 0
z*a[4]  0 0 0 0 0 0 0 0 0 0 0
w*a[5]  0 0 0 0 0 0 0 0 0 0 0
v*a[6]  0 0 0 0 0 0 0 0 0 0 0
a[7]    0 0 0 0 0 0 0 0 0 0 0
u*a[8]  0 0 0 0 0 0 0 0 0 0 0
v*a[9]  0 0 0 0 0 0 0 0 0 0 0
w*a[10] 0 0 0 0 0 0 0 0 0 0 0
a[11]   0 0 0 0 0 0 0 0 0 0 0
u*a[12] 0 0 0 0 0 0 0 0 0 0 0

Robert

POSTED BY: Robert Nowak
Posted 2 years ago

Thank you Robert. The determinant is linear in the elements u,v and w since they appear only in the left column. When I used rational coefficients in the entries of the matrix it works great. When I use numbers like 3.6 it gives me very long expressions.

POSTED BY: Nir Nir

Hi Nir

Your expressions ei which are elements inside the Matrix are linear. The determinant on the other hand consists of products, etc. of different ei which are not linear.

Robert

POSTED BY: Robert Nowak
Posted 2 years ago

Unless you know that some or all of your terms have finite precision, you might first try replacing all 0. with 0 and see how much smaller the result is. That should eliminate things like 0.*z^7+0.*z^8, etc.

You might then try replacing all your decimal coefficients with exact rational values. That will sometimes result in much larger expressions while it eliminates some terms that are just floating point noise. Then trying Simplify[N[...]] or Expand[N[...]] on that result might collect together some terms and get rid of large rational coefficients and possibly try to expose a linear portion of your result.

POSTED BY: Bill Nelson
Posted 2 years ago

Thank you very much Bill. When I use for example 4.5 it gives me ugly expressions, but when I use 9/2 it works great. Quite strange...

POSTED BY: Nir Nir

Use Chop[] This sets all values <10.^-10 to 0 This way all things still remaining like the 0.z^7+0.z^8 will go away

In[1]:= a = 10.^-21
v = a*z^7 + 0.*z^8
Chop[v]

Out[1]= 1.*10^-21

Out[2]= 0. + 1.*10^-21 z^7

Out[3]= 0
POSTED BY: Martijn Froeling
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract