Advertisement
hiddenGem

Relativistic Electric

Aug 6th, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.76 KB | None | 0 0
  1. %% Relativistic Electric
  2. % Determines how many times the kinetic energy of the electron is larger
  3. % than the rest of its energy,the KE of the electron, the speed of the
  4. % electron in terms of the speed of light, and the momentum of the electron
  5. % measure in MeV/c
  6.  
  7. format long
  8.  
  9. % Constants
  10. M0c2 = 0.511;                     % [MeV] Rest energy of electron
  11. c = 3.00*10^8;                    % [m/s] Speed of Light
  12.  
  13. % Inputs and Variables
  14. E = input('Times total energy to rest energy\n');
  15.  
  16. % Outputs and Equations
  17. K = E-1;
  18. KE =  K*M0c2;
  19. Beta = sqrt(E^2-1)/E;
  20. p = E*M0c2;
  21. fprintf(['Kinetic energy is %.0fx rest energy\n'...
  22.          'Kinetic energy: %.3e MeV\n'...
  23.          'Speed of electrons %.9f\n'...
  24.          'Momentum in MeV/c: %.3e\n'],K,KE,Beta,p)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement