필터 지우기
필터 지우기

Problem when using "solve" command

조회 수: 1 (최근 30일)
letoppina
letoppina 2018년 7월 17일
댓글: Stephan 2018년 7월 17일
Hi,
I have a problem using the command "solve", I want to solve a 3rd order equation as shown below:
syms V R gamma r Qi
eqn = (1+R*0.5*(1-gamma))*V^3 - R*V^2 - R*0.25*gamma*r*V + R*r^(2/3)*gamma*1/(8*Qi) == 0;
V_solve = solve(eqn,V)
when I run the code, everything gets stuck and I have to close Matlab and re-open it. What is the problem??

답변 (1개)

Stephan
Stephan 2018년 7월 17일
편집: Stephan 2018년 7월 17일
Hi,
in your code there is a closing parenthesis missing at the end of the equation - use this:
syms V R gamma r Qi
eqn = (1+R*0.5*(1-gamma)*V^3 - R*V^2 - R*0.25*gamma*r*V + R*r^(2/3)*gamma*1/(8*Qi) == 0);
V_solve = solve(eqn,V)
But this mistake usually will not lead to this kind of problem. Do you use R2017b or R2018a? Then i recommend to update your matlab since there are known problems by using syms in these releases, which are fixed in the updates..
You find it here:
HOME-TAB / Add-Ons (little arrow) / Check for Updates / Products
If you updated your release and fix the syntax error it should be done.
Best regards
Stephan
  댓글 수: 4
letoppina
letoppina 2018년 7월 17일
thank you very much! I have a question: why are the roots in function of "z"? Is it possible to get a solution with the parameters involved only (for example like the expression below)?
-(b + (b^2 - 4*a*c)^(1/2))/(2*a)
Stephan
Stephan 2018년 7월 17일
Sorry - in this question i can not help. It seems that symbolic toolbox did a z-transform to solve the problem. But i have really no idea how to deal with this - i think this is worth a new question.
Best regards
Stephan

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by