Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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
3  
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. –  rm -rf Oct 22 '13 at 15:26

1 Answer 1

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]]

plot.png

share|improve this answer

Your Answer

 
discard

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.