Skip to content

Percolation

Nawaf Abdullah edited this page Feb 16, 2019 · 2 revisions

The class Fluid, contained in the script percolation.py, allows the user to simulate percolation recursively, and highlight particles without neighbors.

Usage Example:

Size of the lattice: 100

Probability of particle at point x,y = 0.4

# Example use case
example = Fluid(100, 0.4)
example.percolate()
example.detect_clusters()
example.plot()

Clone this wiki locally