I'm trying to plot the Compton Shift which I've defined as:

E2[ϕ_] := E1/(1 + (E1/(m*c^2))*(1 - Cos[ϕ Degree]))

I've initiated the constants and when I evaluate the function for various degrees, it gives me the correct answer.

The issue I'm getting is that when I try and plot this function (with m = 1, c = 299792458 and E1 = 180), my plot shows a line until the value of ϕ is increased to above ~30-40. I'll get a flat line for small values of Phi but for larger values, the line disappears and I get a blank plot.

What is the reason for this? Am I doing something wrong?

  • 3
    $\begingroup$ What you have is essentially $\frac{180}{1+\mathcal{O}(10^{-16})}$, which is approx $180$. I see a line for large values of phi — i.stack.imgur.com/b8loH.png Try plotting E1 - E2[phi] if you want to see the change in E2. $\endgroup$ – rm -rf Oct 22 '13 at 15:26

This is just to get an answer on record so the question can be removed from not-answered list.

As rm -rf pointed out in a comment to the question, the difference between E2 and the constant E1 is extremely small, so a plot of E2 is essentially a flat line at 180. If the difference between E2 and E1 is plotted, something useful is obtained.

With[{m = 1, c = 299792458, E1 = 180},
  E2[ϕ_] := E1/(1 + E1 (1 - Cos[ϕ Degree])/(m c^2));
  Plot[E1 - E2[ϕ], {ϕ , 0, 360}, WorkingPrecision -> 20]]



Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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