From 4305876b8e4d96ff7937fdc6a0648a10d53c56e8 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Thu, 14 Nov 2024 20:44:17 +0000 Subject: [PATCH] build based on a99c6c9 --- dev/.documenter-siteinfo.json | 2 +- dev/api/index.html | 30 +++++++++++++-------------- dev/index.html | 2 +- dev/manual/construction/index.html | 2 +- dev/manual/getting-started/index.html | 2 +- dev/manual/particle-types/index.html | 2 +- dev/search_index.js | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 3f4525f..2c8e3a8 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-14T18:47:26","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-14T20:44:12","documenter_version":"1.8.0"}} \ No newline at end of file diff --git a/dev/api/index.html b/dev/api/index.html index e5ccdb3..03e8288 100644 --- a/dev/api/index.html +++ b/dev/api/index.html @@ -1,38 +1,38 @@ -API Reference · ChargedParticles.jl

API Reference

Types

ChargedParticles.ChargedParticleImplType
ChargedParticleImpl <: 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)
  • mass::Unitful.Mass: Mass of the particle in appropriate units

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
source

Constructors

ChargedParticles.ParticleFunction
Particle(str::AbstractString)

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-")     # electron
-muon = Particle("mu-")        # muon
-positron = Particle("e+")     # positron
+API Reference · ChargedParticles.jl

API Reference

Types

ChargedParticles.ChargedParticleImplType
ChargedParticleImpl <: 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)
  • mass::Unitful.Mass: Mass of the particle in appropriate units

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
source

Constructors

ChargedParticles.ParticleFunction
Particle(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+")
 
 # Ions and isotopes
-proton = Particle("H+")       # proton
-alpha = Particle("He2+")      # alpha particle
-deuteron = Particle("D+")     # deuterium ion
-iron56 = Particle("Fe-56")    # iron-56 isotope
source
Particle(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("H+")
+alpha = Particle("He2+")
+deuteron = Particle("D+")
+iron56 = Particle("Fe-56")
source
Particle(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)

source

Properties

ChargedParticles.atomic_numberFunction
atomic_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

source

Properties

ChargedParticles.atomic_numberFunction
atomic_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

source
ChargedParticles.mass_numberFunction
mass_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
source

Type Checking

ChargedParticles.is_ionFunction
is_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
source

Type Checking

ChargedParticles.is_ionFunction
is_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
source
ChargedParticles.is_chemical_elementFunction
is_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
source
ChargedParticles.is_default_isotopeFunction
is_default_isotope(p::AbstractParticle)

Check if the particle is the default isotope of its element.

Examples

julia> is_default_isotope(Particle("Fe-56"))
+false
source
ChargedParticles.is_default_isotopeFunction
is_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
source
ChargedParticles.is_protonFunction
is_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
source
ChargedParticles.is_protonFunction
is_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
source
ChargedParticles.is_electronFunction
is_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
source
ChargedParticles.is_electronFunction
is_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
source

Constants

ChargedParticles.PARTICLE_ALIASESConstant
PARTICLE_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)

source
+false
source

Constants

ChargedParticles.PARTICLE_ALIASESConstant
PARTICLE_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)

source
diff --git a/dev/index.html b/dev/index.html index 74be240..98534f1 100644 --- a/dev/index.html +++ b/dev/index.html @@ -21,4 +21,4 @@ Alpha particle charge: 3.204353268e-19 C Iron charge: 4.806529901999999e-19 C Iron-56 mass number: 56 -Deuteron mass: 1.008 u

Manual Outline

+Deuteron mass: 1.008 u

Manual Outline

diff --git a/dev/manual/construction/index.html b/dev/manual/construction/index.html index 2fa739a..29baeef 100644 --- a/dev/manual/construction/index.html +++ b/dev/manual/construction/index.html @@ -67,4 +67,4 @@ catch e println("Error: ", e) end
Error: KeyError(:XX)
-Error: KeyError(-1)
+Error: KeyError(-1) diff --git a/dev/manual/getting-started/index.html b/dev/manual/getting-started/index.html index 3dc7301..0b1ba71 100644 --- a/dev/manual/getting-started/index.html +++ b/dev/manual/getting-started/index.html @@ -55,4 +55,4 @@ println("Deuteron mass number: ", mass_number(deuteron)) println("Tritium mass number: ", mass_number(tritium))
Fe-56 mass number: 56
 Deuteron mass number: 2
-Tritium mass number: 3
+Tritium mass number: 3 diff --git a/dev/manual/particle-types/index.html b/dev/manual/particle-types/index.html index f2e3fd2..0f92f95 100644 --- a/dev/manual/particle-types/index.html +++ b/dev/manual/particle-types/index.html @@ -48,4 +48,4 @@ t = Particle("T+") println("Triton: A = $(mass_number(t))")
Alpha: Z = 2, A = 4
 Deuteron: A = 2
-Triton: A = 3
+Triton: A = 3 diff --git a/dev/search_index.js b/dev/search_index.js index 2940805..f5a699b 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"api/#API-Reference","page":"API Reference","title":"API Reference","text":"","category":"section"},{"location":"api/#Types","page":"API Reference","title":"Types","text":"","category":"section"},{"location":"api/","page":"API Reference","title":"API Reference","text":"Modules = [ChargedParticles]\nPrivate = false\nOrder = [:type]","category":"page"},{"location":"api/#ChargedParticles.AbstractParticle","page":"API Reference","title":"ChargedParticles.AbstractParticle","text":"AbstractParticle\n\nAbstract type representing any particle in plasma physics.\n\nSee also: ChargedParticleImpl\n\n\n\n\n\n","category":"type"},{"location":"api/#ChargedParticles.ChargedParticleImpl","page":"API Reference","title":"ChargedParticles.ChargedParticleImpl","text":"ChargedParticleImpl <: AbstractParticle\n\nImplementation type for charged particles.\n\nFields\n\nsymbol::Symbol: Chemical symbol or particle identifier (e.g., :Fe, :e, :μ)\ncharge_number::Int: Number of elementary charges (can be negative)\nmass_number::Int: Total number of nucleons (protons + neutrons)\nmass::Unitful.Mass: Mass of the particle in appropriate units\n\nNotes\n\nMass number : For elementary particles like electrons and muons, mass_number is 0\nCharge number : electrical charge in units of the elementary charge, usually denoted as z. https://en.wikipedia.org/wiki/Charge_number\n\n\n\n\n\n","category":"type"},{"location":"api/#Constructors","page":"API Reference","title":"Constructors","text":"","category":"section"},{"location":"api/","page":"API Reference","title":"API Reference","text":"Particle\nproton\nelectron","category":"page"},{"location":"api/#ChargedParticles.Particle","page":"API Reference","title":"ChargedParticles.Particle","text":"Particle(str::AbstractString)\n\nCreate a particle from a string representation.\n\nArguments\n\nstr::AbstractString: String representation of the particle\n\nString Format Support\n\nElement symbols: \"Fe\", \"He\"\nIsotopes: \"Fe-56\", \"D\"\nIons: \"Fe2+\", \"H-\"\nCommon aliases: \"electron\", \"proton\", \"alpha\", \"mu-\"\n\nExamples\n\n# Elementary particles\nelectron = Particle(\"e-\") # electron\nmuon = Particle(\"mu-\") # muon\npositron = Particle(\"e+\") # positron\n\n# Ions and isotopes\nproton = Particle(\"H+\") # proton\nalpha = Particle(\"He2+\") # alpha particle\ndeuteron = Particle(\"D+\") # deuterium ion\niron56 = Particle(\"Fe-56\") # iron-56 isotope\n\n\n\n\n\nParticle(atomic_number::Int; mass_numb=nothing, Z=0)\n\nCreate a particle from its atomic number with optional mass number and charge state.\n\nArguments\n\natomic_number::Int: The atomic number (number of protons)\nmass_numb=nothing: Optional mass number (total number of nucleons)\nZ=0: Optional charge number (in elementary charge units)\n\nExamples\n\n# Basic construction\niron = Particle(26) # Iron\nu = Particle(92) # Uranium\n\n# With mass number and charge\nfe56_3plus = Particle(26, mass_numb=56, Z=3) # Fe-56³⁺\nhe4_2plus = Particle(2, mass_numb=4, Z=2) # He⁴²⁺ (alpha particle)\n\nSee also: Particle(::AbstractString)\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.proton","page":"API Reference","title":"ChargedParticles.proton","text":"Create a proton\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.electron","page":"API Reference","title":"ChargedParticles.electron","text":"Create an electron\n\n\n\n\n\n","category":"function"},{"location":"api/#Properties","page":"API Reference","title":"Properties","text":"","category":"section"},{"location":"api/","page":"API Reference","title":"API Reference","text":"mass\ncharge\natomic_number\nmass_number","category":"page"},{"location":"api/#ChargedParticles.mass","page":"API Reference","title":"ChargedParticles.mass","text":"Return the mass of the particle in atomic mass units\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.charge","page":"API Reference","title":"ChargedParticles.charge","text":"Return the electric charge of the particle in elementary charge units\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.atomic_number","page":"API Reference","title":"ChargedParticles.atomic_number","text":"atomic_number(p::AbstractParticle)\n\nReturn the atomic number (number of protons) of the particle.\n\nExamples\n\n```julia fe = Particle(\"Fe\") println(atomic_number(fe)) # 26\n\ne = electron() println(atomic_number(e)) # 0\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.mass_number","page":"API Reference","title":"ChargedParticles.mass_number","text":"mass_number(p::AbstractParticle)\n\nReturn the mass number (total number of nucleons) of the particle.\n\nExamples\n\nfe56 = Particle(\"Fe-56\")\nprintln(mass_number(fe56)) # 56\n\ne = electron()\nprintln(mass_number(e)) # 0\n\n\n\n\n\n","category":"function"},{"location":"api/#Type-Checking","page":"API Reference","title":"Type Checking","text":"","category":"section"},{"location":"api/","page":"API Reference","title":"API Reference","text":"is_ion\nis_chemical_element\nis_default_isotope\nChargedParticles.is_proton\nChargedParticles.is_electron","category":"page"},{"location":"api/#ChargedParticles.is_ion","page":"API Reference","title":"ChargedParticles.is_ion","text":"is_ion(p::AbstractParticle)\n\nCheck if the particle is an ion (has non-zero charge and is not an elementary particle).\n\nExamples\n\njulia> is_ion(Particle(\"Fe3+\"))\ntrue\njulia> is_ion(Particle(\"Fe\"))\nfalse\njulia> is_ion(electron())\nfalse\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.is_chemical_element","page":"API Reference","title":"ChargedParticles.is_chemical_element","text":"is_chemical_element(p::AbstractParticle)\n\nCheck if the particle is a chemical element.\n\nExamples\n\njulia> is_chemical_element(Particle(\"Fe\"))\ntrue\njulia> is_chemical_element(electron())\nfalse\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.is_default_isotope","page":"API Reference","title":"ChargedParticles.is_default_isotope","text":"is_default_isotope(p::AbstractParticle)\n\nCheck if the particle is the default isotope of its element.\n\nExamples\n\njulia> is_default_isotope(Particle(\"Fe-56\"))\ntrue\njulia> is_default_isotope(Particle(\"Fe-57\"))\nfalse\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.is_proton","page":"API Reference","title":"ChargedParticles.is_proton","text":"is_proton(p::AbstractParticle)\n\nCheck if the particle is a proton (has symbol 'H', charge +1, and mass number 1).\n\nExamples\n\njulia> ChargedParticles.is_proton(proton())\ntrue\njulia> ChargedParticles.is_proton(electron())\nfalse\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.is_electron","page":"API Reference","title":"ChargedParticles.is_electron","text":"is_electron(p::AbstractParticle)\n\nCheck if the particle is an electron (has symbol 'e', charge -1, and electron mass).\n\nExamples\n\njulia> ChargedParticles.is_electron(electron())\ntrue\njulia> ChargedParticles.is_electron(proton())\nfalse\n\n\n\n\n\n","category":"function"},{"location":"api/#Constants","page":"API Reference","title":"Constants","text":"","category":"section"},{"location":"api/","page":"API Reference","title":"API Reference","text":"ChargedParticles.PARTICLE_ALIASES","category":"page"},{"location":"api/#ChargedParticles.PARTICLE_ALIASES","page":"API Reference","title":"ChargedParticles.PARTICLE_ALIASES","text":"PARTICLE_ALIASES\n\nDictionary of common particle aliases and their corresponding (symbol, charge, mass_number) tuples.\n\nEach entry maps a string alias to a tuple of (symbol, charge, mass_number)\n\n\n\n\n\n","category":"constant"},{"location":"manual/getting-started/#Getting-Started","page":"Getting Started","title":"Getting Started","text":"","category":"section"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"using ChargedParticles","category":"page"},{"location":"manual/getting-started/#Basic-Usage","page":"Getting Started","title":"Basic Usage","text":"","category":"section"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"First, import the package:","category":"page"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"using ChargedParticles","category":"page"},{"location":"manual/getting-started/#Creating-Particles","page":"Getting Started","title":"Creating Particles","text":"","category":"section"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"There are several ways to create particles:","category":"page"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"using ChargedParticles\n# Using string format\ne = Particle(\"e-\")\np = Particle(\"H+\")\nalpha = Particle(\"He2+\")\n\n# Using convenience constructors\ne = electron()\np = proton()\n\n# Using atomic numbers\niron = Particle(26) # Fe\nhelium = Particle(2, mass_numb=4, Z=2) # He⁴²⁺","category":"page"},{"location":"manual/getting-started/#Accessing-Properties","page":"Getting Started","title":"Accessing Properties","text":"","category":"section"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"Each particle has several physical properties that can be accessed:","category":"page"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"using ChargedParticles\n\np = proton()\n\n# Get mass\nm = mass(p)\n\n# Get charge\nq = charge(p)\n\n# Get atomic and mass numbers\nz = atomic_number(p)\na = mass_number(p)\n\nprintln(\"Proton properties:\")\nprintln(\"Mass: \", m)\nprintln(\"Charge: \", q)\nprintln(\"Atomic number: \", z)\nprintln(\"Mass number: \", a)","category":"page"},{"location":"manual/getting-started/#Working-with-Ions","page":"Getting Started","title":"Working with Ions","text":"","category":"section"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"Creating and working with ions is straightforward:","category":"page"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"using ChargedParticles\n\n# Create some ions\nfe3 = Particle(\"Fe3+\") # Iron(III)\nhydride = Particle(\"H-\") # Hydride ion\n\n# Check if particles are ions\nprintln(\"Is Fe3+ an ion? \", is_ion(fe3))\nprintln(\"Is H- an ion? \", is_ion(hydride))\nprintln(\"Is electron an ion? \", is_ion(electron()))","category":"page"},{"location":"manual/getting-started/#Working-with-Isotopes","page":"Getting Started","title":"Working with Isotopes","text":"","category":"section"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"You can create and work with isotopes using mass numbers:","category":"page"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"using ChargedParticles\n\n# Create isotopes\nfe56 = Particle(\"Fe-56\")\ndeuteron = Particle(\"D+\")\ntritium = Particle(\"T\")\n\nprintln(\"Fe-56 mass number: \", mass_number(fe56))\nprintln(\"Deuteron mass number: \", mass_number(deuteron))\nprintln(\"Tritium mass number: \", mass_number(tritium))","category":"page"},{"location":"manual/particle-types/#Particle-Types","page":"Particle Types","title":"Particle Types","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"ChargedParticles.jl provides a flexible type system for representing various types of particles commonly encountered in plasma physics.","category":"page"},{"location":"manual/particle-types/#Type-Hierarchy","page":"Particle Types","title":"Type Hierarchy","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"
\nAbstractParticle\n└── ChargedParticleImpl\n
","category":"page"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"The package uses a simple two-level type hierarchy:","category":"page"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"AbstractParticle: Base abstract type for all particles\nChargedParticleImpl: Concrete implementation storing particle properties","category":"page"},{"location":"manual/particle-types/#Particle-Properties","page":"Particle Types","title":"Particle Properties","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"Each particle has four fundamental properties:","category":"page"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"Symbol (symbol::Symbol): Chemical symbol or particle identifier\nRegular elements: :Fe, :He, etc.\nElementary particles: :e (electron), :μ (muon)\nSpecial particles: :n (neutron)\nCharge Number (charge_number::Int): Number of elementary charges\nPositive for cations: +1, +2, etc.\nNegative for anions: -1, -2, etc.\nZero for neutral atoms/particles\nMass Number (mass_number::Int): Total number of nucleons\nFor isotopes: sum of protons and neutrons\nFor elementary particles: 0\nFor regular elements: most abundant isotope\nMass (mass::Unitful.Mass): Particle mass\nUses appropriate units from Unitful.jl\nElementary particles: electron mass units (me)\nAtoms and ions: atomic mass units (u)","category":"page"},{"location":"manual/particle-types/#Supported-Particle-Categories","page":"Particle Types","title":"Supported Particle Categories","text":"","category":"section"},{"location":"manual/particle-types/#Elementary-Particles","page":"Particle Types","title":"Elementary Particles","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"using ChargedParticles\n\n# Electron\ne = electron()\nprintln(\"Electron: charge = $(charge(e)), mass = $(mass(e))\")\n\n# Muon\nμ = Particle(\"mu-\")\nprintln(\"Muon: charge = $(charge(μ)), mass = $(mass(μ))\")","category":"page"},{"location":"manual/particle-types/#Atoms-and-Ions","page":"Particle Types","title":"Atoms and Ions","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"using ChargedParticles\n\n# Neutral atom\nfe = Particle(\"Fe\")\nprintln(\"Iron: Z = $(atomic_number(fe)), A = $(mass_number(fe))\")\n\n# Positive ion\nfe3 = Particle(\"Fe3+\")\nprintln(\"Iron(III): charge = $(charge(fe3))\")\n\n# Negative ion\nh_minus = Particle(\"H-\")\nprintln(\"Hydride: charge = $(charge(h_minus))\")","category":"page"},{"location":"manual/particle-types/#Isotopes","page":"Particle Types","title":"Isotopes","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"using ChargedParticles\n\n# Neutral isotope\nfe56 = Particle(\"Fe-56\")\nprintln(\"Fe-56: A = $(mass_number(fe56))\")\n\n# Charged isotope\nhe4_2plus = Particle(\"He2+\", mass_numb=4)\nprintln(\"He-4(2+): Z = $(atomic_number(he4_2plus)), A = $(mass_number(he4_2plus))\")","category":"page"},{"location":"manual/particle-types/#Special-Particles","page":"Particle Types","title":"Special Particles","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"using ChargedParticles\n\n# Alpha particle\nα = Particle(\"alpha\")\nprintln(\"Alpha: Z = $(atomic_number(α)), A = $(mass_number(α))\")\n\n# Deuteron\nd = Particle(\"D+\")\nprintln(\"Deuteron: A = $(mass_number(d))\")\n\n# Triton\nt = Particle(\"T+\")\nprintln(\"Triton: A = $(mass_number(t))\")","category":"page"},{"location":"manual/construction/#Particle-Construction","page":"Construction","title":"Particle Construction","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"ChargedParticles.jl provides multiple ways to construct particles, offering flexibility for different use cases.","category":"page"},{"location":"manual/construction/#String-Format","page":"Construction","title":"String Format","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"The most common way to create particles is using string format:","category":"page"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"using ChargedParticles\n\n# Basic elements\nfe = Particle(\"Fe\") # Iron\nhe = Particle(\"He\") # Helium\n\n# Ions with charge\nfe3 = Particle(\"Fe3+\") # Iron(III)\nfe2 = Particle(\"Fe2-\") # Iron(-II)\n\n# Isotopes\nfe56 = Particle(\"Fe-56\") # Iron-56\nu235 = Particle(\"U-235\") # Uranium-235\n\nprintln(\"Iron: Z = $(atomic_number(fe))\")\nprintln(\"Iron(III): charge = $(charge(fe3))\")\nprintln(\"Iron-56: A = $(mass_number(fe56))\")","category":"page"},{"location":"manual/construction/#String-Format-Rules","page":"Construction","title":"String Format Rules","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"Basic Elements\nJust the symbol: \"Fe\", \"He\", \"U\"\nCase sensitive: \"Fe\" works, \"FE\" doesn't\nIons\nAppend charge: \"Fe3+\", \"Fe2-\"\nFormat: SYMBOL + NUMBER + +/-\nExamples: \"Fe3+\", \"Cl-\", \"Ca2+\"\nIsotopes\nFormat: SYMBOL + - + MASS_NUMBER\nExamples: \"Fe-56\", \"U-235\", \"C-14\"\nCombined Isotopes and Ions\nFormat: SYMBOL + - + MASS_NUMBER + NUMBER + +/-\nExamples: \"Fe-56_3+\", \"U-235_2+\"","category":"page"},{"location":"manual/construction/#Common-Particle-Aliases","page":"Construction","title":"Common Particle Aliases","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"Many common particles have predefined aliases:","category":"page"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"using ChargedParticles\n\n# Elementary particles\ne = Particle(\"electron\") # or \"e-\"\np = Particle(\"proton\") # or \"p+\"\nn = Particle(\"neutron\") # or \"n\"\n\n# Special particles\nα = Particle(\"alpha\") # He²⁺\nd = Particle(\"deuteron\") # D⁺\nt = Particle(\"triton\") # T⁺\n\nprintln(\"Electron charge: $(charge(e))\")\nprintln(\"Alpha particle: Z = $(atomic_number(α)), A = $(mass_number(α))\")\nprintln(\"Deuteron mass number: $(mass_number(d))\")","category":"page"},{"location":"manual/construction/#Atomic-Number-Constructor","page":"Construction","title":"Atomic Number Constructor","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"You can also create particles using their atomic numbers:","category":"page"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"using ChargedParticles\n\n# Basic construction\nfe = Particle(26) # Iron\nu = Particle(92) # Uranium\n\n# With mass number and charge\nfe56_3plus = Particle(26, mass_numb=56, Z=3) # Fe-56³⁺\nu235_2plus = Particle(92, mass_numb=235, Z=2) # U-235²⁺\n\nprintln(\"Iron: Z = $(atomic_number(fe))\")\nprintln(\"U-235²⁺: Z = $(atomic_number(u235_2plus)), A = $(mass_number(u235_2plus))\")","category":"page"},{"location":"manual/construction/#Convenience-Constructors","page":"Construction","title":"Convenience Constructors","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"The most common particles have dedicated constructors:","category":"page"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"using ChargedParticles\n\n# Using convenience constructors\ne = electron()\np = proton()\n\nprintln(\"Electron mass: $(mass(e))\")\nprintln(\"Proton charge: $(charge(p))\")","category":"page"},{"location":"manual/construction/#Error-Handling","page":"Construction","title":"Error Handling","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"The constructors include error checking:","category":"page"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"using ChargedParticles\n\n# These will throw errors\ntry\n invalid = Particle(\"XX\") # Invalid element symbol\ncatch e\n println(\"Error: \", e)\nend\n\ntry\n invalid = Particle(-1) # Invalid atomic number\ncatch e\n println(\"Error: \", e)\nend","category":"page"},{"location":"#ChargedParticles.jl","page":"Home","title":"ChargedParticles.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"(Image: Build Status) (Image: Documentation) ","category":"page"},{"location":"","page":"Home","title":"Home","text":"A Julia package for representing charged particles inspired by PlasmaPy's particles subpackage.","category":"page"},{"location":"#Overview","page":"Home","title":"Overview","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"ChargedParticles.jl provides a flexible type system for working with various particles including elementary particles, ions, and isotopes. It supports multiple string formats and construction methods, making it easy to work with common particles in plasma physics.","category":"page"},{"location":"#Features","page":"Home","title":"Features","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Support for elementary particles, ions, and isotopes\nFlexible string-based particle construction\nPhysical properties (mass, charge, etc.)\nCommon particle aliases\nUnit support via Unitful.jl","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"using Pkg\nPkg.add(url=\"https://github.com/Beforerr/ChargedParticles.jl\")","category":"page"},{"location":"#Quick-Example","page":"Home","title":"Quick Example","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"using ChargedParticles\n\n# Create common particles\ne = electron() # electron\np = proton() # proton\nα = Particle(\"alpha\") # alpha particle\n\n# Create ions and isotopes\nfe3 = Particle(\"Fe3+\") # Iron(III) ion\nfe56 = Particle(\"Fe-56\") # Iron-56\nd = Particle(\"D+\") # Deuteron\n\n# Access properties\nprintln(\"Electron mass: \", mass(e))\nprintln(\"Alpha particle charge: \", charge(α))\nprintln(\"Iron charge: \", charge(fe3))\nprintln(\"Iron-56 mass number: \", mass_number(fe56))\nprintln(\"Deuteron mass: \", mass(d))","category":"page"},{"location":"#Related-Packages","page":"Home","title":"Related Packages","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"PlasmaPy: A Python package for plasma physics.\nMendeleev.jl: A Julia package for accessing periodic table data.\nCorpuscles.jl: A Julia package for for particle physics.","category":"page"},{"location":"#Manual-Outline","page":"Home","title":"Manual Outline","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Pages = [\n \"manual/getting-started.md\",\n \"manual/particle-types.md\",\n \"manual/construction.md\"\n]\nDepth = 2","category":"page"}] +[{"location":"api/#API-Reference","page":"API Reference","title":"API Reference","text":"","category":"section"},{"location":"api/#Types","page":"API Reference","title":"Types","text":"","category":"section"},{"location":"api/","page":"API Reference","title":"API Reference","text":"Modules = [ChargedParticles]\nPrivate = false\nOrder = [:type]","category":"page"},{"location":"api/#ChargedParticles.AbstractParticle","page":"API Reference","title":"ChargedParticles.AbstractParticle","text":"AbstractParticle\n\nAbstract type representing any particle in plasma physics.\n\nSee also: ChargedParticleImpl\n\n\n\n\n\n","category":"type"},{"location":"api/#ChargedParticles.ChargedParticleImpl","page":"API Reference","title":"ChargedParticles.ChargedParticleImpl","text":"ChargedParticleImpl <: AbstractParticle\n\nImplementation type for charged particles.\n\nFields\n\nsymbol::Symbol: Chemical symbol or particle identifier (e.g., :Fe, :e, :μ)\ncharge_number::Int: Number of elementary charges (can be negative)\nmass_number::Int: Total number of nucleons (protons + neutrons)\nmass::Unitful.Mass: Mass of the particle in appropriate units\n\nNotes\n\nMass number : For elementary particles like electrons and muons, mass_number is 0\nCharge number : electrical charge in units of the elementary charge, usually denoted as z. https://en.wikipedia.org/wiki/Charge_number\n\n\n\n\n\n","category":"type"},{"location":"api/#Constructors","page":"API Reference","title":"Constructors","text":"","category":"section"},{"location":"api/","page":"API Reference","title":"API Reference","text":"Particle\nproton\nelectron","category":"page"},{"location":"api/#ChargedParticles.Particle","page":"API Reference","title":"ChargedParticles.Particle","text":"Particle(str::AbstractString; mass_numb=nothing, Z=nothing)\n\nCreate a particle from a string representation.\n\nArguments\n\nstr::AbstractString: String representation of the particle\n\nString Format Support\n\nElement symbols: \"Fe\", \"He\"\nIsotopes: \"Fe-56\", \"D\"\nIons: \"Fe2+\", \"H-\"\nCommon aliases: \"electron\", \"proton\", \"alpha\", \"mu-\"\n\nExamples\n\n# Elementary particles\nelectron = Particle(\"e-\")\nmuon = Particle(\"mu-\")\npositron = Particle(\"e+\")\n\n# Ions and isotopes\nproton = Particle(\"H+\")\nalpha = Particle(\"He2+\")\ndeuteron = Particle(\"D+\")\niron56 = Particle(\"Fe-56\")\n\n\n\n\n\nParticle(atomic_number::Int; mass_numb=nothing, Z=0)\n\nCreate a particle from its atomic number with optional mass number and charge state.\n\nArguments\n\natomic_number::Int: The atomic number (number of protons)\nmass_numb=nothing: Optional mass number (total number of nucleons)\nZ=0: Optional charge number (in elementary charge units)\n\nExamples\n\n# Basic construction\niron = Particle(26) # Iron\nu = Particle(92) # Uranium\n\n# With mass number and charge\nfe56_3plus = Particle(26, mass_numb=56, Z=3) # Fe-56³⁺\nhe4_2plus = Particle(2, mass_numb=4, Z=2) # He⁴²⁺ (alpha particle)\n\nSee also: Particle(::AbstractString)\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.proton","page":"API Reference","title":"ChargedParticles.proton","text":"Create a proton\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.electron","page":"API Reference","title":"ChargedParticles.electron","text":"Create an electron\n\n\n\n\n\n","category":"function"},{"location":"api/#Properties","page":"API Reference","title":"Properties","text":"","category":"section"},{"location":"api/","page":"API Reference","title":"API Reference","text":"mass\ncharge\natomic_number\nmass_number","category":"page"},{"location":"api/#ChargedParticles.mass","page":"API Reference","title":"ChargedParticles.mass","text":"Retrieve the mass of an element isotope.\n\n\n\n\n\nReturn the mass of the particle in atomic mass units\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.charge","page":"API Reference","title":"ChargedParticles.charge","text":"Return the electric charge of the particle in elementary charge units\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.atomic_number","page":"API Reference","title":"ChargedParticles.atomic_number","text":"atomic_number(p::AbstractParticle)\n\nReturn the atomic number (number of protons) of the particle.\n\nExamples\n\n```julia fe = Particle(\"Fe\") println(atomic_number(fe)) # 26\n\ne = electron() println(atomic_number(e)) # 0\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.mass_number","page":"API Reference","title":"ChargedParticles.mass_number","text":"mass_number(p::AbstractParticle)\n\nReturn the mass number (total number of nucleons) of the particle.\n\nExamples\n\nfe56 = Particle(\"Fe-56\")\nprintln(mass_number(fe56)) # 56\n\ne = electron()\nprintln(mass_number(e)) # 0\n\n\n\n\n\n","category":"function"},{"location":"api/#Type-Checking","page":"API Reference","title":"Type Checking","text":"","category":"section"},{"location":"api/","page":"API Reference","title":"API Reference","text":"is_ion\nis_chemical_element\nis_default_isotope\nChargedParticles.is_proton\nChargedParticles.is_electron","category":"page"},{"location":"api/#ChargedParticles.is_ion","page":"API Reference","title":"ChargedParticles.is_ion","text":"is_ion(p::AbstractParticle)\n\nCheck if the particle is an ion (has non-zero charge and is not an elementary particle).\n\nExamples\n\njulia> is_ion(Particle(\"Fe3+\"))\ntrue\njulia> is_ion(Particle(\"Fe\"))\nfalse\njulia> is_ion(electron())\nfalse\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.is_chemical_element","page":"API Reference","title":"ChargedParticles.is_chemical_element","text":"is_chemical_element(p::AbstractParticle)\n\nCheck if the particle is a chemical element.\n\nExamples\n\njulia> is_chemical_element(Particle(\"Fe\"))\ntrue\njulia> is_chemical_element(electron())\nfalse\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.is_default_isotope","page":"API Reference","title":"ChargedParticles.is_default_isotope","text":"is_default_isotope(p::AbstractParticle)\n\nCheck if the particle is the default isotope of its element.\n\nExamples\n\njulia> is_default_isotope(Particle(\"Fe-56\"))\ntrue\njulia> is_default_isotope(Particle(\"Fe-57\"))\nfalse\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.is_proton","page":"API Reference","title":"ChargedParticles.is_proton","text":"is_proton(p::AbstractParticle)\n\nCheck if the particle is a proton (has symbol 'H', charge +1, and mass number 1).\n\nExamples\n\njulia> ChargedParticles.is_proton(proton())\ntrue\njulia> ChargedParticles.is_proton(electron())\nfalse\n\n\n\n\n\n","category":"function"},{"location":"api/#ChargedParticles.is_electron","page":"API Reference","title":"ChargedParticles.is_electron","text":"is_electron(p::AbstractParticle)\n\nCheck if the particle is an electron (has symbol 'e', charge -1, and electron mass).\n\nExamples\n\njulia> ChargedParticles.is_electron(electron())\ntrue\njulia> ChargedParticles.is_electron(proton())\nfalse\n\n\n\n\n\n","category":"function"},{"location":"api/#Constants","page":"API Reference","title":"Constants","text":"","category":"section"},{"location":"api/","page":"API Reference","title":"API Reference","text":"ChargedParticles.PARTICLE_ALIASES","category":"page"},{"location":"api/#ChargedParticles.PARTICLE_ALIASES","page":"API Reference","title":"ChargedParticles.PARTICLE_ALIASES","text":"PARTICLE_ALIASES\n\nDictionary of common particle aliases and their corresponding (symbol, charge, mass_number) tuples.\n\nEach entry maps a string alias to a tuple of (symbol, charge, mass_number)\n\n\n\n\n\n","category":"constant"},{"location":"manual/getting-started/#Getting-Started","page":"Getting Started","title":"Getting Started","text":"","category":"section"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"using ChargedParticles","category":"page"},{"location":"manual/getting-started/#Basic-Usage","page":"Getting Started","title":"Basic Usage","text":"","category":"section"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"First, import the package:","category":"page"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"using ChargedParticles","category":"page"},{"location":"manual/getting-started/#Creating-Particles","page":"Getting Started","title":"Creating Particles","text":"","category":"section"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"There are several ways to create particles:","category":"page"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"using ChargedParticles\n# Using string format\ne = Particle(\"e-\")\np = Particle(\"H+\")\nalpha = Particle(\"He2+\")\n\n# Using convenience constructors\ne = electron()\np = proton()\n\n# Using atomic numbers\niron = Particle(26) # Fe\nhelium = Particle(2, mass_numb=4, Z=2) # He⁴²⁺","category":"page"},{"location":"manual/getting-started/#Accessing-Properties","page":"Getting Started","title":"Accessing Properties","text":"","category":"section"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"Each particle has several physical properties that can be accessed:","category":"page"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"using ChargedParticles\n\np = proton()\n\n# Get mass\nm = mass(p)\n\n# Get charge\nq = charge(p)\n\n# Get atomic and mass numbers\nz = atomic_number(p)\na = mass_number(p)\n\nprintln(\"Proton properties:\")\nprintln(\"Mass: \", m)\nprintln(\"Charge: \", q)\nprintln(\"Atomic number: \", z)\nprintln(\"Mass number: \", a)","category":"page"},{"location":"manual/getting-started/#Working-with-Ions","page":"Getting Started","title":"Working with Ions","text":"","category":"section"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"Creating and working with ions is straightforward:","category":"page"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"using ChargedParticles\n\n# Create some ions\nfe3 = Particle(\"Fe3+\") # Iron(III)\nhydride = Particle(\"H-\") # Hydride ion\n\n# Check if particles are ions\nprintln(\"Is Fe3+ an ion? \", is_ion(fe3))\nprintln(\"Is H- an ion? \", is_ion(hydride))\nprintln(\"Is electron an ion? \", is_ion(electron()))","category":"page"},{"location":"manual/getting-started/#Working-with-Isotopes","page":"Getting Started","title":"Working with Isotopes","text":"","category":"section"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"You can create and work with isotopes using mass numbers:","category":"page"},{"location":"manual/getting-started/","page":"Getting Started","title":"Getting Started","text":"using ChargedParticles\n\n# Create isotopes\nfe56 = Particle(\"Fe-56\")\ndeuteron = Particle(\"D+\")\ntritium = Particle(\"T\")\n\nprintln(\"Fe-56 mass number: \", mass_number(fe56))\nprintln(\"Deuteron mass number: \", mass_number(deuteron))\nprintln(\"Tritium mass number: \", mass_number(tritium))","category":"page"},{"location":"manual/particle-types/#Particle-Types","page":"Particle Types","title":"Particle Types","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"ChargedParticles.jl provides a flexible type system for representing various types of particles commonly encountered in plasma physics.","category":"page"},{"location":"manual/particle-types/#Type-Hierarchy","page":"Particle Types","title":"Type Hierarchy","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"
\nAbstractParticle\n└── ChargedParticleImpl\n
","category":"page"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"The package uses a simple two-level type hierarchy:","category":"page"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"AbstractParticle: Base abstract type for all particles\nChargedParticleImpl: Concrete implementation storing particle properties","category":"page"},{"location":"manual/particle-types/#Particle-Properties","page":"Particle Types","title":"Particle Properties","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"Each particle has four fundamental properties:","category":"page"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"Symbol (symbol::Symbol): Chemical symbol or particle identifier\nRegular elements: :Fe, :He, etc.\nElementary particles: :e (electron), :μ (muon)\nSpecial particles: :n (neutron)\nCharge Number (charge_number::Int): Number of elementary charges\nPositive for cations: +1, +2, etc.\nNegative for anions: -1, -2, etc.\nZero for neutral atoms/particles\nMass Number (mass_number::Int): Total number of nucleons\nFor isotopes: sum of protons and neutrons\nFor elementary particles: 0\nFor regular elements: most abundant isotope\nMass (mass::Unitful.Mass): Particle mass\nUses appropriate units from Unitful.jl\nElementary particles: electron mass units (me)\nAtoms and ions: atomic mass units (u)","category":"page"},{"location":"manual/particle-types/#Supported-Particle-Categories","page":"Particle Types","title":"Supported Particle Categories","text":"","category":"section"},{"location":"manual/particle-types/#Elementary-Particles","page":"Particle Types","title":"Elementary Particles","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"using ChargedParticles\n\n# Electron\ne = electron()\nprintln(\"Electron: charge = $(charge(e)), mass = $(mass(e))\")\n\n# Muon\nμ = Particle(\"mu-\")\nprintln(\"Muon: charge = $(charge(μ)), mass = $(mass(μ))\")","category":"page"},{"location":"manual/particle-types/#Atoms-and-Ions","page":"Particle Types","title":"Atoms and Ions","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"using ChargedParticles\n\n# Neutral atom\nfe = Particle(\"Fe\")\nprintln(\"Iron: Z = $(atomic_number(fe)), A = $(mass_number(fe))\")\n\n# Positive ion\nfe3 = Particle(\"Fe3+\")\nprintln(\"Iron(III): charge = $(charge(fe3))\")\n\n# Negative ion\nh_minus = Particle(\"H-\")\nprintln(\"Hydride: charge = $(charge(h_minus))\")","category":"page"},{"location":"manual/particle-types/#Isotopes","page":"Particle Types","title":"Isotopes","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"using ChargedParticles\n\n# Neutral isotope\nfe56 = Particle(\"Fe-56\")\nprintln(\"Fe-56: A = $(mass_number(fe56))\")\n\n# Charged isotope\nhe4_2plus = Particle(\"He2+\", mass_numb=4)\nprintln(\"He-4(2+): Z = $(atomic_number(he4_2plus)), A = $(mass_number(he4_2plus))\")","category":"page"},{"location":"manual/particle-types/#Special-Particles","page":"Particle Types","title":"Special Particles","text":"","category":"section"},{"location":"manual/particle-types/","page":"Particle Types","title":"Particle Types","text":"using ChargedParticles\n\n# Alpha particle\nα = Particle(\"alpha\")\nprintln(\"Alpha: Z = $(atomic_number(α)), A = $(mass_number(α))\")\n\n# Deuteron\nd = Particle(\"D+\")\nprintln(\"Deuteron: A = $(mass_number(d))\")\n\n# Triton\nt = Particle(\"T+\")\nprintln(\"Triton: A = $(mass_number(t))\")","category":"page"},{"location":"manual/construction/#Particle-Construction","page":"Construction","title":"Particle Construction","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"ChargedParticles.jl provides multiple ways to construct particles, offering flexibility for different use cases.","category":"page"},{"location":"manual/construction/#String-Format","page":"Construction","title":"String Format","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"The most common way to create particles is using string format:","category":"page"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"using ChargedParticles\n\n# Basic elements\nfe = Particle(\"Fe\") # Iron\nhe = Particle(\"He\") # Helium\n\n# Ions with charge\nfe3 = Particle(\"Fe3+\") # Iron(III)\nfe2 = Particle(\"Fe2-\") # Iron(-II)\n\n# Isotopes\nfe56 = Particle(\"Fe-56\") # Iron-56\nu235 = Particle(\"U-235\") # Uranium-235\n\nprintln(\"Iron: Z = $(atomic_number(fe))\")\nprintln(\"Iron(III): charge = $(charge(fe3))\")\nprintln(\"Iron-56: A = $(mass_number(fe56))\")","category":"page"},{"location":"manual/construction/#String-Format-Rules","page":"Construction","title":"String Format Rules","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"Basic Elements\nJust the symbol: \"Fe\", \"He\", \"U\"\nCase sensitive: \"Fe\" works, \"FE\" doesn't\nIons\nAppend charge: \"Fe3+\", \"Fe2-\"\nFormat: SYMBOL + NUMBER + +/-\nExamples: \"Fe3+\", \"Cl-\", \"Ca2+\"\nIsotopes\nFormat: SYMBOL + - + MASS_NUMBER\nExamples: \"Fe-56\", \"U-235\", \"C-14\"\nCombined Isotopes and Ions\nFormat: SYMBOL + - + MASS_NUMBER + NUMBER + +/-\nExamples: \"Fe-56_3+\", \"U-235_2+\"","category":"page"},{"location":"manual/construction/#Common-Particle-Aliases","page":"Construction","title":"Common Particle Aliases","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"Many common particles have predefined aliases:","category":"page"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"using ChargedParticles\n\n# Elementary particles\ne = Particle(\"electron\") # or \"e-\"\np = Particle(\"proton\") # or \"p+\"\nn = Particle(\"neutron\") # or \"n\"\n\n# Special particles\nα = Particle(\"alpha\") # He²⁺\nd = Particle(\"deuteron\") # D⁺\nt = Particle(\"triton\") # T⁺\n\nprintln(\"Electron charge: $(charge(e))\")\nprintln(\"Alpha particle: Z = $(atomic_number(α)), A = $(mass_number(α))\")\nprintln(\"Deuteron mass number: $(mass_number(d))\")","category":"page"},{"location":"manual/construction/#Atomic-Number-Constructor","page":"Construction","title":"Atomic Number Constructor","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"You can also create particles using their atomic numbers:","category":"page"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"using ChargedParticles\n\n# Basic construction\nfe = Particle(26) # Iron\nu = Particle(92) # Uranium\n\n# With mass number and charge\nfe56_3plus = Particle(26, mass_numb=56, Z=3) # Fe-56³⁺\nu235_2plus = Particle(92, mass_numb=235, Z=2) # U-235²⁺\n\nprintln(\"Iron: Z = $(atomic_number(fe))\")\nprintln(\"U-235²⁺: Z = $(atomic_number(u235_2plus)), A = $(mass_number(u235_2plus))\")","category":"page"},{"location":"manual/construction/#Convenience-Constructors","page":"Construction","title":"Convenience Constructors","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"The most common particles have dedicated constructors:","category":"page"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"using ChargedParticles\n\n# Using convenience constructors\ne = electron()\np = proton()\n\nprintln(\"Electron mass: $(mass(e))\")\nprintln(\"Proton charge: $(charge(p))\")","category":"page"},{"location":"manual/construction/#Error-Handling","page":"Construction","title":"Error Handling","text":"","category":"section"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"The constructors include error checking:","category":"page"},{"location":"manual/construction/","page":"Construction","title":"Construction","text":"using ChargedParticles\n\n# These will throw errors\ntry\n invalid = Particle(\"XX\") # Invalid element symbol\ncatch e\n println(\"Error: \", e)\nend\n\ntry\n invalid = Particle(-1) # Invalid atomic number\ncatch e\n println(\"Error: \", e)\nend","category":"page"},{"location":"#ChargedParticles.jl","page":"Home","title":"ChargedParticles.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"(Image: Build Status) (Image: Documentation) ","category":"page"},{"location":"","page":"Home","title":"Home","text":"A Julia package for representing charged particles inspired by PlasmaPy's particles subpackage.","category":"page"},{"location":"#Overview","page":"Home","title":"Overview","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"ChargedParticles.jl provides a flexible type system for working with various particles including elementary particles, ions, and isotopes. It supports multiple string formats and construction methods, making it easy to work with common particles in plasma physics.","category":"page"},{"location":"#Features","page":"Home","title":"Features","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Support for elementary particles, ions, and isotopes\nFlexible string-based particle construction\nPhysical properties (mass, charge, etc.)\nCommon particle aliases\nUnit support via Unitful.jl","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"using Pkg\nPkg.add(url=\"https://github.com/Beforerr/ChargedParticles.jl\")","category":"page"},{"location":"#Quick-Example","page":"Home","title":"Quick Example","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"using ChargedParticles\n\n# Create common particles\ne = electron() # electron\np = proton() # proton\nα = Particle(\"alpha\") # alpha particle\n\n# Create ions and isotopes\nfe3 = Particle(\"Fe3+\") # Iron(III) ion\nfe56 = Particle(\"Fe-56\") # Iron-56\nd = Particle(\"D+\") # Deuteron\n\n# Access properties\nprintln(\"Electron mass: \", mass(e))\nprintln(\"Alpha particle charge: \", charge(α))\nprintln(\"Iron charge: \", charge(fe3))\nprintln(\"Iron-56 mass number: \", mass_number(fe56))\nprintln(\"Deuteron mass: \", mass(d))","category":"page"},{"location":"#Related-Packages","page":"Home","title":"Related Packages","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"PlasmaPy: A Python package for plasma physics.\nMendeleev.jl: A Julia package for accessing periodic table data.\nCorpuscles.jl: A Julia package for for particle physics.","category":"page"},{"location":"#Manual-Outline","page":"Home","title":"Manual Outline","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Pages = [\n \"manual/getting-started.md\",\n \"manual/particle-types.md\",\n \"manual/construction.md\"\n]\nDepth = 2","category":"page"}] }