Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Protons from the Tevatron
- % Determines the Lorentz gamma factor and the speed of the protons in terms
- % of the speed of light
- format long
- % Constants
- c = 3.00*10^8; % [m/s] Speed of Light
- E0 = 938.27; % [Mev] Proton Energy
- % Inputs and Variables
- E = input('Proton energy in TeV\n')*10^6;
- % Outputs and Equations
- gamma = E/E0;
- Beta = sqrt((gamma^2-1)/gamma^2);
- fprintf('gamma: %.4e\nSpeed: %.9f\n',gamma, Beta)
- %{
- E is saved in MeV
- Code requires format to be long otherwise the variable Beta will come out
- to 1
- %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement