Skip to main content
21 events
when toggle format what by license comment
Jul 1, 2012 at 0:01 history edited Jens CC BY-SA 3.0
Added reference
Jun 28, 2012 at 18:50 comment added tau1777 @Jens, Thanks so much for catching my error. So now I have tried g[x_?NumericQ] := Last[SingularValueList[mat /. \[Kappa] -> x]], and then FindRoot[g[x], {x, .6}] and this results in {x -> 0.580403}. Which was a result from det(A($\kappa$))=0. So I think all is well. Now to try bigger grid-sizes and see what happens. Thanks everyone, and special thanks to Jens.
Jun 28, 2012 at 17:57 history edited Jens CC BY-SA 3.0
Added explanation how to do replacement; added 1 characters in body; edited body
Jun 28, 2012 at 17:47 comment added Jens @AshikIdrisy Oh, I see another problem - I got sidetracked, but now I notice that you put the matrix into the function the wrong way. I'll add that to the answer... Try g[\[Kappa]_?NumericQ] := mat and you'll see that the parameter isn't substituted correctly!
Jun 28, 2012 at 17:39 comment added tau1777 @J.M. Hello, Thanks so much for your input. I've tried using g[\[Kappa]_?NumericQ] := Last[SingularValueList[mat]] and then plotting the results it looks mostly the same.Then I'm using FindRoot[g[x], {x, .5}]. No errors this time its's still running after one whole Colbert Repor, and used up about 1.5 is GB of RAM, so yeah.
Jun 28, 2012 at 15:51 history edited J. M.'s missing motivation CC BY-SA 3.0
deleted 1 characters in body
Jun 28, 2012 at 15:33 comment added Jens @AshikIdrisy Re: your question what the advantage over determinants is: that indeed depends on the structure of the matrix. For a banded matrix the determinant may be fast enough to calculate. But in general for a dense matrix it isn't.
Jun 28, 2012 at 15:29 comment added Jens @J.M. Yes, I had already changed that - or so I thought. I was in a hurry and forgot to change it in the last example...
Jun 28, 2012 at 15:25 history edited Jens CC BY-SA 3.0
Several typos removed. Simplified to SingularValueList; deleted 43 characters in body; deleted 1 characters in body
Jun 28, 2012 at 15:06 comment added J. M.'s missing motivation Also, if you use SingularValueList[], the singular values are already nicely sorted in non-increasing order, so you can use Last[] instead of Min[]. One might want to mind the Tolerance option if needed...
Jun 28, 2012 at 15:02 comment added Jens @J.M. Ah yes. I did the whole thing from memory... I should change the code to avoid having to explain so much. I think I may have been thinking back to the old LAPACK routines I used a lot...
Jun 28, 2012 at 14:43 comment added J. M.'s missing motivation You guys realize that SingularValueList[] is available if only the singular values are needed, right? No need for that Diagonal[SingularValueDecomposition[(* matrix *))][[2]]] construction if you've no use for the accompanying unitary matrices...
Jun 28, 2012 at 6:49 comment added tau1777 Sorry about all of these comments. I just wanted to clarify the last one. I really want to be able to find a way to take $\kappa$ out of the matrix,and then evaluate the determinant, b/c I figure that shouldn't take any time at all. But of course $\kappa$ is the most important piece, so not sure how I can go about this. Also any ideas about that RowReduce issue I'm having.
Jun 28, 2012 at 6:46 comment added tau1777 I forgot to ask one important thing, and that is about the SVD. It seems to be that SVD returns something symbolic, and then only by creating a function that accepts numerically inputs are we making that numeric "merit function" you mentioned. Am I getting that right? The way I see it is that by plotting[f[x]]from 0 to 2, we are letting f[x] take numbers from 0 to 2 as numeric input and then it creates the plot you showed. I guess the crux of my question is that if SVD is symbolic then what is the real gain in using this than just doing Det[matrix]?
Jun 28, 2012 at 5:37 comment added tau1777 Thank you very much Jens, I did not expect this much detail, you are wonderful. I need sometime to figure out why the Min or Last command needs to be called. And I also need to figure out why this technique seems to be failing in my real problem (details in my 2nd edit) , but I do very much appreciate the help.
Jun 28, 2012 at 5:05 comment added Jens I've tried to add some more discussion - hope this helps with your actual matrix...
Jun 28, 2012 at 5:04 history edited Jens CC BY-SA 3.0
Added explanations and further example
Jun 28, 2012 at 3:35 comment added tau1777 OK, so I actually understand [Diagonal[ SingularValueDecomposition[ m + DiagonalMatrix[{κ, 0, 0}]][[2]]]] that part of your code. You are creating a matrix with ($\kappa$ + number) at the (1,1) entry, and then preforming a SVD on that matrix. The [[2]]] allows you to call the second part of the SVD output, and Diagonal asks for the diagonal elements of the matrix that has all of the singular values. But I am still confused about f[κ_?NumericQ] := Min[. What does calling Min do? Also, I've never seen a function defined like this f[κ_?NumericQ] :=. Thanks again.
Jun 28, 2012 at 3:06 comment added tau1777 Hi Jens, Thank you so much for the your response. I will definitely have to take a look at into the singular value decomposition idea. I think I follow most of what you did, but I'm not sure if I can apply this to my matrix. I should have done this earlier, but I created a fake matrix (I added it under my original post), which I believe gives a clearer idea of what I am dealing with. I'm not really sure I could use this SVDecomp trick with that matrix. Sorry to be a bother but could you please provide further instruction. You've hit upon the main issue, getting around doing it symbolically.
Jun 28, 2012 at 2:08 history edited Jens CC BY-SA 3.0
Added: make function numerical; deleted 171 characters in body
Jun 28, 2012 at 1:56 history answered Jens CC BY-SA 3.0