Advertisement
hiddenGem

Protons from the Tevatron

Aug 6th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.56 KB | None | 0 0
  1. %% Protons from the Tevatron
  2. % Determines the Lorentz gamma factor and the speed of the protons in terms
  3. % of the speed of light
  4.  
  5. format long
  6.  
  7. % Constants
  8. c = 3.00*10^8;                  % [m/s] Speed of Light
  9. E0 = 938.27;                    % [Mev] Proton Energy
  10.  
  11. % Inputs and Variables
  12. E = input('Proton energy in TeV\n')*10^6;
  13.  
  14. % Outputs and Equations
  15. gamma = E/E0;
  16. Beta = sqrt((gamma^2-1)/gamma^2);
  17. fprintf('gamma: %.4e\nSpeed: %.9f\n',gamma, Beta)
  18. %{
  19. E is saved in MeV
  20.  
  21. Code requires format to be long otherwise the variable Beta will come out
  22. to 1
  23. %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement