hari1501
(Harikrishnan A)
March 26, 2018, 6:44am
1
I need to create a log-log plot of the following function:
f1=((v^2/(k - 3/2) + 1)^-k Gamma[k + 1] v^2)/(k Sqrt[(k - 3/2) \[Pi]]
Gamma[k - 0.5])
The plot given by mathematica is:
and the plot given by matlab is:
What could be reason for this? Please see the code of mathematica
ClearAll["Global`*"]
distFunckappa = ((v^2/(k - 3/2) + 1)^-k Gamma[k + 1] v^2)/(
k Sqrt[(k - 3/2) \[Pi]] Gamma[k - 0.5])
k = 2;
LogLogPlot[distFunckappa, {v, 0, 10},
PlotStyle -> Directive[Blue, Thick],
AxesStyle -> Directive[Black, Bold, FontSize -> 14],
TicksStyle -> Directive[Black, Bold], AxesLabel -> {"v", "DNF"},
Axes -> True]
and code in matlab is:
k=2;
v=0:0.1:10;
kappaDistFunc=(gamma(k+1)./(k.*gamma(k-1/2).*sqrt(k-3/2).*sqrt(pi))).*(1+(v.^2./(k-3/2))).^(-k).*v.^2;
loglog(kappaDistFunc)
Please help me Thanks in advance
Mathematica gives a correct answer. Execute yours matlab code, give the same form as Mathematica.
hari1501
(Harikrishnan A)
March 26, 2018, 10:03am
3
My version of Mathematica is Mathematica 11.0. It gives me the first plot and matlab gives me the second plot and Matlab is correct. But people using Mathematica 11.3 is getting the same plot as matlab
hari1501
(Harikrishnan A)
March 26, 2018, 10:07am
4
My version of Mathematica is Mathematica 11.0. It gives me the first plot and matlab gives me the second plot and Matlab is correct. But people using Mathematica 11.3 is getting the same plot as matlab
hari1501
(Harikrishnan A)
March 26, 2018, 12:35pm
6
See this: I have also done the same. What is the issue??
Probably a bug in LogLogPlot in Mathematica 11.0.0 .
Try plot in Plot :
Plot[(0.900316*v^2)/(1 + 2 v^2)^2, {v, 0, 10}]
And what Yours conclusions ?
hari1501
(Harikrishnan A)
March 26, 2018, 5:14pm
8
Yes, the plot gives the correct answer. But I want to represent the data in log scale as loglog plot
Try:
distFunckappa = ((v^2/(k - 3/2) + 1)^-k Gamma[k + 1] v^2)/(k Sqrt[(k - 3/2) \[Pi]] Gamma[k - 0.5])
k = 2;
ListLogLogPlot[Table[{v, distFunckappa}, {v, 0.1, 10, 1/10}],
PlotStyle -> Directive[Blue, Thick],
AxesStyle -> Directive[Black, Bold, FontSize -> 14],
TicksStyle -> Directive[Black, Bold], AxesLabel -> {"v", "DNF"}, Joined -> True]
hari1501
(Harikrishnan A)
March 28, 2018, 12:10am
10
Thank you, sir. This works correctly