Effacer les filtres
Effacer les filtres

Hi, i try to solve equation c in terms of other variables, and its appear the messages and the answers is not as expected. Is supposed to be beta/p^(1/sigma)? is it?

3 vues (au cours des 30 derniers jours)

Réponses (1)

Torsten
Torsten le 5 Juin 2024
Modifié(e) : Torsten le 5 Juin 2024
Maybe you want to restrict the parameters to be positive (and thus real-valued):
syms beta c sigma p positive
eqn1 = beta/c^sigma - p == 0
eqn1 = 
sc1 = solve(eqn1,c)
sc1 = 
eqn2 = (beta/c)^sigma - p == 0
eqn2 = 
sc2 = solve(eqn2,c)
sc2 = 
  2 commentaires
Muhd Jasrim
Muhd Jasrim le 6 Juin 2024
Thank you. If the expression is -ve, the messages also appeared. May I know why?
Torsten
Torsten le 6 Juin 2024
Modifié(e) : Torsten le 6 Juin 2024
I can't tell you in this special case.
The "problem" is that the equation
z^n = 1
does not only have real, but also complex solutions.
E.g.
syms z
eqn = z^6 == 1;
solve(eqn)
ans = 
That's what the solver tries to tells you. So if you only want the real solutions, you must somehow exclude them in advance (which I tried by the positivity assumption) or sort them out from the obtained solution afterwards (e.g. by setting l = 0 in the expression you did obtain).

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by