Plotting a non linear equation.

5 vues (au cours des 30 derniers jours)
Sudhir Sahoo
Sudhir Sahoo le 14 Avr 2021
Commenté : Sudhir Sahoo le 19 Avr 2021
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 commentaires
Walter Roberson
Walter Roberson le 18 Avr 2021
Looks plausible.
Sudhir Sahoo
Sudhir Sahoo le 19 Avr 2021
@Walter Roberson Yes I have done that too thanks for your code

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 14 Avr 2021
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 commentaires
Sudhir Sahoo
Sudhir Sahoo le 14 Avr 2021
Thanks for your answer @Walter Roberson @Matt J
Sudhir Sahoo
Sudhir Sahoo le 18 Avr 2021
@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

Connectez-vous pour commenter.

Plus de réponses (1)

Matt J
Matt J le 14 Avr 2021

Community Treasure Hunt

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

Start Hunting!

Translated by