How to solve rachford - race function using newton method
1 回表示 (過去 30 日間)
古いコメントを表示
採用された回答
Torsten
2024 年 11 月 25 日
編集済み: Torsten
2024 年 11 月 25 日
Multiply the equation by product_{i=1}^{n_c} (1+f_Rg*(K_i-1)). This gives you a polynomial of degree n_c-1 in f_Rg which can be solved using the "roots" function.
Or if you are lazy, just use:
K = [3 5 -7 9 -10 2];
c = [0.4 0.6 1.2 -0.7 1.1 0.8];
syms f_Rg
fun = sum(c.*(K-1)./(1+f_Rg*(K-1)));
f_Rg_num = double(solve(fun==0,f_Rg))
But don't use Newton's method in this case because the equation has nc-1 solutions, and it were pure luck if Newton's method converged to the "correct" one.
3 件のコメント
Torsten
2024 年 11 月 26 日
編集済み: Torsten
2024 年 11 月 26 日
Your equation rewritten is a polynomial of degree n_c-1 in the variable f_Rg. A polynomial can have real and complex roots. A value for the "i" component in the solution for f_Rg_num that is different from 0 indicates complex roots. You will have to sort out the "correct" solution for your case from the n_c-1 solutions returned.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!