Question: This question concerns the Compton formula which gives the energy Eout of a scattered photon as a function of the energy Ein of the incoming

This question concerns the Compton formula which gives the energy Eout of a scattered photon as a function of the energy Ein of the incoming photon and the angle of scatter @: Ein Eout = 1+ (1 - cos(0)] mec2 Where me is the rest mass of the electron, and c the speed of light in a vacuum. Write a Python function that takes an incoming energy Ein (in keV) and an angle 0 (in degrees) and returns the scattered energy Eout (in keV). Your function should be preceded by comment lines explaining its purpose and use, and detailing the input parameters and returned value. You should also include explanatory comments within the function where appropriate. Test your function The mass energy of the electron mec expressed in electronvolts is: 511.0 keV Paste a copy of your function, including any comments and import statements (either as text or as a screenshot) into your answer. Explain how you have tested your function. (4 Marks) Write a Python program using your function from part a) to plot the ratio of the scattered energy to input energy, ut for angles from zero to 150 degrees. Plot three lines on the same graph, showing the variation in scattered energy for the following three input energies: 17.4 keV, 174 keV, and 348 keV. This question concerns the Compton formula which gives the energy Eout of a scattered photon as a function of the energy Ein of the incoming photon and the angle of scatter @: Ein Eout = 1+ (1 - cos(0)] mec2 Where me is the rest mass of the electron, and c the speed of light in a vacuum. Write a Python function that takes an incoming energy Ein (in keV) and an angle 0 (in degrees) and returns the scattered energy Eout (in keV). Your function should be preceded by comment lines explaining its purpose and use, and detailing the input parameters and returned value. You should also include explanatory comments within the function where appropriate. Test your function The mass energy of the electron mec expressed in electronvolts is: 511.0 keV Paste a copy of your function, including any comments and import statements (either as text or as a screenshot) into your answer. Explain how you have tested your function. (4 Marks) Write a Python program using your function from part a) to plot the ratio of the scattered energy to input energy, ut for angles from zero to 150 degrees. Plot three lines on the same graph, showing the variation in scattered energy for the following three input energies: 17.4 keV, 174 keV, and 348 keV
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
