Skip to content

Implementation of the one dimensional Contact Process (SIS model) and two dimensional SIR model in order to find critical exponents of Percolation

Notifications You must be signed in to change notification settings

lorenzomancini1/SIS_and_SIR_model_percolation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monte Carlo simulations of SIS and SIR model: two different percolation universality classes

Final project of the "Physics of Complex Systems" course at University of Padua during 2020/2021

Assignment and goal

The purpose of this project is to implement a Monte Carlo algorithm using a programming language (Python in my case) in order to simulate two epidemic models, namely the SIS (Contact Process) and the SIR. Those models can be exploited to find the critical point of the phase transition and the critical exponents of the corresponding percolation universality class.

Simulation

Some functions exploit Numba in order to speed up the computation. Refer to the presentation.pdf for the theoretical details concerning the simulation and the analysis.

Contact Processes (SIS)

The Project_CP.ipynb file contains the simulation of the 1-dimensional Contact Process.
A linear lattice of size N is build with an arbitrary percentage of initial infected nodes and the Monte Carlo algorithm is performed (with periodic boundary condition) using a list in order to keep track of the positions of the infected nodes.
The critical point is estimated with a quick and not rigorous method. Indeed, a more rigorous method would've required a lot of computational resources. For the critical exponents, some scaling relationships are used (see references in the presentation).

SIR model

The simulation of the 2-dimensional SIR model is contained in the Project_SIR.ipynb file. Again, a linear lattice of size N = LxL is built and considered as a square lattice of linear size L. The Monte Carlo algorithm is performed (with periodic boundary condition) using two lists in order to keep track of the Infected and Recovered nodes. The critical point is estimated in a similar way as in the previous case and the critical exponents are estimated exploiting scaling laws as well.

Animation

The file GIF_SIR.ipynb contains the code used to create a simple animation of the SIR model: starting from a single infected node, it shows how the epidemic spreads near the critical point until the absorbing phase is reached. The code creates a folder with the images for the movie and the .gif file as well.

Releases

No releases published

Packages

No packages published