This project is a high-precision computational tool designed to simulate particle dynamics in accelerators and utilize Machine Learning for beam stability monitoring. Developed as a demonstration of applying Computer Engineering principles to "Big Science" infrastructures.
Modern particle accelerators (like those at CERN, SOLEIL, or MAX IV) produce massive amounts of data and require sub-nanosecond control precision. This project addresses two critical challenges:
- High-Fidelity Simulation: Modeling charged particle trajectories in a magnetic field using advanced numerical integration.
- Autonomous Diagnostics: Using AI to detect beam anomalies, ensuring the safety and efficiency of large-scale scientific facilities.
- Algorithm: 4th Order Runge-Kutta (RK4) Method.
-
Physics: Solves the Lorentz Force Equation:
$F = q(E + v \times B)$ . - Why RK4? Unlike simple Euler integration, RK4 minimizes cumulative error, making the simulation scientifically viable for long-term tracking.
- Generates thousands of simulation scenarios by varying magnetic field intensities (
$B_z$ ). - Creates a structured dataset of beam outcomes for training diagnostic models.
- Model: Isolation Forest (Unsupervised Learning).
- Function: Learns the "stable" beam patterns and flags any deviations (hardware failures, field noise, or beam loss) as anomalies.
- Built with Streamlit and Plotly.
- Allows researchers to adjust magnetic parameters via a UI and see real-time 3D trajectory updates.
- Python 3.8+
- pip (Python package manager)
- Clone the repository:
git clone [https://github.com/yourusername/ML-Enhanced-Particle-Simulator.git](https://github.com/yourusername/ML-Enhanced-Particle-Simulator.git) cd ML-Enhanced-Particle-Simulator
- Bash
- pip install -r requirements.txt
-
Generate Data: python src/data_generator.py
-
Train AI: python src/anomaly_detector_ml.py
-
Launch Dashboard: streamlit run visualization/interactive_dashboard.py
Language: Python
Math/Physics: NumPy, SciPy
Machine Learning: Scikit-learn, Joblib
Data/UI: Pandas, Plotly, Streamlit
Ahmet Meriç Yıldırım