I am trying to solve for a certain M that will satisfy 2 equations using the solve command. I know my final answer is supposed to be 1.2, and I have defined my equations. I am not sure if I am incorrectly using the solve command or have incorrectly defined the equations.
r = 1.4;
rm1 = r-1;
rp1 = r+1;
syms M
A_AS=sqrt((1/M^2)*(((2+rm1*M^2)/rp1)^(rp1/rm1)));
Po2_Po1=((rm1*.5*M^2)/(1+rm1*.5*M^2))^(r/rm1)*(1/(((2*r)/rp1)*M^2-(rm1/rp1)))^(1/rm1);
Ac_At = A_AS*Po2_Po1 == 1.2;
M = solve(Ac_At,M)
I would appreciate the help, thank you for your time

댓글 수: 2

MATLAB is finding one of the roots but not all of the roots.
For that those equations, are two real roots:
temp = roots([3630287, 15558480, -12224520, 3598560, -521640, 37584, -1080]);
temp(imag(temp)~=0) = [];
temp(temp<0) = [];
sol = sqrt(temp);
along with the negative of that. Approximately +/- 0.386916692037127
We do not know if your equations are right...
Jose Camorlinga Medina
Jose Camorlinga Medina 2018년 3월 15일
편집: Walter Roberson 2018년 3월 15일
Thank you for your help.

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

질문:

2018년 3월 15일

편집:

2018년 3월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by