Roots of a fractional polynomial with solve()

7 views (last 30 days)
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 Comments
Walter Roberson
Walter Roberson on 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 ?

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 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 Comments
Alain
Alain on 1 Feb 2014
Hello, I'm sorry to come again on this question, but I've just realised that my problem was actually unsolved!! :(
It's been weeks since the next steps of my code are a failure and I have understood that it was because the function roots() combined with the residue() function gave me roots with a lot of erros comparing to solve() function used alone...
I'm still tring to figure out a way to simplify or extract the numeratof of my frational polynomial without loosing precision. I used numden() which is really slow and now I don't know what else to try.
Does anyone have any ideas please?
Bjorn Gustavsson
Bjorn Gustavsson on 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.

Sign in to comment.

More Answers (1)

Mischa Kim
Mischa Kim on 12 Jan 2014
Edited: Mischa Kim on 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 Comments
Alain
Alain on 15 Jan 2014
No no I won't give up! :)
  • You will have to zoom a lot to see what happens near zero.
  • I don't feel like it's changing a lot. I attach also my roots values. Each line corresponds to one experience.
  • Maybe I shoud more focus on a mathematical algorithm to find roots of fractional polynomial, rather than searching for Matlab functions firstly.
Thanks again for your help, I hope you are not wasting too much of your time for my problem! :)
Bjorn Gustavsson
Bjorn Gustavsson on 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...

Sign in to comment.

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!