Expand description
§use-nuclear
Small nuclear physics helpers for RustUse.
§Install
[dependencies]
use-nuclear = "0.0.1"§Foundation
use-nuclear provides small scalar helpers for radioactive decay, activity, mass defect,
binding energy, and simple nuclide number relationships.
Inputs are numeric SI-style values unless a function name explicitly refers to MeV or atomic
mass units. The crate stays dependency-free and does not define a full unit system.
§Example
use use_nuclear::{
activity, binding_energy_mev_from_mass_defect_u, DecayLaw, NuclideNumbers,
ATOMIC_MASS_UNIT_MEV_C2,
};
let decay_law = DecayLaw::from_half_life(10.0).ok_or("expected valid half-life")?;
let remaining = decay_law
.remaining_quantity(100.0, 10.0)
.ok_or("expected valid remaining quantity")?;
let helium = NuclideNumbers::new(4, 2).ok_or("expected valid nuclide numbers")?;
assert!((remaining - 50.0).abs() < 1.0e-12);
assert_eq!(activity(2.0, 10.0), Some(20.0));
assert_eq!(helium.neutron_count(), 2);
assert_eq!(
binding_energy_mev_from_mass_defect_u(1.0),
Some(ATOMIC_MASS_UNIT_MEV_C2),
);§When to use directly
Choose use-nuclear when you need reusable scalar formulas for decay, activity, or nuclear
energy relationships without pulling in a larger chemistry or units model.
§Scope
- Small scalar helpers for radioactive decay, activity, mass-energy equivalence, and simple nuclide-number relationships.
- General constants belong in the top-level
use-constantsset. - Unit abstractions belong in the top-level
use-unitsset. - Element symbols, atomic masses, and periodic-table concepts belong in
use-chemistry. - Isotope databases, reactor simulation, radiation transport, dosimetry, and radiation safety tooling are out of scope.
§Status
use-nuclear is a pre-1.0 crate with a deliberately small API.
Small nuclear physics helpers.
Modules§
Structs§
- Decay
Law - Simple exponential-decay law parameterized by a decay constant.
- Nuclide
Numbers - Mass and atomic numbers for a nuclide.
Constants§
- ATOMIC_
MASS_ UNIT_ MEV_ C2 - Atomic mass unit energy equivalent in mega-electron-volts per
c^2. - JOULES_
PER_ MEV - Joules in one mega-electron-volt.
- LN_2
- Natural logarithm of
2for half-life conversions and decay-law helpers. - SPEED_
OF_ LIGHT - Speed of light in vacuum in meters per second.
Functions§
- activity
- Computes activity from a decay constant and number of nuclei.
- binding_
energy_ mev_ from_ mass_ defect_ u - Computes binding energy in mega-electron-volts from a mass defect in atomic mass units.
- binding_
energy_ per_ nucleon - Computes binding energy per nucleon.
- decay_
constant_ from_ half_ life - Computes a decay constant from a half-life.
- decayed_
fraction_ from_ decay_ constant - Computes the decayed fraction from a decay constant and elapsed time.
- decayed_
quantity_ from_ decay_ constant - Computes the decayed quantity from an initial quantity, decay constant, and elapsed time.
- elapsed_
time_ from_ remaining_ fraction - Computes elapsed time from a remaining fraction and decay constant.
- energy_
from_ mass_ defect_ kg - Computes energy in joules from a mass defect in kilograms.
- half_
life_ from_ decay_ constant - Computes a half-life from a decay constant.
- is_
valid_ nuclide_ numbers - Validates mass and atomic numbers for a simple nuclide representation.
- joules_
to_ mev - Converts energy in joules to mega-electron-volts.
- mass_
defect_ kg_ from_ energy - Computes mass defect in kilograms from energy in joules.
- mean_
lifetime - Computes the mean lifetime from a decay constant.
- mev_
to_ joules - Converts energy in mega-electron-volts to joules.
- neutron_
count - Computes neutron count from mass number and atomic number.
- nuclei_
from_ activity - Computes the number of nuclei from activity and decay constant.
- nucleon_
count - Computes nucleon count from proton and neutron counts.
- remaining_
fraction_ from_ decay_ constant - Computes the remaining fraction from a decay constant and elapsed time.
- remaining_
fraction_ from_ half_ life - Computes the remaining fraction from a half-life and elapsed time.
- remaining_
quantity_ from_ decay_ constant - Computes the remaining quantity from an initial quantity, decay constant, and elapsed time.
- remaining_
quantity_ from_ half_ life - Computes the remaining quantity from an initial quantity, half-life, and elapsed time.
- specific_
activity - Computes specific activity from activity and mass.