Equation involving Incomplete Gamma function

조회 수: 1 (최근 30일)
Sudhir Sahoo
Sudhir Sahoo 2021년 3월 31일
답변: Nipun 2024년 6월 6일
How to solve this equation using matlab
where and and here m, , are constant.
  댓글 수: 3
Sudhir Sahoo
Sudhir Sahoo 2021년 4월 1일
Hello thanks for your comment. @Star Strider However, here m is constant and only b and a are function of θ. hence θ is the only variable.
Star Strider
Star Strider 2021년 4월 1일
O.K. I missed seeing that m was constant. Code the expression and solve it in terms of only θ.

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

답변 (1개)

Nipun
Nipun 2024년 6월 6일
Hi Sudhir,
I understand that you want to solve the given equation in MATLAB comprising of trigonometric and incomplete gamma functions.
I recommend using the "symbolic Math Toolbox" in MATLAB to create the equation and using a MATLAB solver to solve for "theta". MATLAB supports incomplete gamma functions using an in-built function, called "gammainc".
Here are the steps you may take to slve the given equation:
  1. Create symbolic variables
  2. Code the equation
  3. Use solver to solve for "theta"
I am attaching a code snippet with this answer for your reference:
syms theta m tmin tmax
a = 2*sin(theta).^2
b = (cos(theta)-sin(theta)).^2/2
% Equation (split into two parts)
part1 = (4/(cot(theta)-1).^2)^((m+2)/(m+3))
arg1 = (m+1)/(2*m+6);
arg2 = b*tmin/2;
arg3 = a*tmin/2;
arg4 = b*tmax/2;
arg5 = a*tmax/2;
part2_numerator = gammainc(arg1, arg2) - gammainc(arg1, arg4);
part2_denominator = gammainc(arg1, arg3) - gammainc(arg1, arg5);
part2 = part2_numerator/part2_denominator;
% creating equation
eqn = part1*part2
% Solving
ans = solve(eqn, theta);
For more information on the in-built functions, refer to the following MathWorks documentation:
  1. Symbolic Toolbox: https://www.mathworks.com/help/symbolic/syms.html#d126e328782
  2. Incomplete Gamma Function: https://www.mathworks.com/help/matlab/ref/gammainc.html
  3. Equation Solver: https://www.mathworks.com/help/symbolic/sym.solve.html
Hope this helps.
Regards,
Nipun

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by