An interactive web-based simulation of radioactive decay using Monte Carlo methods and D3.js visualization.
- Interactive Interface: User-friendly controls for selecting isotopes and particle counts
- Monte Carlo Simulation: Realistic particle decay simulation using random probability
- Theoretical Comparison: Compare simulation results with theoretical exponential decay
- Beautiful Visualizations: Dynamic charts using D3.js with responsive design
- Comprehensive Isotope Database: Over 1000+ isotopes with accurate half-life data
- Educational: Perfect for learning about radioactive decay and nuclear physics
Visit the live application: Particle Decay Simulator
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Visualization: D3.js v7
- Styling: Modern CSS with Flexbox and Grid
- Data: JSON format with comprehensive isotope database
- Deployment: GitHub Pages
particledecay/
├── index.html # Main HTML file
├── style.css # CSS styles and responsive design
├── script.js # Main application logic
├── data.json # Isotope database
└── README.md # Project documentation
- Isotope Selection: Choose from a comprehensive database of radioactive isotopes
- Particle Count: Set the initial number of particles (100-10,000)
- Monte Carlo Simulation: Each particle has a probability of decaying based on the isotope's half-life
- Visualization: Real-time plotting of both simulation and theoretical decay curves
- Results Analysis: Compare simulation results with theoretical predictions
The simulation implements the fundamental equation of radioactive decay:
N(t) = N₀ × e^(-λt)
Where:
- N(t) = number of particles at time t
- N₀ = initial number of particles
- λ = decay constant (λ = ln(2)/T₁/₂)
- T₁/₂ = half-life of the isotope
The Monte Carlo simulation uses the probability of decay per time step: P(decay) = 1 - e^(-λΔt)
- A modern web browser (Chrome, Firefox, Safari, Edge)
- No additional software installation required
-
Clone the repository:
git clone https://github.com/yourusername/particledecay.git cd particledecay -
Open
index.htmlin your web browser or use a local server:# Using Python 3 python -m http.server 8000 # Using Node.js (if you have http-server installed) npx http-server
-
Navigate to
http://localhost:8000in your browser
- Push your code to a GitHub repository
- Go to repository Settings → Pages
- Select "Deploy from a branch" and choose
mainbranch - Your site will be available at
https://yourusername.github.io/repository-name
Edit data.json to add new isotopes in the format:
{
"name": "isotope-name",
"halfLife": halfLifeValue,
"timeScale": timeScaleExponent
}Modify style.css to customize the appearance:
- Color scheme in CSS variables
- Layout adjustments
- Responsive breakpoints
Extend script.js to add new features:
- Multiple isotope comparison
- Different decay modes
- Export functionality
- Advanced statistics
The isotope database includes:
- Half-life values from nuclear physics databases
- Time scales ranging from nanoseconds to billions of years
- Common isotopes used in research and medicine
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- D3.js community for the excellent visualization library
- Nuclear physics researchers for the isotope data
- Educational physics community for inspiration
If you have any questions or suggestions, please open an issue on GitHub or contact the maintainers.
Made with ❤️ for physics education