!******************************************************** !* Calculate relativistic mass and speed of an electron * !* accelerated in an electron gun * !* ---------------------------------------------------- * !* SAMPLE RUN: * !* * !* Give electron gun voltage in volts: 1e6 * !* * !* Relativistic mass (kg) and speed (m/s): * !* 2.6933944E-30 2.8212490E+08 * !* * !* ---------------------------------------------------- * !* Ref.: "Problem Solving with Fortran 90 By David R. * !* Brooks, Springer-Verlag New York, 1997". * !******************************************************** !Explanations: !------------ ! ! An electron accelerated by a voltage V in an electron gun ! ! 2 2 ! acquires an energy of Ve = mc - m c, where ! 0 ! -19 ! charge on an electron e = 1.602 x 10 coulomb ! ! -31 ! rest mass m = 9.109 x 10 kg ! 0 ! 8 ! speed of light c = 2.9979 x 10 m/s ! ! The speed v of an electron of relativistic mass m (kg) is ! obtained from ! 2 ! m/m = 1 / sqrt(1 - (v/c) ) ! 0 ! !----------------------------------------------------------- Program Rel_Mass Implicit None !All variables must be declared Real rest_mass, rela_mass ! kg Real voltage ! volt Real speed ! m/s Real e ! electron charge in coulomb Real c ! speed of light in m/s Parameter (e=1.602e-19, c=2.9979e8, rest_mass=9.109e-31) print *,' ' write(*,10,advance='no'); read *, voltage rela_mass = (voltage*e + rest_mass*c**2) / c**2 speed = c*(1. - (rest_mass/rela_mass)**2)**0.5 print *,' ' print *,'Relativistic mass (kg) and speed (m/s):' print *, rela_mass, speed print *,' ' 10 format(' Give electron gun voltage in volts: ') End !End of file rel_mass.f90