This project implements a percolation simulation using modern JavaScript, HTML, and CSS. Percolation is a fascinating process where liquid passes through penetrable materials. In this simulation, users visualize how liquid flows through a grid system, demonstrating fundamental concepts in physics and computer science.
- ⏯️ Pause/Resume: Control simulation flow in real-time
- 🔄 Reset: Instantly restart the simulation
- ⚡ Speed Control: Instant, Fast, and Slow simulation speeds
- 📏 Grid Size: Adjustable from 1x1 to 400x400
- 📈 Real-time Statistics: Live percentage display during simulation
- 🔬 Statistical Analysis: Run multiple simulations for accurate percolation thresholds
- 📊 Data Export: Download results as CSV files for further analysis
- 📋 Detailed Results: Average, range, and individual threshold data
- ⚡ Weighted Quick Union-Find: Ultra-efficient connectivity algorithm
- 🎨 Canvas Rendering: Smooth, real-time grid visualization
- 📱 Mobile Optimized: Touch-friendly interface
- ♿ Accessibility: Proper labels and keyboard navigation
- 🌊 Percolation Simulation: Advanced grid-based percolation modeling
- ⚡ Weighted Quick Union-Find: Optimized disjoint set management for O(α(n)) performance
├── 🎨 index.html # Modern semantic HTML structure
├── 🎭 styles.css # Glassmorphism CSS with animations
└── ⚡ script.js # Percolation logic & UI interactions
- 🌐 Open
index.htmlin any modern web browser - 📏 Configure your grid size (1-400)
- ⚡ Select simulation speed (Instant/Fast/Slow)
▶️ Click "Run Simulation" to begin!
▶️ Run Simulation: Start the percolation process- ⏸️ Pause/Resume: Control simulation flow
- 🔄 Reset: Clear and restart
- 📊 Run Statistics: Analyze multiple simulations
- 📈 Export Results: Download CSV data
- 🔵 Blue Sites: Connected to top (full)
- ⚪ White Sites: Open but not connected
- ⚫ Black Sites: Blocked/closed
- 📈 Threshold: Percentage where percolation occurs
Percolation theory studies how fluids flow through porous materials. This simulation demonstrates:
- 🎯 Critical Phenomena: Phase transitions in random media
- 🌊 Fluid Dynamics: How connectivity emerges in grids
- 📊 Statistical Physics: Probability distributions and thresholds
- 🧮 Graph Theory: Connectivity and network analysis
# Clone the repository
git clone https://github.com/Arianrezaz/Percolation-Simulation.git
# Open in browser
# Open index.html in any modern web browserThis project is open source and available under the MIT License.
- 🎓 Princeton University: Original percolation problem inspiration
- 🔬 Computer Science Community: Algorithm development
⭐ Star this repo if you found it helpful!
