Skip to content

Arianrezaz/PercolationSimulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌊 Percolation Simulation

Percolation Simulation

percolation simulation with advanced analytics

Live Demo JavaScript HTML5 CSS3

🎯 Overview

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.

🚀 Features

🎮 Interactive Controls

  • ⏯️ 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

📊 Advanced Analytics

  • 📈 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

🎯 Technical Excellence

  • ⚡ 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

🛠️ Technical Implementation

Algorithms Used:

  1. 🌊 Percolation Simulation: Advanced grid-based percolation modeling
  2. ⚡ Weighted Quick Union-Find: Optimized disjoint set management for O(α(n)) performance

Architecture:

├── 🎨 index.html     # Modern semantic HTML structure
├── 🎭 styles.css     # Glassmorphism CSS with animations
└── ⚡ script.js      # Percolation logic & UI interactions

📖 Usage Guide

🚀 Getting Started

  1. 🌐 Open index.html in any modern web browser
  2. 📏 Configure your grid size (1-400)
  3. ⚡ Select simulation speed (Instant/Fast/Slow)
  4. ▶️ Click "Run Simulation" to begin!

🎮 Controls

  • ▶️ 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

📊 Understanding Results

  • 🔵 Blue Sites: Connected to top (full)
  • ⚪ White Sites: Open but not connected
  • ⚫ Black Sites: Blocked/closed
  • 📈 Threshold: Percentage where percolation occurs

Scientific Background

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

Development Setup:

# Clone the repository
git clone https://github.com/Arianrezaz/Percolation-Simulation.git

# Open in browser
# Open index.html in any modern web browser

📄 License

This project is open source and available under the MIT License.

🙏 Acknowledgments

  • 🎓 Princeton University: Original percolation problem inspiration
  • 🔬 Computer Science Community: Algorithm development

Star this repo if you found it helpful!

🌐 Live Demo🐛 Report Issues💡 Request Features

About

Percolation Simulation: Explore fluid flow through penetrable materials with customizable simulations and visualization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •