Advertisement
hiddenGem

Mass and Energies of Particles

Aug 6th, 2020
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.57 KB | None | 0 0
  1. %% Mass and Energies of a Relativistic Particle
  2. % Determines the mass, rest energy, kinetic energy, and total energy of a
  3. % particle
  4.  
  5. % Constants
  6. c = 3.00*10^8;                  % [m/s] Speed of Light
  7.  
  8. % Inputs and Variables
  9. Beta = input('Particle speed without c\n');
  10. p = input('Momentum of particle in kg*m/s\n');
  11.  
  12. % Outputs and Equations
  13. M0 = p*sqrt(1-Beta^2)/(Beta*c);
  14. E0 = M0*c^2;
  15. E = p*c/Beta;
  16. K = E-E0;
  17. fprintf(['Mass: %.3e kg\n'...
  18.          'Rest energy: %.3e J\n'...
  19.          'Kinetic energy: %.3e J\n'...
  20.          'Total energy: %.3e J\n'],M0,E0,K,E)
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement