Skip to content

Visualizing the "Water Percolation" problem using Vanilla JS and p5.js

Notifications You must be signed in to change notification settings

0zzy0sbourne/PercolationTheory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Percolation Theory

Percolation Theory is a problem under the Graph Theory researches.
In statistical physics and mathematics, percolation theory describes the behavior of a network when nodes or links are removed.

Setup

In this project we have a NxN grid initialized with open sites(white blocks), closed sites(black blocks), and one random open site with water in it(coloured blue).

Program Flow

In every frame time, a random closed site is opened and program checks whether water percolates towards bottom of the grid. <br / > doesPercolate() function establish this process.
If it returns true, program (open site numbers / total site numbers) is pushed to a threshold array.

By repeating this computation experiment T times and averaging the results, we obtain a more accurate estimate of the percolation threshold. Let xt be the fraction of open sites in computational experiment t. The sample mean x¯¯¯ provides an estimate of the Percolation Threshold; the sample standard deviation s; measures the sharpness of the threshold.
Finally we can find the Confidence Interval and plot the threshold function as Sigmoid Function .

Further Improvements

In addition to this process, as we plot the sigmoid function, this function can be used to make prediction if grid does percolate or not by logistic regression.

About

Visualizing the "Water Percolation" problem using Vanilla JS and p5.js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published