Roots of a fractional polynomial with solve()
조회 수: 11 (최근 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!