Skip to content

ArjunSharma06/particledecay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧪 Particle Decay Simulator

An interactive web-based simulation of radioactive decay using Monte Carlo methods and D3.js visualization.

🌟 Features

  • 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

🚀 Live Demo

Visit the live application: Particle Decay Simulator

🛠️ Technology Stack

  • 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

📁 Project Structure

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

🎯 How It Works

  1. Isotope Selection: Choose from a comprehensive database of radioactive isotopes
  2. Particle Count: Set the initial number of particles (100-10,000)
  3. Monte Carlo Simulation: Each particle has a probability of decaying based on the isotope's half-life
  4. Visualization: Real-time plotting of both simulation and theoretical decay curves
  5. Results Analysis: Compare simulation results with theoretical predictions

🔬 Physics Background

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)

🚀 Getting Started

Prerequisites

  • A modern web browser (Chrome, Firefox, Safari, Edge)
  • No additional software installation required

Local Development

  1. Clone the repository:

    git clone https://github.com/yourusername/particledecay.git
    cd particledecay
  2. Open index.html in 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
  3. Navigate to http://localhost:8000 in your browser

GitHub Pages Deployment

  1. Push your code to a GitHub repository
  2. Go to repository Settings → Pages
  3. Select "Deploy from a branch" and choose main branch
  4. Your site will be available at https://yourusername.github.io/repository-name

🎨 Customization

Adding New Isotopes

Edit data.json to add new isotopes in the format:

{
  "name": "isotope-name",
  "halfLife": halfLifeValue,
  "timeScale": timeScaleExponent
}

Styling

Modify style.css to customize the appearance:

  • Color scheme in CSS variables
  • Layout adjustments
  • Responsive breakpoints

Features

Extend script.js to add new features:

  • Multiple isotope comparison
  • Different decay modes
  • Export functionality
  • Advanced statistics

📊 Data Sources

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

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • D3.js community for the excellent visualization library
  • Nuclear physics researchers for the isotope data
  • Educational physics community for inspiration

📞 Support

If you have any questions or suggestions, please open an issue on GitHub or contact the maintainers.


Made with ❤️ for physics education

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors