Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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 — Try plotting E1 - E2[phi] if you want to see the change in E2. – R. M. 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]]


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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