Plotting a non linear equation.

조회 수: 2 (최근 30일)
Sudhir Sahoo
Sudhir Sahoo 2021년 4월 14일
댓글: Sudhir Sahoo 2021년 4월 19일
How to plot the graph between versus m from this non linear equation given as where and also and are constants . Further represents the upper incomplete gamma function
  댓글 수: 4
Walter Roberson
Walter Roberson 2021년 4월 18일
Looks plausible.
Sudhir Sahoo
Sudhir Sahoo 2021년 4월 19일
@Walter Roberson Yes I have done that too thanks for your code

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

채택된 답변

Walter Roberson
Walter Roberson 2021년 4월 14일
format long g
t_min = .3, t_max = .8
t_min =
0.3
t_max =
0.8
syms theta_opt m real
a = sin(theta_opt).^2;
b = (cos(theta_opt) - sin(theta_opt)).^2;
part1 = (4./(cot(theta_opt) - 1).^2).^((m+2)./(m+3));
part2a = igamma((m+1)/(2*m+6), b*t_min/2);
part2b = igamma((m+1)/(2*m+6), b*t_max/2);
part2c = igamma((m+1)/(2*m+6), a*t_min/2);
part2d = igamma((m+1)/(2*m+6), a*t_max/2);
part2 = (part2a - part2b) ./ (part2c - part2d);
part0 = part1 .* part2;
eqn = part0 - tan(2*theta_opt)
eqn = 
F = matlabFunction(eqn, 'Vars', [theta_opt, m]);
M = linspace(.1,0.5,30);
to0 = 1/2;
opt = optimoptions('fsolve','Display','off');
theta_vals = arrayfun(@(m) fsolve(@(t) F(t,m), to0, opt), M)
theta_vals = 1×30
0.0069314830628348 0.00580857786032215 0.00476969071649739 0.00383107554970616 0.00300629942402464 0.00230365859998868 0.00172440452642074 0.00126245991980601 0.000905679893063352 0.000638173870072519 0.000442834585897566 0.000303403400001911 0.000205756788619826 0.00013842649511992 9.25693178041045e-05 6.16347434292645e-05 4.09168876360882e-05 2.71147042440712e-05 1.79533691833739e-05 1.18868228260001e-05 7.87482068082966e-06 5.22271731930821e-06 0.000261432834537425 0.000218383853943231 0.000182441265215855 0.000152451203889114 0.000127439225487863 0.000106583202718427 8.91937576217373e-05 7.46930184705892e-05
plot(M, theta_vals)
  댓글 수: 2
Sudhir Sahoo
Sudhir Sahoo 2021년 4월 14일
Thanks for your answer @Walter Roberson @Matt J
Sudhir Sahoo
Sudhir Sahoo 2021년 4월 18일
@Walter Roberson Hello , here I one thing is that the value of m is discrete like only I have to take ten values of m in random so how to impliment that instead of using linspace function

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

추가 답변 (1개)

Matt J
Matt J 2021년 4월 14일

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by