Roots of a fractional polynomial with solve()
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Alain
am 12 Jan. 2014
Kommentiert: Walter Roberson
am 2 Nov. 2019
Hello everybody,
I'm looking for another method to solve this problem:
I have to find roots of a fractional polynomial:
syms mu real;
sum(lambda./(lambda-mu));
mu=double(solve(sum(lambda./(lambda-mu))/M-1/c==0,mu,'Real', true));
I used the function solve to find its roots. It's good but so slow! My polynom has a degree of 100 and i have to repeat this code in several random experiences.
Does anyone of you know a faster function which could do the same thing? I can't use fzeros().
Thanks for your help!
4 Kommentare
Walter Roberson
am 2 Nov. 2019
GOPAL SINGH as this question is 5 years old now, it would help if you were to explain more what you would like to have some examples of ?
Akzeptierte Antwort
Walter Roberson
am 15 Jan. 2014
I assume here that lambda is a vector of real values, and that M and c are scalars? If so then the expression can be rewritten without any fractional powers into a polynomial of degree length(lambda). The coefficients of the polynomial are of predictable form, with the N'th highest term involving all the combinations of elements in lambda taken (N-1) at a time, multiplied by (M/c - (N-1)).
I do not know if there are any special techniques for finding the roots of such a polynomial, but roots() can return all of the roots in numeric form.
3 Kommentare
Bjorn Gustavsson
am 3 Feb. 2014
I guess that the errors are because of the high order of the polynomial you send to roots. In that case you might be able to procced by rolling your own specialised vectorised Newton (for example) solver (since you have a polynomial) and use the results you get out of root as a start guess vector. If you're "lucky" all the roots will be found within a few iterations, if not you'd might have to repeat for the ones where convergence is not found.
Weitere Antworten (1)
Mischa Kim
am 12 Jan. 2014
Bearbeitet: Mischa Kim
am 12 Jan. 2014
Are you required to find all roots (<= 100!)?
At any rate, I'd recommend plotting the function to get a first impression on where some of the roots are located at and to be able to get starting values for the search(es). I am positive that you can use fzero to find some (if not all of the) roots, possibly in combination with a loop.
10 Kommentare
Bjorn Gustavsson
am 15 Jan. 2014
Why give up when finding consecutive extremas lower (or larger) than 0, you still know that the root has to be between two extremas with varying sign, right? It might be unnecessarily time-consuming to find all when you can only utilize some, but it would still have some information you could use...
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!