# how to solve an equation by using trial and error method?

조회 수: 28 (최근 30일)
Ali Deniz . 2022년 5월 16일
댓글: Ali Deniz . 2022년 5월 16일 𝑇ℎ𝑟𝑜𝑎𝑡 (𝐴∗)=647.5 𝑚𝑚2
A=1027.5 mm^2
How can I calculate 𝑀𝑥 value by using trial and error method or how can I find the value of Mx by another method. Thank you.

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

### 채택된 답변

Sam Chak 2022년 5월 16일
I'm not sure what the trial-and-error method is for this, but I think that basic Algebraic methods can be used to rearrange the equation. I followed the example in fzero and make an assumption:
% Assume
gamma = 1.55526564459735;
% function to be solved
f = @(M) (1/M)*((2*(1 + (gamma - 1)/2*M^2))/(gamma + 1))^((gamma + 1)/(2*(gamma - 1))) - Ax/Astar;
% initial guess
M0 = 3;
% root-finding solver
Msol = fzero(f, M0)
There should be two real roots. ##### 댓글 수: 1표시 없음숨기기 없음
Ali Deniz 2022년 5월 16일
Thank you.
-Ali

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

### 추가 답변 (1개)

Walter Roberson 2022년 5월 16일
Multiply both sides by Mx. Subtract the left side from the right. Expand out. You now have a polynomial of degree 2 in Mx.
##### 댓글 수: 2표시 이전 댓글 수: 1숨기기 이전 댓글 수: 1
Walter Roberson 2022년 5월 16일
Ah, I am on mobile. I had tried scrolling the image but it didn't scroll so I didn't see the power.

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

### 카테고리

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

### Community Treasure Hunt

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

Start Hunting!