0
$\begingroup$

I am trying to plot this function

f[X_,Y_]=-(1/Sqrt[2])(√((1/2 - 0.500013 BesselJ[0, 0.01 X] + 
   100.001 BesselJ[1, 0.01 X] Cos[Y])^2/((1/2 - 
    0.500013 BesselJ[0, 0.01 X] + 
    100.001 BesselJ[1, 0.01 X] Cos[Y])^2 + 
  10000.3 BesselJ[1, 0.01 X]^2 Sin[Y]^2) + (
 10000.3 BesselJ[1, 0.01 X]^2 Sin[
   Y]^2)/((1/2 - 0.500013 BesselJ[0, 0.01 X] + 
    100.001 BesselJ[1, 0.01 X] Cos[Y])^2 + 
  10000.3 BesselJ[1, 0.01 X]^2 Sin[
    Y]^2) + (√((1/2 - 0.500013 BesselJ[0, 0.01 X] + 
        100.001 BesselJ[1, 0.01 X] Cos[Y])^2 ((1/2 - 
          0.500013 BesselJ[0, 0.01 X] + 
          100.001 BesselJ[1, 0.01 X] Cos[Y])^2 + 
        10000.3 BesselJ[1, 0.01 X]^2 Sin[Y]^2)))/((1/2 - 
      0.500013 BesselJ[0, 0.01 X] + 
      100.001 BesselJ[1, 0.01 X] Cos[Y])^2 + 
    10000.3 BesselJ[1, 0.01 X]^2 Sin[Y]^2)))

But I get this plot.

Plot[f[X, π/2], {X, 1, 10^4}]

enter image description here

I was expecting more regular oscillations, whereas I see in the lower part certain irregularities, and this make me think of some plotting error. Is there anything I can do to make the bessel function be plotted right?

Thanks!

$\endgroup$
  • $\begingroup$ @rhermans Done, thanks for pointing it out $\endgroup$ – usumdelphini Oct 21 '15 at 14:46
  • $\begingroup$ I'm not sure what you mean, but if you are unsatisfied by the quality of the Plot probably you could try increasing the number of points the function is evaluated on. beware this will be slow: Plot[f[X, Pi/2], {X, 1, 10^4}, PlotRange -> {-1.1, -0.7}, PlotPoints -> 100, MaxRecursion -> 15] $\endgroup$ – rhermans Oct 21 '15 at 14:53
2
$\begingroup$

You can see the effect that changing the number of plotted points has by

plotlist = 
  Table[Plot[f[X, \[Pi]/2], {X, 1, 10^4}, PlotPoints -> n, 
    PlotLabel -> "PlotPoints = " <> IntegerString[n]], {n, {30, 40, 
     100, 200, 400, 800}}];
ListAnimate[plotlist]

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.