Unknown variable complex equation
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
I know all of the values of the equation shown apart from M. How do I go about finding it?
Cp = -6521
gamma = 1.4

채택된 답변
Star Strider
2021년 4월 15일
I ahve no idea what ‘Cp’ does here.
Otherwise:
gamma = 1.4;
prat = @(Me,gamma) ((1+(gamma-1)/2.*Me.^2).^(gamma/(gamma-1))) ./ (2*gamma/(gamma+1).*Me.^2 - (gamma-1)/(gamma+1));
Me = fsolve(@(Me)prat(Me,gamma), 10);
produces:
Me =
1.4832
.
댓글 수: 10
Thank you. Pardon my ignorance, but what does the 10 stand for?
As always, my pleasure!
No worries! Every nonllinear optimisation function needs an initial estimate for every parameter it is to solve for. I randomly chose 10 here for that initial estimate.
Also the output is meant to be between 1 and 0. This does not change for different values of pressure ratio. Pressure ratio should be = -0.6521.
This pops up in the comand window - "
No solution found.
fsolve stopped because the problem appears regular as measured by the gradient,
but the vector of function values is not near zero as measured by the
value of the function tolerance."
I have no idea how ‘Cp’ enters into this, since that was not stated, it is not part of the expression, and the posted value is
times the intended value. I used the information originally provided.
With appropriate information, perhaps a solution is possible.
Essentially, I need to find the value of M.

I let the Symbolic Math Toolbox work with this:
syms Me
gamma = sym(1.4);
Cp = sym(-0.6521);
Eqn = Cp == ((1+(((gamma-1)/2).*Me.^2)).^(gamma/(gamma-1))) ./ ((2*gamma/(gamma+1)).*Me.^2 - (gamma-1)/(gamma+1)) ;
Me = solve(Eqn)
Me_vpa = vpa(Me)
abs_Me_vpa = abs(Me_vpa)
to get:
Me_vpa =
0.81165777828426109075260040547338i
1.1975001390442034303327301058217 + 0.99618983123429503559085894760276i
1.1975001390442034303327301058217 - 0.99618983123429503559085894760276i
1.6759020637684055112009161261056 + 2.6390184872797899437928880153373i
1.6759020637684055112009161261056 - 2.6390184872797899437928880153373i
-0.81165777828426109075260040547338i
- 1.1975001390442034303327301058217 - 0.99618983123429503559085894760276i
- 1.1975001390442034303327301058217 + 0.99618983123429503559085894760276i
- 1.6759020637684055112009161261056 - 2.6390184872797899437928880153373i
- 1.6759020637684055112009161261056 + 2.6390184872797899437928880153373i
abs_Me_vpa =
0.81165777828426109075260040547338
1.5576908431603171537631560287157
1.5576908431603171537631560287157
3.1261903818462034878433853976319
3.1261903818462034878433853976319
0.81165777828426109075260040547338
1.5576908431603171537631560287157
1.5576908431603171537631560287157
3.1261903818462034878433853976319
3.1261903818462034878433853976319
I checked the code, and it appears to do what the code in the image does.
The LaTeX version is:

that with the numeric substitutions is:
so it appears to be coded correctly.
Thanks a lot
As always, my pleasure!
Would oyu by any chance also know the answer to this question please ? ReadTable
It would appear that Walter Roberson got there first. I will add an Answer if Walter’s does not do what you want.
The problem with your original code to read that file is that it did not account for every column. Consider using this textscan call instead:
dataBuffer = textscan(finputCdCl, repmat('%f',1,7), 'CollectOutput', 1, ... %Read data from file
'Delimiter', '', 'HeaderLines', 12);
I did not test that with that file, however it would likely do what you want. If it does, and if the readtable approach does not work the way you want it to, I will add this as an Answer. Also, if you want to save the columns as separate cell arrays, set 'CollectOutput' to 0. Check to be certain that the 'Delimiter' is correct, since it could be '\t'.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
