Physics
el_paso.physics
Functions:
el_paso.physics.en2pc
en2pc
en2pc
en2pc
Calculate the relativistic momentum (p*c) for a given total energy.
This function calculates the relativistic energy using the formula: $$ pc = \sqrt{(E/m_0c^2 + 1)^2 - 1} \cdot m_0c^2 $$ where \(E\) is the total energy, \(m_0c^2\) is the rest energy of the particle, and \(pc\) is the relativistic momentum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
energy
|
ndarray or float
|
The total energy in MeV. |
required |
species
|
str
|
The species of particle ('electron', 'proton', 'helium', 'oxygen'). |
'electron'
|
Returns:
| Type | Description |
|---|---|
float | NDArray[number]
|
np.ndarray or float: The calculated relativistic momentum times c (p*c). |
Source code in el_paso/physics.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
el_paso.physics.rest_energy
rest_energy
Return the rest energy for the input species.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
species
|
str
|
The species of particle ('electron', 'proton', 'helium', 'oxygen'). |
required |
Returns:
| Type | Description |
|---|---|
float
|
np.ndarray or float: The rest energy of the species in MeV. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If an unknown species is provided. |
Source code in el_paso/physics.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |