Roots of a fractional polynomial with solve()
이전 댓글 표시
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
Mischa Kim
2014년 1월 12일
Just curious, why can't you use fzero ? Are you required to code it yourself?
GOPAL SINGH
2019년 11월 1일
plzz provide with some examples?
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 ?
채택된 답변
추가 답변 (1개)
Mischa Kim
2014년 1월 12일
편집: Mischa Kim
2014년 1월 12일
0 개 추천
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
Alain
2014년 1월 12일
Mischa Kim
2014년 1월 12일
Now I understand. This bit of info just raised the level of complexity of the problem by an order of magnitude. Although MATLAB definitely is the tool to go with it is really the particular algorithm you are looking for to solve this class of problems. Let me see what I can dig up. Definitely one of the most interesting questions I have come across in this forum.
Alain
2014년 1월 14일
Mischa Kim
2014년 1월 14일
I might have some sort of a strategy, provided that the polynomials are somewhat well-behaved:
- Find all extrema of the polynomial using, e.g., the method/function presented here. Check out the third figure from the top. With this info you should be able to get good starting values for the searches.
- Solving for the roots of N experiments to me looks like a perfect problem for parallelization. Use the Parallel Computing Toolbox or, even better, the MDCS to speed up your algorithm.
What do you think?
Alain
2014년 1월 14일
Mischa Kim
2014년 1월 14일
편집: Mischa Kim
2014년 1월 14일
- Yep. Once you have all the extrema, you have pretty good starting values for all the roots. E.g., mid points between extrema. Then simply loop through all the starting values to get the roots with fzero.
- You might have the toolbox on your institution's license. If not you might qualify for a trial.
Let us know how this all panned out.
Mischa Kim
2014년 1월 15일
편집: Mischa Kim
2014년 1월 15일
I see. That's what I meant with well behaved. But I would not give up at this point.
- Could you attach code, or maybe better, a plot of a typical polynomial?
- Do the root locations change "much" when changing parameters?
Alain
2014년 1월 15일
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...
카테고리
도움말 센터 및 File Exchange에서 Polynomials에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!