Borrar filtros
Borrar filtros

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 visualizaciones (últimos 30 días)

Respuestas (1)

Torsten
Torsten el 5 de Jun. de 2024
Editada: Torsten el 5 de Jun. de 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 comentarios
Muhd Jasrim
Muhd Jasrim el 6 de Jun. de 2024
Thank you. If the expression is -ve, the messages also appeared. May I know why?
Torsten
Torsten el 6 de Jun. de 2024
Editada: Torsten el 6 de Jun. de 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).

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by