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 次查看(过去 30 天)

回答(1 个)

Torsten
Torsten 2024-6-5
编辑:Torsten 2024-6-5
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 个评论
Torsten
Torsten 2024-6-6
编辑:Torsten 2024-6-6
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).

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by