Computational Mathematics: Percolation Algorithm Report and Analysis

Verified

Added on  2022/08/11

|7
|1258
|59
Report
AI Summary
This report presents an analysis of a Python implementation of the percolation algorithm, a concept used to model various disorders in media, particularly in soil engineering and environmental science. The report includes the provided Python code, which defines functions to determine open and full sites within a system, and checks for percolation. The code utilizes matrix representation and recursive functions to simulate the percolation process. The report also discusses the application of percolation theory in controlling environmental hazards like forest fires and electrical discharges. Furthermore, it touches upon the algorithm's computational aspects, including its dependency on processors and its execution time, as well as the use of matrix notation and methods like Gauss Jordan for solving related equations, as well as the application of differential equations. The report emphasizes the importance of the algorithm in various engineering platforms for building and establishing several processes, and the importance of choosing appropriate parameters for system growth.
Document Page
PYTHON 1
Percolation Algorithm
Name
Institution Affiliation
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
PYTHON 2
Question 7
# rockpercolation.py
#As per my understanding there is no python module stdio, so it is module written. If yes, then
please install this module using setup.py or make sure that you have stdio module in your
working directory
import stdio
import stdarray
# isOpen is a matrix that represents the open sites of a system.
# isFull is a partially completed matrix that represents the full sites
# of that system. Update isFull by marking every site of that system
# that is open and reachable from site (i, j).
def _flow(isOpen, isFull, i, j):
n = len(isFull)
if (i < 0) or (i >= n):
return
if (j < 0) or (j >= n):
return
if not isOpen[i][j]:
return
if isFull[i][j]:
return
isFull[i][j] = True
_flow(isOpen, isFull, i+1, j ) # Down.
_flow(isOpen, isFull, i , j+1) # Right.
_flow(isOpen, isFull, i , j-1) # Left.
_flow(isOpen, isFull, i-1, j ) # Up.
# isOpen is a matrix that represents the open sites of a system.
# Compute and return a matrix that represents the full sites of
Document Page
PYTHON 3
# that system.
def flow(isOpen):
n = len(isOpen)
isFull = stdarray.create2D(n, n, False)
for j in range(n):
_flow(isOpen, isFull, 0, j)
return isFull
# isOpen is matrix that represents the open sites of a system. Return
# True if that system percolates, and False otherwise.
def percolates(isOpen):
# Compute the full sites of the system.
isFull = flow(isOpen)
# If any site in the bottom row is full, then the system
# percolates.
n = len(isFull)
for j in range(n):
if isFull[n-1][j]:
return True
return False
# Read from standard input a boolean matrix that represents the
# open sites of a system. Write to standard output a boolean
# matrix representing the full sites of the system. Then write
# True if the system percolates and False otherwise.
def main():
isOpen = stdarray.readBool2D()
stdarray.write2D(flow(isOpen))
Document Page
PYTHON 4
stdio.writeln(percolates(isOpen))
#isOpen = stdarray.readBool2D()
#stdarray.write2D(flow(isOpen))
#draw(isOpen, False)
#stddraw.setPenColor(stddraw.BLUE)
#draw(flow(isOpen), True)
#stdio.writeln(percolates(isOpen))
#stddraw.show()
if __name__ == '__main__':
main()
i) In programing Python (200,175) is a time tuple, not a Fact. To brand a point, you
must use the full constructor: Point (200, 175). Points, are not tuples, must be used in
the construction for all graphical objects.
ii)
f(n) n n Change n′/n
10n
20n
5nlogn
2n2
2n
1000
500
250
70
13
10,000
5000
1842
223
16
n′=10n
n′=10n
10−−√n<n′<10n
n′=10−−√n
n′=n+3
10
10
7.37
3.16
−−
iii) Percolation theory
The theory of Percolation was developed by mathematicians to deal with various
disorders in media. One of the disorders in media was to define the random variation that would
be used to measure the theory of connectivity in the system. The method of percolation was
developed mainly to establish the existent of the percolation threshold that is generated from the
concept definition. From the python code developed above, we can successfully conclude that
percolation is used effectively in soil engineering. It is easier to implement this programming
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
PYTHON 5
concept in various engineering platforms such a way it can help in the building and
establishment of several processes. There is a necessity of initiating the algorithm with the
programming code. There is also the dependency of the programming code to the processor that
makes the program run in the system.
Percolation procedure is used by various institutions to control the spread of harmful
conditions that can alter the natural environment. It is a platform where the percolation process is
deployed in multiple places to control the range of environmental hazards. Such hazards include
break up of forest fires, electricity discharge and maintenance of environmental conditions. The
percolation process is determined by the controlled connectivity of the developed algorithm that
can help to prevent the spread of hazardous conditions (Morone, 2016). Applicably, the theory
can be well used in various fields where advancement needs to be done to sustain the global
distortion. The essential development style must follow the rubrics. There are different times for
the algorithm to be executed in the processors.
The technology is applied by the countries and companies that have to set up economic
activities in different places, and they have found that the site is not suitable for development.
The companies should achieve using the algorithm in a measure that can allow the penetration of
the project in the system developed. Percolation technology is given different parameters that can
sustain the development and the growth of the system. The settings can provide a surface system
for more growth of the algorithms (Bhrawy, 2016). It is essential to consider the setup process
that can be used to analyze the entire growth of the algorithm. The algorithm uses the least
systems and procedures that can help to establish and identify a growth rate system.
Document Page
PYTHON 6
Most of the algorithm is based on the computational problem; hence it has a meaningful
idea in running the code in the computer. The algorithm can be run from any programing
language but for this instance, it is referred to run using a python based programing language. It
is also essential to consider the time it takes to develop and run the code in different
programming platforms and languages. The time taken for a programing language to execute
depends on the several factors that are put in place to ensure a successful execution is done. The
effectiveness of the program should be considered in the development of a sound system. The
algorithm has been able to deliver a better order that can be used in any platform for growth.
Document Page
PYTHON 7
References
Morone, F., Min, B., Bo, L., Mari, R., & Makse, H. A. (2016). Collective influence algorithm to
find influencers via optimal percolation in massively large social media. Scientific
reports, 6, 30062.
Bhrawy, A. H. (2016). A highly accurate collocation algorithm for 1+ 1 and 2+ 1 fractional
percolation equations. Journal of Vibration and Control, 22(9), 2288-2310.
chevron_up_icon
1 out of 7
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]