API Reference
Types
ChargedParticles.AbstractParticle
— TypeAbstractParticle
Abstract type representing any particle in plasma physics.
See also: ChargedParticleImpl
ChargedParticles.ChargedParticleImpl
— TypeChargedParticleImpl <: AbstractParticle
Implementation type for charged particles.
Fields
symbol::Symbol
: Chemical symbol or particle identifier (e.g., :Fe, :e, :μ)charge_number::Int
: Number of elementary charges (can be negative)mass_number::Int
: Total number of nucleons (protons + neutrons)
Notes
- Mass number : For elementary particles like electrons and muons,
mass_number
is 0 - Charge number : electrical charge in units of the elementary charge, usually denoted as z. https://en.wikipedia.org/wiki/Charge_number
Constructors
ChargedParticles.Particle
— FunctionParticle(str::AbstractString; mass_numb=nothing, z=nothing)
Create a particle from a string representation.
Arguments
str::AbstractString
: String representation of the particle
String Format Support
- Element symbols:
"Fe"
,"He"
- Isotopes:
"Fe-56"
,"D"
- Ions:
"Fe2+"
,"H-"
- Common aliases:
"electron"
,"proton"
,"alpha"
,"mu-"
Examples
# Elementary particles
+API Reference · ChargedParticles.jl API Reference
Types
ChargedParticles.AbstractParticle
— TypeAbstractParticle
Abstract type representing any particle in plasma physics.
See also: ChargedParticleImpl
sourceChargedParticles.ChargedParticleImpl
— TypeChargedParticleImpl <: AbstractParticle
Implementation type for charged particles.
Fields
symbol::Symbol
: Chemical symbol or particle identifier (e.g., :Fe, :e, :μ)charge_number::Int
: Number of elementary charges (can be negative)mass_number::Int
: Total number of nucleons (protons + neutrons)
Notes
- Mass number : For elementary particles like electrons and muons,
mass_number
is 0 - Charge number : electrical charge in units of the elementary charge, usually denoted as z. https://en.wikipedia.org/wiki/Charge_number
sourceConstructors
ChargedParticles.Particle
— FunctionParticle(str::AbstractString; mass_numb=nothing, z=nothing)
Create a particle from a string representation.
Arguments
str::AbstractString
: String representation of the particle
String Format Support
- Element symbols:
"Fe"
, "He"
- Isotopes:
"Fe-56"
, "D"
- Ions:
"Fe2+"
, "H-"
- Common aliases:
"electron"
, "proton"
, "alpha"
, "mu-"
Examples
# Elementary particles
electron = Particle("e-")
muon = Particle("mu-")
positron = Particle("e+")
@@ -8,35 +8,35 @@
proton = Particle("H+")
alpha = Particle("He2+")
deuteron = Particle("D+")
-iron56 = Particle("Fe-56")
sourceParticle(sym::Symbol)
Create a particle from its symbol representation.
Examples
# Elementary particles
+iron56 = Particle("Fe-56")
sourceParticle(sym::Symbol)
Create a particle from its symbol representation.
Examples
# Elementary particles
electron = Particle(:e)
muon = Particle(:muon)
-proton = Particle(:p)
sourceParticle(p::AbstractParticle)
Create a particle from another particle implementation, optionally specifying mass number and charge to override.
Examples
p = Particle("Fe2+")
-p2 = Particle(p; mass_numb=54, z=3) # Creates a new instance with same properties
sourceParticle(atomic_number::Int; mass_numb=nothing, z=0)
Create a particle from its atomic number with optional mass number and charge state.
Arguments
atomic_number::Int
: The atomic number (number of protons)mass_numb=nothing
: Optional mass number (total number of nucleons)z=0
: Optional charge number (in elementary charge units)
Examples
# Basic construction
+proton = Particle(:p)
sourceParticle(p::AbstractParticle)
Create a particle from another particle implementation, optionally specifying mass number and charge to override.
Examples
p = Particle("Fe2+")
+p2 = Particle(p; mass_numb=54, z=3) # Creates a new instance with same properties
sourceParticle(atomic_number::Int; mass_numb=nothing, z=0)
Create a particle from its atomic number with optional mass number and charge state.
Arguments
atomic_number::Int
: The atomic number (number of protons)mass_numb=nothing
: Optional mass number (total number of nucleons)z=0
: Optional charge number (in elementary charge units)
Examples
# Basic construction
iron = Particle(26) # Iron
u = Particle(92) # Uranium
# With mass number and charge
fe56_3plus = Particle(26, mass_numb=56, z=3) # Fe-56³⁺
-he4_2plus = Particle(2, mass_numb=4, z=2) # ⁴He²⁺ (alpha particle)
See also: Particle(::AbstractString)
sourceChargedParticles.proton
— FunctionCreate a proton
sourceChargedParticles.electron
— FunctionCreate an electron
sourceProperties
ChargedParticles.mass
— FunctionRetrieve the mass of an element isotope.
sourceReturn the mass of the particle
sourceChargedParticles.charge
— FunctionReturn the electric charge of the particle in elementary charge units
sourceChargedParticles.atomic_number
— Functionatomic_number(p::AbstractParticle)
Return the atomic number (number of protons) of the particle.
Examples
```julia fe = Particle("Fe") println(atomic_number(fe)) # 26
e = electron() println(atomic_number(e)) # 0
sourceChargedParticles.mass_number
— Functionmass_number(p::AbstractParticle)
Return the mass number (total number of nucleons) of the particle.
Examples
fe56 = Particle("Fe-56")
+he4_2plus = Particle(2, mass_numb=4, z=2) # ⁴He²⁺ (alpha particle)
See also: Particle(::AbstractString)
sourceChargedParticles.proton
— FunctionCreate a proton
sourceChargedParticles.electron
— FunctionCreate an electron
sourceProperties
ChargedParticles.mass
— FunctionRetrieve the mass of an element isotope.
sourceReturn the mass of the particle
sourceChargedParticles.charge
— FunctionReturn the electric charge of the particle in elementary charge units
sourceChargedParticles.atomic_number
— Functionatomic_number(p::AbstractParticle)
Return the atomic number (number of protons) of the particle.
Examples
```julia fe = Particle("Fe") println(atomic_number(fe)) # 26
e = electron() println(atomic_number(e)) # 0
sourceChargedParticles.mass_number
— Functionmass_number(p::AbstractParticle)
Return the mass number (total number of nucleons) of the particle.
Examples
fe56 = Particle("Fe-56")
println(mass_number(fe56)) # 56
e = electron()
-println(mass_number(e)) # 0
sourceType Checking
ChargedParticles.is_ion
— Functionis_ion(p::AbstractParticle)
Check if the particle is an ion (has non-zero charge and is not an elementary particle).
Examples
julia> is_ion(Particle("Fe3+"))
+println(mass_number(e)) # 0
sourceType Checking
ChargedParticles.is_ion
— Functionis_ion(p::AbstractParticle)
Check if the particle is an ion (has non-zero charge and is not an elementary particle).
Examples
julia> is_ion(Particle("Fe3+"))
true
julia> is_ion(Particle("Fe"))
false
julia> is_ion(electron())
-false
sourceChargedParticles.is_chemical_element
— Functionis_chemical_element(p::AbstractParticle)
Check if the particle is a chemical element.
Examples
julia> is_chemical_element(Particle("Fe"))
+false
sourceChargedParticles.is_chemical_element
— Functionis_chemical_element(p::AbstractParticle)
Check if the particle is a chemical element.
Examples
julia> is_chemical_element(Particle("Fe"))
true
julia> is_chemical_element(electron())
-false
sourceChargedParticles.is_default_isotope
— Functionis_default_isotope(p::AbstractParticle)
Check if the particle is the default isotope of its element.
Examples
julia> is_default_isotope(Particle("Fe-56"))
+false
sourceChargedParticles.is_default_isotope
— Functionis_default_isotope(p::AbstractParticle)
Check if the particle is the default isotope of its element.
Examples
julia> is_default_isotope(Particle("Fe-56"))
true
julia> is_default_isotope(Particle("Fe-57"))
-false
sourceChargedParticles.is_proton
— Functionis_proton(p::AbstractParticle)
Check if the particle is a proton (has symbol 'H', charge +1, and mass number 1).
Examples
julia> ChargedParticles.is_proton(proton())
+false
sourceChargedParticles.is_proton
— Functionis_proton(p::AbstractParticle)
Check if the particle is a proton (has symbol 'H', charge +1, and mass number 1).
Examples
julia> ChargedParticles.is_proton(proton())
true
julia> ChargedParticles.is_proton(electron())
-false
sourceChargedParticles.is_electron
— Functionis_electron(p::AbstractParticle)
Check if the particle is an electron (has symbol 'e', charge -1, and electron mass).
Examples
julia> ChargedParticles.is_electron(electron())
+false
sourceChargedParticles.is_electron
— Functionis_electron(p::AbstractParticle)
Check if the particle is an electron (has symbol 'e', charge -1, and electron mass).
Examples
julia> ChargedParticles.is_electron(electron())
true
julia> ChargedParticles.is_electron(proton())
-false
sourceConstants
ChargedParticles.PARTICLE_ALIASES
— ConstantPARTICLE_ALIASES
Dictionary of common particle aliases and their corresponding (symbol, charge, mass_number) tuples.
Each entry maps a string alias to a tuple of (symbol, charge, mass_number)
sourceSettings
This document was generated with Documenter.jl version 1.8.0 on Sunday 17 November 2024. Using Julia version 1.11.1.
+false
Constants
ChargedParticles.PARTICLE_ALIASES
— ConstantPARTICLE_ALIASES
Dictionary of common particle aliases and their corresponding (symbol, charge, mass_number) tuples.
Each entry maps a string alias to a tuple of (symbol, charge, mass_number)