A positive root of an equation
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Fares
el 12 de Dic. de 2022
Comentada: Fares
el 12 de En. de 2023
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!
0 comentarios
Respuesta aceptada
Torsten
el 12 de Dic. de 2022
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 comentarios
Torsten
el 12 de En. de 2023
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.
Más respuestas (1)
John D'Errico
el 12 de Dic. de 2022
Editada: John D'Errico
el 12 de Dic. de 2022
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
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.M
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.
Ver también
Categorías
Más información sobre Linear Algebra en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







