3
$\begingroup$

I have the code of the function

InversedsToGeV = 1/(1.5*10^24);
GammatotalBInInverseds = (1.638*10^-12)^-1;
GammatotalB = GammatotalBInInverseds*InversedsToGeV
mB = 5.279;
mK = 0.493;
mPi = 0.14;
vhiggs = 240;
ebs = 3.6*10^-4;
ebd = 7.9*10^-5;
fBK = 0.33;
fBpi = 0.258;
MBpole = Sqrt[38];
msquark = 0.09;
mbquark = 4.65;
BKFormFactor[S_] = fBK/(1 - S/MBpole^2);
BpiFormFactor[S_] = fBpi/(1 - S/MBpole^2);
BrscalarBtoK[MS_] = 
  Piecewise[{{1/(8*Pi) 1/(
      mB GammatotalB) (mbquark/vhiggs*BKFormFactor[MS^2]*
        ebs*(mB^2 - mK^2)/(mbquark - msquark))^2 (1 + MS^4/mB^4 + 
        mK^4/mB^4 - 2*MS^2*mK^2/mB^4 - 2*mK^2/mB^2 - 2*MS^2/mB^2)^(
      1/2)/2, MS < mB - mK}, {0, True}}];

I try to plot the function BrscalarBtoK with the code

LogPlot[{BrscalarBtoK[m\[Phi]]}, {m\[Phi], 0.21, 10}, 
 FrameLabel -> {"\!\(\*SubscriptBox[\(m\), \(\[Phi]\)]\) [GeV]", 
   "\!\(\*SubscriptBox[\(P\), \(meson\)]\)/\!\(\*SuperscriptBox[\(\
\[Theta]\), \(2\)]\)"}, Frame -> True, 
 FrameStyle -> Directive[Black, 35], 
 PlotRange -> {{0, 10}, {10^-5, 5}}, 
 PlotStyle -> {{Thick, Blue, Thickness[0.005]}}, 
 GridLines -> Automatic, ImageSize -> Large]

The result is on the left picture below. However, I want it to be like on the right picture below and don't understand what is the reason for this incorrect plotting. Can you please help me with this problem?

enter image description here

$\endgroup$
  • $\begingroup$ Try increasing PlotPoints or MaxRecursion? $\endgroup$ – user202729 Jun 28 '18 at 12:52
  • 1
    $\begingroup$ Maybe change the value of the piecewise function above the threshold to 10^-9 rather than zero (which is difficult to show in a log plot). The option Exclusions -> None could help. $\endgroup$ – b.gates.you.know.what Jun 28 '18 at 12:57
  • $\begingroup$ @b.gatessucks : thank you, your advice helped! $\endgroup$ – John Taylor Jun 28 '18 at 13:06
5
$\begingroup$

Add a second plot that is focused on the region you want, with increased PlotPoints to help the sampling:

plot2 = LogPlot[{BrscalarBtoK[m\[Phi]]}, {m\[Phi], mB - mK - 10^-2, 
   mB - mK}, PlotRange -> All, PlotPoints -> 2000, ImageSize -> Large,
   PlotStyle -> Red]

Show[plot1,plot2]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.