how can i write attached equation in MATLAB code

조회 수: 11 (최근 30일)
NAVEED ULLAH
NAVEED ULLAH 2021년 11월 17일
편집: Walter Roberson 2021년 11월 21일

채택된 답변

Walter Roberson
Walter Roberson 2021년 11월 17일
syms Delta_P_lo Delta_x phi_lo Delta_P_f x LB UB
Delta_P_f = Delta_P_lo * (1/Delta_x .* int(phi_lo.^2, x, LB, UB, 'hold', true))
Delta_P_f = 
The 'hold', true is there to prevent int() from immediately doing the integral. is independent of x so int() would treat it as being constant in x and would immediate do the integration, leaving you with something that did not include the integration sign.
If is dependent on x then the code would need to be changed a little to reflect that.
I had to introduce LB and UB as the bounds of integration because it happens that the 'hold' feature would be misinterpreted as being bounds if you were to try to do indefinite integration while 'hold' is on.
  댓글 수: 3
Walter Roberson
Walter Roberson 2021년 11월 21일
편집: Walter Roberson 2021년 11월 21일
syms d g mu_1 mu_v rho_1 rho_v sigma chi
GAMMA = (rho_1/rho_v)^sym(1/2) / (mu_v / mu_1)^sym(1/8)
GAMMA = 
N_conf = 1/d * (sigma/ (g*(rho_1 - rho_v)))^sym(1/2)
N_conf = 
phi_lo__2 = 1 + (sym(4.3) * GAMMA^2 - 1) * (N_conf * chi^sym(7/8) * (1-chi)^sym(7/8) + chi^sym(1/8))
phi_lo__2 = 
syms Delta_chi Delta_P_f e_lo G L R
f_lo = (sym(0.79) * R * e_lo - sym(1.64))^(-2)
f_lo = 
Delta_P_lo = 2*f_lo * G^2 * L / (rho_1 * d)
Delta_P_lo = 
syms LB UB
Delta_P_f = Delta_P_lo * (1/Delta_chi .* int(phi_lo__2, chi, LB, UB, 'hold', true))
Delta_P_f = 
dPf = simplify(release(Delta_P_f))
dPf = 
Note that the Γ that shows up in the result is not the same as the Γ that you define at the bottom left of the equations. The one in the results is the Gamma function -- the extension of factorials.
NAVEED ULLAH
NAVEED ULLAH 2021년 11월 21일
thank you very much.

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

추가 답변 (0개)

카테고리

Help CenterFile 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!

Translated by