written by copilot because I was too lazy
This script provides a simulation of nuclear decay processes for various isotopes, primarily focusing on elements from Mercury (Z=80) to Einsteinium (Z=99).
The script uses an array of atom objects with the following properties:
atomName: String - Official name of the elementpCount: Number - Number of protons (atomic number)atomIsotopes: Array of objects containing:nucleodeCount: Number - Total nucleons (protons + neutrons)decayType: Array - Possible decay typesnatural: Boolean - Whether isotope occurs naturally
a(Alpha decay): Loss of He-4 nucleus (p -= 2, n -= 4)b-(Beta minus): Neutron → proton conversion (p += 1, n -= 1)b+(Beta plus): Proton → neutron conversion (p -= 1, n += 1)e(Electron capture): Similar to b+, with gamma emission
Simulates a decay reaction for a given isotope and decay type.
- Returns: String (success or failure message)
Verifies if a specific decay type is possible for an isotope.
- Returns: Boolean
Validates existence of an isotope in the database.
- Returns: Boolean
// Simulate beta minus decay of Thorium-233 and generates logs for it
decayReaction(90, 233, "b-", true)
// Check if an isotope exists
isotopeCheck(92, 235) // true for U-235
// Get isotope name
isotopeName(92, 235) // "uranium-235"