Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Is there any way to force Det to do itself in a certain way?

I've been running the same notebook on 2 differents computer, one MacOSX Lion and one W7 (both 32bit) with Mathematica 8.0.0.0 on the two of them, and we don't get the same Det expression and Solve[Det[F[x]]==0,x] doesn't give the same solutions either.

How to know which one says the truth? How could we calculate the Det in order the have the same solutions on both computers?
Note: as its the same nb the matrices (26*26) are exactly the same.

share|improve this question
8  
Please post the matrices. Are these symbolic matrices? Numerical ones? Do they have exact or inexact numbers? If inexact, machine precision or arbitrary precision? There are so many different variables that it'll be impossible to say anything unless you either post the matrix, or even better: post a small program to generate the matrix (the definition of F, I assume). –  Szabolcs Jun 4 '12 at 13:58
2  
I think you posted a now deleted Q with numerically unstable functions –  belisarius Jun 4 '12 at 14:12
    
Now its "better" -> more stable. They are completely inexact, calculated before with some long lines so all I can give is the complete nb (there is no way to generate the matrices in a few lines). Here is the nb: depositfiles.com/files/sq0miedz8 Note the last Outputs: the answer it gives me –  Öskå Jun 4 '12 at 14:49
add comment

1 Answer

up vote 2 down vote accepted

Are the relevant lines

PulsProp[\[Omega]_, N0_] = Simplify[Det[matK - (\[Omega]^2)*matM]]

and

test = Solve[PulsProp[\[Omega], 5000] == 0 && \[Omega] > 0, \[Omega]]?

If yes, you might get a much more stable behavior by noting that $\omega^2$ are in fact the generalized eigenvalues

\[Omega]2 = Eigenvalues[{matK, matM}]

where you can select the positive ones

test = (\[Omega] -> #) /@ Sqrt@Select[\[Omega]2, PositiveQ].

share|improve this answer
    
Simplify[Det[matK - (\[Omega]^2)*matM]] is the matter. The two lines you are talking about are relevant in order to calculate the roots of the det, which is supposed to give frequencies (omega/2Pi). Thus the matM is not "perfectly" diagonal, I don't remember my math courses very well then I can't judge if the eigenvalues gives the wanted solutions. What makes me doubt is that the Plot[Det[]==0,..] gives me Omega = 3,xxxx, which is not given by your solutions. Which one is good? –  Öskå Jun 4 '12 at 17:31
    
I think you got it right, I've tried with nmax=1 on the nb & it find the same result with Det==0 & with Eigenvalues[]. But I still don't get what does Eigenvalues[{matK,matM}] do (!), and then why can we tell that the Eigenvalues, calculated god knows how, give me the right solutions? Because matM is bi-diagonal? –  Öskå Jun 5 '12 at 8:33
1  
@Öskå: Eigenvalues[{A,B}] solves the problem $\det(A - \lambda B)=0$ for $\lambda$; however in a numerically stable version unlike writing down the polynomial equation for $\lambda$ and then solving it... –  Fabian Jun 5 '12 at 11:53
    
Thanks a lot, it solves everything! :) –  Öskå Jun 5 '12 at 13:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.