2
$\begingroup$

I am trying to plot the intensity distribution of Double Slit DIffraction, I have used the manipulate function to manipulate Cos[p] which is for interference in the following code, but when I move the slider, instead of the peak going up, the Y-axis rescales such that the plot remains exactly same which defeats the purpose of using the function to visualize the change

Manipulate[Plot[(1*Sin[x]/x*Cos[p])^2, {x, -3 Pi, 3 Pi}, PlotStyle -> Orange, Filling -> Bottom, PlotRange -> All], {p, -3 Pi, 3 Pi}]
$\endgroup$
3
  • 6
    $\begingroup$ use PlotRange -> {{-3 Pi, 3 Pi}, {0, 1}}? $\endgroup$
    – kglr
    Commented Oct 10, 2020 at 16:02
  • 4
    $\begingroup$ Note that Sin[x]/x == Sinc[x] and Sinc[x] has the advantage of being defined for x == 0 $\endgroup$
    – Bob Hanlon
    Commented Oct 10, 2020 at 17:19
  • $\begingroup$ Manipulate[ Plot[(Sinc[x]*Cos[p])^2, {x, -3 Pi, 3 Pi}, PlotStyle -> Orange, Filling -> Axis, PlotRange -> 1], {p, -3 Pi, 3 Pi}] $\endgroup$
    – cvgmt
    Commented Oct 11, 2020 at 0:01

0

Browse other questions tagged or ask your own question.