Re: Problems with NSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg88181] Re: Problems with NSolve
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sun, 27 Apr 2008 04:59:46 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <fuumfl$8dr$1@smc.vnet.net>
kgwagh at gmail.com wrote: > Hi all > > I am trying to find the number of eigenvalue crossings for a matrix as > a function of the parameter 'u', on which the elements of the > (symmetric) matrix depend on linearly. The matrix elements also > involve randomly chosen constants. The plan is to find the > distribution of the crossings of these type of matrices as I scan over > the random numbers. > > So far I have been using the following : > > NSolve[{chpoly[u, dim, \[Alpha], \[Gamma], \[Epsilon], x] == 0, > D[chpoly[u, dim, \[Alpha], \[Gamma], \[Epsilon], x], x] == 0}, {x, > u}, WorkingPrecision -> prec] > > where chpoly is the characteristic polynomial of the matrix (with the > eigenvalue variable being x) and \alpha, \gamma and \epsilon are > constant parameter arrays of random numbers. For a double (or higher) > degeneracy of the eigenvalues both the characteristic equation and its > derivative should be zero. This approach has worked successfully only > upto 12*12 matrices (where one such computation takes 40 secs on my > laptop). For 13*13 my laptop takes 4000 sec. This seems to be somewhat > surprising, because these polynomials are of the order 'n' (where n > is dimension of the matrix) in both u and x - and n=13 does not sound > very computationally unreasonable. So I was wondering if there was a > faster approach I could take. > > Also, the problem essentially entails me to know the number (not the > values) of the real solutions to this system of polynomials. > CountRoots seemed ideal but it does not work for more than one > equation. So is there any alternative along this route? > > Any other alternatives are also welcome. > Thanks, > Kshitij. > Could you post, please, a *fully working* example of what you are doing? It is really hard to optimize fuzzy functions (fuzzy not as in fuzzy logic but as in fuzzy definitions or concepts :-) Regards, -- Jean-Marc