Skip to content

Just a couple of (mostly instructive) programming exercises

Notifications You must be signed in to change notification settings

Blastoise/Hobby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hobby

Python related coding exercises with real-life applications.

1. Julia Fractals

What are Fractals

A fractal is a never-ending pattern. Fractals are infinitely complex patterns that are self-similar across different scales.They are created by repeating a simple process over and over in an ongoing feedback loop.

Julia Set Fractals

The Julia set is named after the French mathematician Gaston Julia who investigated their properties circa 1915 and culminated in his famous paper in 1918. While the Julia set is now associated with a simpler polynomial, Julia was interested in the iterative properties of a more general expression, namely equation .The Julia set is now associated with those points equation on the complex plane for which the series equation does not tend to infinity. equation is a complex constant, one gets a different Julia set for each equation.The initial value equation for the series is each point in the image plane. In the broader sense the exact form of the iterated function may be anything, the general form being equation, interesting sets arise with non-linear functions equation. The image is created by mapping each pixel to a rectangular region of the complex plane. Each pixel then represents the starting point for the series, equation. The series is computed for each pixel and if it diverges to infinity it is drawn in white, if it doesn't then it is drawn black.Another property of Julia sets relates to the various domains of equation. If equation is real then the Julia set is mirrored about the real axis. Other values of equation with a non-zero imaginary component have 180 degree rotational symmetry.

Some of the patterns obtained for different values of equation are shown below:

equation equation
equation equation

2. Percolation Thresholds in Square and Cubic Lattices

The percolation threshold is a mathematical concept in percolation theory that describes the formation of long-range connectivity in random systems. Below the threshold a giant connected component does not exist; while above it, there exists a giant component of the order of system size. In engineering and coffee making, percolation represents the flow of fluids through porous media, but in the mathematics and physics worlds it generally refers to simplified lattice models of random systems or networks (graphs), and the nature of the connectivity in them. The percolation threshold is the critical value of the occupation probability equation, or more generally a critical surface for a group of parameters equation, equation, ..., such that infinite connectivity (percolation) first occurs.

Here we consider only Square and Simple Cubic percolation models.

Simplifying Assumption

While in the general case, percolation path from the first row to the last can be such that vacant sites on the path can lie on any adjacent edge, we will make the assumption that percolation is forward only.

Site percolation threshold plots for simple square and cubic lattice models against site vacancy probability is given below:

Site percolation threshold for Simple Square Lattice Site percolation threshold for Simple Cubic Lattice

About

Just a couple of (mostly instructive) programming exercises

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages