Roots of a fractional polynomial with solve()
12 次查看(过去 30 天)
显示 更早的评论
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 个评论
Walter Roberson
2019-11-2
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 ?
采纳的回答
Walter Roberson
2014-1-15
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 个评论
Bjorn Gustavsson
2014-2-3
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.
更多回答(1 个)
Mischa Kim
2014-1-12
编辑:Mischa Kim
2014-1-12
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 个评论
Bjorn Gustavsson
2014-1-15
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...
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polynomials 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!