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!