pub struct Nuclide { /* private fields */ }
Expand description
Efficient representation of nuclide
Implementations§
source§impl Nuclide
impl Nuclide
sourcepub fn new(input: &str) -> Option<Nuclide>
pub fn new(input: &str) -> Option<Nuclide>
Initializes a new Nuclide from a string representation. Currently the input must be of the form {Symbol}-{Nucleon count}
use ::Nuclide::Nuclide;
use ::Nuclide::Atom;
let u235 = Nuclide::new("U-235").unwrap();
assert_eq!(u235.to_string(),"U-235");
Examples found in repository?
More examples
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
fn main(){
let protium = Nuclide::new("H-1").unwrap();
let deuterium = Nuclide::new("H-2").unwrap();
let tritium = Nuclide::new("H-3").unwrap();
let oxy = Nuclide::new("O-16").unwrap();
let h_oxy = Nuclide::new("O-18").unwrap();
let potable = Water::new(oxy, protium, protium);
let hdo = Water::new(oxy, deuterium, protium);
let heavy_water = Water::new(oxy, deuterium, deuterium);
let tritiated_water = Water::new(oxy, tritium, tritium);
let super_heavy_water = Water::new(h_oxy, deuterium, deuterium);
println!("Some masses of different types of \"water\" \n ");
println!("Regular water H2O : {} daltons", potable.mass());
println!("Semi-heavy water HDO : {} daltons", hdo.mass());
println!("heavy water D2O : {} daltons", heavy_water.mass());
println!("Tritiated water T2O : {} daltons", tritiated_water.mass());
println!("Super heavy water D2O-18 : {} daltons", super_heavy_water.mass());
}
sourcepub fn from_nucleons_unchecked(z: usize, n: usize) -> Self
pub fn from_nucleons_unchecked(z: usize, n: usize) -> Self
In : proton, neutron Out: Nuclide
sourcepub fn from_nucleons(z: usize, n: usize) -> Option<Self>
pub fn from_nucleons(z: usize, n: usize) -> Option<Self>
sourcepub fn assign(idx: usize) -> Self
pub fn assign(idx: usize) -> Self
Construct a nuclide from the unique index. Avoid direct use as no checks are performed to ensure that it is valid
sourcepub fn create(z: usize, n: usize) -> (f64, f64)
pub fn create(z: usize, n: usize) -> (f64, f64)
Returns the approximate mass and binding energy of a nuclide, theorectical or real, using the Bethe-Weizacker liquid-drop approximation.
sourcepub fn nuclide_index(&self) -> usize
pub fn nuclide_index(&self) -> usize
Returns the underlying unique value. Can be used in conjunction with “assign” and “change” to rapidly create or convert nuclides without decay
sourcepub fn element_name(&self) -> String
pub fn element_name(&self) -> String
Returns the element name.
sourcepub fn proton_neutron(&self) -> (usize, usize)
pub fn proton_neutron(&self) -> (usize, usize)
Returns the proton and neutron count
sourcepub fn neutron_separation(&self) -> f64
pub fn neutron_separation(&self) -> f64
Approximate neutron separation energy
sourcepub fn proton_separation(&self) -> f64
pub fn proton_separation(&self) -> f64
Approximate proton separation energy
sourcepub fn isotope_list(&self) -> Vec<Self>
pub fn isotope_list(&self) -> Vec<Self>
returns a vector of all isotopes of the element
sourcepub fn mirror(&self) -> Option<Self>
pub fn mirror(&self) -> Option<Self>
Returns the nuclide (if it exists) that has swapped proton-neutron count
sourcepub fn list() -> Vec<Self>
pub fn list() -> Vec<Self>
Produces a vector of all nuclides sorted by atomic number, e.g all hydrogen isotopes, all helium isotopes, …
sourcepub fn isobar_list(&self) -> Vec<Self>
pub fn isobar_list(&self) -> Vec<Self>
Produces a list of all nuclides that share the same atomic number as the selected nuclide
sourcepub fn isotone_list(&self) -> Vec<Self>
pub fn isotone_list(&self) -> Vec<Self>
Produces a list of nuclides that share the same number of neutrons
sourcepub fn branching_ratio<T: DecayMode>(&self) -> f64
pub fn branching_ratio<T: DecayMode>(&self) -> f64
sourcepub fn daughter_theoretical<T: DecayMode>(&self) -> Option<Self>
pub fn daughter_theoretical<T: DecayMode>(&self) -> Option<Self>
Returns the daughter nuclide, regardless of whether it has been observed
None
If the decay result is not a known nuclide, returns None
pub fn decay_probability<T: DecayMode>(&self, time: f64) -> f64
Trait Implementations§
source§impl Atom for Nuclide
impl Atom for Nuclide
source§fn mass_deficit_ev(&self) -> f64
fn mass_deficit_ev(&self) -> f64
Mass deficit as MeV
source§fn binding_energy(&self) -> f64
fn binding_energy(&self) -> f64
Returns the binding energy. Utilizing the mass model
source§fn spin_parity(&self) -> (i8, i8)
fn spin_parity(&self) -> (i8, i8)
Returns the isospin and parity in the form of a i8 pair, one of which is negatively signed for - parity
source§fn electron_affinity(&self) -> f64
fn electron_affinity(&self) -> f64
Returns electron affinity
source§fn ionization_energies(&self, level: usize) -> Option<f64>
fn ionization_energies(&self, level: usize) -> Option<f64>
Returns the ionization energies for all known levels. Values are in kj/mol.
source§fn electronegativity(&self) -> f64
fn electronegativity(&self) -> f64
Returns the thermochemical electronegativity as calculated by Oganov and Tantardini. Currently the best predictor of experimental values
source§fn mullikan_en(&self) -> f64
fn mullikan_en(&self) -> f64
Returns the Mullikan, or absolute, electronegativity in kj/mol
source§fn pauling_en(&self) -> f64
fn pauling_en(&self) -> f64
Pauling Electronegativity. A poor fit for experimental values, however it is here for completeness
source§fn covalent_radii(&self, bond: usize) -> Option<f64>
fn covalent_radii(&self, bond: usize) -> Option<f64>
Radius in Single-double-and-triple covalent bonds
source§fn ionic_radii(&self) -> f64
fn ionic_radii(&self) -> f64
ionic radii
source§fn vdr_crystal(&self) -> f64
fn vdr_crystal(&self) -> f64
Returns the Van Der Waal radius in crystalline structures. Values are in meters.
source§fn vdr_isolated(&self) -> f64
fn vdr_isolated(&self) -> f64
Returns the Van Der Waal radius of isolated atoms
source§fn decay_constant<T: DecayMode>(&self) -> f64
fn decay_constant<T: DecayMode>(&self) -> f64
Approximation of decay constant
source§fn decay_time<T: DecayMode>(&self, time: f64) -> bool
fn decay_time<T: DecayMode>(&self, time: f64) -> bool
Returns true if the nuclide would have decayed in the time given. The nuclide remains unchanged
source§fn decay_mode(&self) -> String
fn decay_mode(&self) -> String
Returns the probable decay modes as a string
source§fn decay_q<T: DecayMode>(&self) -> f64
fn decay_q<T: DecayMode>(&self) -> f64
Q-value (total energy) of a nuclear decay, regardless of whether it is observed
NAN
Returns NAN if this decay mode results in a nonexistent nuclide
source§fn decay<T: DecayMode>(&mut self, time: f64) -> (f64, Vec<Particle>)
fn decay<T: DecayMode>(&mut self, time: f64) -> (f64, Vec<Particle>)
Returns the name and isotope number of the nuclide
use ::Nuclide::{Atom,Nuclide};
use ::Nuclide::decay::TotalDecay;
let mut uranium = Nuclide::new("U-238").unwrap();
// total particle energy of the nuclide and vector of decay particles
let (particle_energy,particle_vector) = uranium.decay::<TotalDecay>(5E+20);
// final nuclide in the U-238 decay series
assert_eq!(uranium.to_string(), "Pb-206");