A positive root of an equation

13 ビュー (過去 30 日間)
Fares
Fares 2022 年 12 月 12 日
コメント済み: Fares 2023 年 1 月 12 日
Hello dear,
I have a mathemtaical model and one of the dependant variable, M, is a positive root of a nonlinear equation. I am not interested in finding this M but I would like to tell MATLAB that M is a positive root of the equation r(M)(a+P(M))(K-d)-bKM=0. How to do that?
Thank you!

採用された回答

Torsten
Torsten 2022 年 12 月 12 日
Without further knowledge about the background of your question:
Maybe by setting (r(M)(a+P(M))(K-d))/(bK) instead of M in your model.
  22 件のコメント
Torsten
Torsten 2023 年 1 月 12 日
I changed the code above so that it now gives correct results.
I didn't notice that "coeffs" gives the vector of polynomial coefficients in the reverse order as "roots" expects them. Therefore the "fliplr" command had to be added.
Sorry for that.
Fares
Fares 2023 年 1 月 12 日
Thanks Torsten for your replay.
No need to be sorry. Many thanks for your continuous support!

サインインしてコメントする。

その他の回答 (1 件)

John D'Errico
John D'Errico 2022 年 12 月 12 日
編集済み: John D'Errico 2022 年 12 月 12 日
syms M r0 epsilon rho k1 K b m alpha omega mu k2 eta sigma
P = (r0*(1+k1*(mu+(rho*M)/(1+M))*(1-k2*(mu+(rho*M)/(1+M)))))*(eta+(epsilon*M)/(1+M))*(K-alpha*sigma*m*(eta+(epsilon*M)/(1+M))*(1+(mu+(rho*M)/(1+M)))-b*(m+alpha)*(pi*M-omega))-b^2*alpha*K*(pi*M-omega) == 0
P = 
If you multiply by (M+1)^2, then regardless if I assume that m is not just a typo where you intended to write M in one place, this would appear to be effectively a 6th degree polynomial in M as long as M~=1.
If all of those parameters have known values, then you can just use vpasolve to return the 6 roots. If you want to find a solution in terms of symbolc parameters all as unknowns, then you are wasting your time. Abel-Ruffini (long before any of us was born) showed that general polynomials of degree higher than 4 will have no solutions in algebraic form. (Except for certain trivial cases.)
Of course, if you wish, you always can try this:
Msol = solve(P,M,'maxdegree',6,'returnconditions',true)
Msol = struct with fields:
M: [6×1 sym] parameters: [1×0 sym] conditions: [6×1 sym]
Msol.M
ans = 
Which is MATLAB's way of telling you that as much as it wants to solve the problem, it cannot resolve the issue of mathematical impossibility.
  1 件のコメント
Fares
Fares 2022 年 12 月 12 日
Thanks John for your help!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by