Package 'SPSL'

Title: Site Percolation on Square Lattices (SPSL)
Description: Provides basic functionality for labeling iso- & anisotropic percolation clusters on 2D & 3D square lattices with various lattice sizes, occupation probabilities, von Neumann & Moore (1,d)-neighborhoods, and random variables weighting the percolation lattice sites.
Authors: Pavel V. Moskalev
Maintainer: Pavel V. Moskalev <[email protected]>
License: GPL-3
Version: 0.1-9
Built: 2024-10-08 06:33:27 UTC
Source: CRAN

Help Index


Site Percolation on Square Lattices (SPSL)

Description

Provides basic functionality for labeling iso- & anisotropic percolation clusters on 2D & 3D square lattices with various lattice sizes, occupation probabilities, von Neumann & Moore (1,d)-neighborhoods, and random variables weighting the percolation lattice sites.

Details

Package: SPSL
Type: Package
Version: 0.1-9
Date: 2019-03-17
License: GPL-3
LazyLoad: yes

ssi20() and ssi30() functions provide sites labeling of the isotropic cluster on 2D & 3D square lattice with von Neumann (1,0)-neighborhood.
ssa20() and ssa30() functions provide sites labeling of the anisotropic cluster on 2D & 3D square lattice with von Neumann (1,0)-neighborhood.
ssi2d() and ssi3d() functions provide sites labeling of the isotropic cluster on 2D & 3D square lattice with Moore (1,d)-neighborhood.
ssa2d() and ssa3d() functions provide sites labeling of the anisotropic cluster on 2D & 3D square lattice with Moore (1,d)-neighborhood.
fssi20() and fssi30() functions calculates the relative frequency distribution of isotropic clusters on 2D & 3D square lattice with von Neumann (1,0)-neighborhood.
fssa20() and fssa30() functions calculates the relative frequency distribution of anisotropic clusters on 2D & 3D square lattice with von Neumann (1,0)-neighborhood.
fssi2d() and fssi3d() functions calculates the relative frequency distribution of isotropic clusters on 2D & 3D square lattice with Moore (1,d)-neighborhood.
fssa2d() and fssa3d() functions calculates the relative frequency distribution of anisotropic clusters on 2D & 3D square lattice with Moore (1,d)-neighborhood.

Author(s)

Pavel V. Moskalev <[email protected]>

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.
[2] Moskalev, P.V. (2014) Estimates of threshold and strength of percolation clusters on square lattices with (1,d)-neighborhood. Computer Research and Modeling, Vol.6, No.3, pp.405–414; in Russian.
[3] Moskalev, P.V. (2013) The structure of site percolation models on three-dimensional square lattices. Computer Research and Modeling, Vol.5, No.4, pp.607–622; in Russian.


Frequency of Sites on a Square Anisotropic 2D lattice with (1,0)-neighborhood

Description

fssa20() function calculates the relative frequency distribution of anisotropic clusters on 2D square lattice with von Neumann (1,0)-neighborhood.

Usage

fssa20(n=1000, x=33, p=runif(4, max=0.9), 
       set=(x^2+1)/2, all=TRUE, shape=c(1,1))

Arguments

n

a sample size.

x

a linear dimension of 2D square percolation lattice.

p

a vector of relative fractions (0<p)&(p<1) of accessible sites (occupation probability) for lattice directions: (-x,+x,-y,+y).

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 2D square lattice with uniformly weighted sites and the vector p, distributed over the lattice directions.

The anisotropic cluster is formed from the accessible sites connected with the initial subset set, and depends on the direction in 2D square lattice.

Von Neumann (1,0)-neighborhood on 2D square lattice consists of sites, only one coordinate of which is different from the current site by one: e=c(-1, 1, -x, x).

Each element of the matrix frq is equal to the relative frequency with which the 2D square lattice site belongs to a cluster sample of size n.

Value

rfq

a 2D matrix of relative sampling frequencies for sites of the percolation lattice.

Author(s)

Pavel V. Moskalev <[email protected]>

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.

See Also

ssa20, fssa30, fssi20, fssi30, fssa2d, fssa3d

Examples

x <- y <- seq(33)
image(x, y, rfq <- fssa20(n=200, p=c(.3,.4,.75,.5)), cex.main=1,
main="Frequencies of anisotropic (1,0)-clusters")
contour(x, y, rfq, levels=seq(.2,.3,.05), add=TRUE)
abline(h=17, lty=2); abline(v=17, lty=2)

Frequency of Sites on a Square Anisotropic 2D lattice with (1,d)-neighborhood

Description

fssa2d() function calculates the relative frequency distribution of anisotropic clusters on 2D square lattice with Moore (1,d)-neighborhood.

Usage

fssa2d(n=1000, x=33, 
       p0=runif(4, max=0.8), 
       p1=colMeans(matrix(p0[c(1,3, 2,3, 1,4, 2,4)], nrow=2))/2,
       set=(x^2+1)/2, all=TRUE, shape=c(1,1))

Arguments

n

a sample size.

x

a linear dimension of 2D square percolation lattice.

p0

a vector of relative fractions (0<p0)&(p0<1) of accessible sites (occupation probability) for lattice directions: (-x,+x,-y,+y).

p1

averaged double combinations of p0-components weighted by Minkowski distance: p1=colMeans(matrix(p0[c(1,3,...)], nrow=2))/rhoMe1.

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 2D square lattice with uniformly weighted sites and the vectors p0 and p1, distributed over the lattice directions, and their combinations.

The anisotropic cluster is formed from the accessible sites connected with the initial subset set, and depends on the direction in 2D square lattice.

Moore (1,d)-neighborhood on 2D square lattice consists of sites, at least one coordinate of which is different from the current site by one: e=c(e0,e1), where
e0=c(-1, 1, -x, x);
e1=colSums(matrix(e0[c(1,3, 2,3, 1,4, 2,4)], nrow=2)).

Minkowski distance between sites a and b depends on the exponent d:
rhoM <- function(a, b, d=1)
if (is.infinite(d)) return(apply(abs(b-a), 2, max))
else return(apply(abs(b-a)^d, 2, sum)^(1/d)).

Minkowski distance for sites from e1 subset with the exponent d=1 is equal to rhoMe1=2.

Each element of the matrix frq is equal to the relative frequency with which the 2D square lattice site belongs to a cluster sample of size n.

Value

rfq

a 2D matrix of relative sampling frequencies for sites of the percolation lattice.

Author(s)

Pavel V. Moskalev <[email protected]>

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.

See Also

ssa2d, fssa3d, fssa20, fssa30, fssi2d, fssi3d

Examples

x <- y <- seq(33) 
image(x, y, rfq <- fssa2d(n=200, p0=c(.3,.4,.75,.5)), cex.main=1,
main="Frequencies of anisotropic (1,1)-clusters")
contour(x, y, rfq, levels=seq(.2,.3,.05), add=TRUE)
abline(h=17, lty=2); abline(v=17, lty=2)

Frequency of Sites on a Square Anisotropic 3D lattice with (1,0)-neighborhood

Description

fssa30() function calculates the relative frequency distribution of anisotropic clusters on 3D square lattice with von Neumann (1,0)-neighborhood.

Usage

fssa30(n=1000, x=33, p=runif(6, max=0.6), 
       set=(x^3+1)/2, all=TRUE, shape=c(1,1))

Arguments

n

a sample size.

x

a linear dimension of 3D square percolation lattice.

p

a vector of relative fractions (0<p)&(p<1) of accessible sites (occupation probability) for lattice directions: (-x,+x,-y,+y,-z,+z).

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 3D square lattice with uniformly weighted sites and the vector p, distributed over the lattice directions.

The anisotropic cluster is formed from the accessible sites connected with the initial subset set, and depends on the direction in 3D square lattice.

Von Neumann (1,0)-neighborhood on 3D square lattice consists of sites, only one coordinate of which is different from the current site by one: e=c(-1, 1, -x, x, -x^2, x^2).

Each element of the 3D matrix frq is equal to the relative frequency with which the 3D square lattice site belongs to a cluster sample of size n.

Value

rfq

a 3D matrix of relative sampling frequencies for sites of the percolation lattice.

Author(s)

Pavel V. Moskalev <[email protected]>

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.

See Also

ssa30, fssa20, fssi20, fssi30, fssa2d, fssa3d

Examples

x <- y <- seq(33)
rfq <- fssa30(n=200, p=.17*c(.5,3,.5,1.5,1,.5))
image(x, y, rfq[,,17], cex.main=1,
main="Frequencies in z=17 slice of anisotropic (1,0)-clusters")
contour(x, y, rfq[,,17], levels=seq(.05,.3,.05), add=TRUE)
abline(h=17, lty=2); abline(v=17, lty=2)

Frequency of Sites on a Square Anisotropic 3D lattice with (1,d)-neighborhood

Description

fssa3d() function calculates the relative frequency distribution of anisotropic clusters on 3D square lattice with Moore (1,d)-neighborhood.

Usage

fssa3d(n=1000, x=33, 
       p0=runif(6, max=0.4),
       p1=colMeans(matrix(p0[c(
          1,3, 2,3, 1,4, 2,4,
          1,5, 2,5, 1,6, 2,6,
          3,5, 4,5, 3,6, 4,6)], nrow=2))/2,
       p2=colMeans(matrix(p0[c(
          1,3,5, 2,3,5, 1,4,5, 2,4,5,
          1,3,6, 2,3,6, 1,4,6, 2,4,6)], nrow=3))/3,
       set=(x^3+1)/2, all=TRUE, shape=c(1,1))

Arguments

n

a sample size.

x

a linear dimension of 2D square percolation lattice.

p0

a vector of relative fractions (0<p0)&(p0<1) of accessible sites (occupation probability) for lattice directions: (-x,+x,-y,+y,-z,+z).

p1

averaged double combinations of p0-components weighted by Minkowski distance: p1=colMeans(matrix(p0[c(1,3,...)], nrow=2))/rhoMe1.

p2

averaged triple combinations of p0-components weighted by Minkowski distance: p2=colMeans(matrix(p0[c(1,3,5,...)], nrow=3))/rhoMe2.

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 3D square lattice with uniformly weighted sites acc and the vectors p0, p1, and p2, distributed over the lattice directions, and their combinations.

The anisotropic cluster is formed from the accessible sites connected with the initial subset set, and depends on the direction in 3D square lattice.

Moore (1,d)-neighborhood on 3D square lattice consists of sites, at least one coordinate of which is different from the current site by one: e=c(e0,e1,e2), where
e0=c(-1, 1, -x, x, -x^2, x^2);
e1=colSums(matrix(e0[c(1,3, 2,3, 1,4, 2,4, 1,5, 2,5, 1,6, 2,6, 3,5, 4,5, 3,6, 4,6)], nrow=2));
e2=colMeans(matrix(p0[c(1,3,5, 2,3,5, 1,4,5, 2,4,5, 1,3,6, 2,3,6, 1,4,6, 2,4,6)], nrow=3)).

Minkowski distance between sites a and b depends on the exponent d:
rhoM <- function(a, b, d=1)
if (is.infinite(d)) return(apply(abs(b-a), 2, max))
else return(apply(abs(b-a)^d, 2, sum)^(1/d)).

Minkowski distance for sites from e1 and e2 subsets with the exponent d=1 is equal to rhoMe1=2 and rhoMe2=3.

Each element of the matrix frq is equal to the relative frequency with which the 3D square lattice site belongs to a cluster sample of size n.

Value

rfq

a 3D matrix of relative sampling frequencies for sites of the percolation lattice.

Author(s)

Pavel V. Moskalev <[email protected]>

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.

See Also

ssa3d, fssa2d, fssa20, fssa30, fssi2d, fssi3d

Examples

x <- y <- seq(33)
rfq <- fssa3d(n=200, p0=.17*c(.5,3,.5,1.5,1,.5))
image(x, y, rfq[,,17], cex.main=1,
main="Frequencies in z=17 slice of anisotropic (1,1)-clusters")
contour(x, y, rfq[,,17], levels=seq(.05,.3,.05), add=TRUE)
abline(h=17, lty=2); abline(v=17, lty=2)

Frequency of Sites on a Square Isotropic 2D lattice with (1,0)-neighborhood

Description

fssi20() function calculates the relative frequency distribution of isotropic clusters on 2D square lattice with von Neumann (1,0)-neighborhood.

Usage

fssi20(n=1000, x=33, p=0.592746, 
       set=(x^2+1)/2, all=TRUE, shape=c(1,1))

Arguments

n

a sample size.

x

a linear dimension of 2D square percolation lattice.

p

the relative fractions (0<p)&(p<1) of accessible sites (occupation probability) for percolation lattice.

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 2D square lattice with uniformly weighted sites and the constant parameter p.

The isotropic cluster is formed from the accessible sites connected with initial sites subset set.

Von Neumann (1,0)-neighborhood on 2D square lattice consists of sites, only one coordinate of which is different from the current site by one: e=c(-1, 1, -x, x).

Each element of the matrix frq is equal to the relative frequency with which the 2D square lattice site belongs to a cluster sample of size n.

Value

rfq

a 2D matrix of relative sampling frequencies for sites of the percolation lattice.

Author(s)

Pavel V. Moskalev

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.
[2] Moskalev, P.V. (2014) Estimates of threshold and strength of percolation clusters on square lattices with (1,d)-neighborhood. Computer Research and Modeling, Vol.6, No.3, pp.405–414; in Russian.

See Also

ssi20, fssi30, fssa20, fssa30, fssi2d, fssi3d

Examples

x <- y <- seq(33) 
image(x, y, rfq <- fssi20(n=200), cex.main=1,
main="Frequencies of isotropic (1,0)-clusters")
contour(x, y, rfq, levels=seq(.2,.3,.05), add=TRUE)
abline(h=17, lty=2); abline(v=17, lty=2)

Frequency of Sites on a Square Isotropic 2D lattice with (1,d)-neighborhood

Description

fssi2d() function calculates the relative frequency distribution of isotropic clusters on 2D square lattice with Moore (1,d)-neighborhood.

Usage

fssi2d(n=1000, x=33, p0=0.5, p1=p0/2, 
       set=(x^2+1)/2, all=TRUE, shape=c(1,1))

Arguments

n

a sample size.

x

a linear dimension of 2D square percolation lattice.

p0

a relative fraction (0<p0)&(p0<1) of accessible sites (occupation probability) for percolation lattice.

p1

p0 value, weighted by Minkowski distance: p1=p0/rhoMe1.

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 2D square lattice with uniformly weighted sites and the constant parameters p0 and p1.

The isotropic cluster is formed from the accessible sites connected with initial sites subset set.

Moore (1,d)-neighborhood on 2D square lattice consists of sites, at least one coordinate of which is different from the current site by one: e=c(e0,e1), where
e0=c(-1, 1, -x, x, -x^2, x^2);
e1=colSums(matrix(e0[c(1,3, 2,3, 1,4, 2,4)], nrow=2)).

Minkowski distance between sites a and b depends on the exponent d:
rhoM <- function(a, b, d=1)
if (is.infinite(d)) return(apply(abs(b-a), 2, max))
else return(apply(abs(b-a)^d, 2, sum)^(1/d)).

Minkowski distance for sites from e1 subset with the exponent d=1 is equal to rhoMe1=2.

Each element of the matrix frq is equal to the relative frequency with which the 2D square lattice site belongs to a cluster sample of size n.

Value

rfq

a 2D matrix of relative sampling frequencies for sites of the percolation lattice.

Author(s)

Pavel V. Moskalev <[email protected]>

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.
[2] Moskalev, P.V. (2014) Estimates of threshold and strength of percolation clusters on square lattices with (1,d)-neighborhood. Computer Research and Modeling, Vol.6, No.3, pp.405–414; in Russian.

See Also

ssi2d, fssi3d, fssi20, fssi30, fssa2d, fssa3d

Examples

x <- y <- seq(33)
image(x, y, rfq <- fssi2d(n=200), cex.main=1,
main="Frequencies of isotropic (1,1)-clusters")
contour(x, y, rfq, levels=seq(.2,.3,.05), add=TRUE)
abline(h=17, lty=2); abline(v=17, lty=2)

Frequency of Sites on a Square Isotropic 3D lattice with (1,0)-neighborhood

Description

fssi30() function calculates the relative frequency distribution of isotropic clusters on 3D square lattice with von Neumann (1,0)-neighborhood.

Usage

fssi30(n=1000, x=33, p=0.311608, 
       set=(x^3+1)/2, all=TRUE, shape=c(1,1))

Arguments

n

a sample size.

x

a linear dimension of 3D square percolation lattice.

p

the relative fractions (0<p)&(p<1) of accessible sites (occupation probability) for percolation lattice.

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 3D square lattice with uniformly weighted sites and the constant parameter p.

The isotropic cluster is formed from the accessible sites connected with initial sites subset set.

Von Neumann (1,0)-neighborhood on 3D square lattice consists of sites, only one coordinate of which is different from the current site by one: e=c(-1, 1, -x, x, -x^2, x^2).

Each element of the matrix frq is equal to the relative frequency with which the 3D square lattice site belongs to a cluster sample of size n.

Value

rfq

a 3D matrix of relative sampling frequencies for sites of the percolation lattice.

Author(s)

Pavel V. Moskalev <[email protected]>

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.

See Also

ssi30, fssi20, fssa20, fssa30, fssi2d, fssi3d

Examples

x <- y <- seq(33)
rfq <- fssi30(n=200, p=0.37)
image(x, y, rfq[,,17], cex.main=1, 
main="Frequencies in the z=17 slice of isotropic (1,0)-clusters")
contour(x, y, rfq[,,17], levels=c(0.2,0.25,0.3), add=TRUE)
abline(h=17, lty=2); abline(v=17, lty=2)

Frequency of Sites on a Square Isotropic 3D lattice with (1,d)-neighborhood

Description

fssi3d() function calculates the relative frequency distribution of isotropic clusters on 3D square lattice with Moore (1,d)-neighborhood.

Usage

fssi3d(n=1000, x=33, p0=0.2, p1=p0/2, p2=p0/3, 
       set=(x^3+1)/2, all=TRUE, shape=c(1,1))

Arguments

n

a sample size.

x

a linear dimension of 3D square percolation lattice.

p0

a relative fraction (0<p0)&(p0<1) of accessible sites (occupation probability) for percolation lattice.

p1

p0 value, weighted by Minkowski distance: p1=p0/rhoMe1.

p2

p0 value, weighted by Minkowski distance: p2=p0/rhoMe2.

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 3D square lattice with uniformly weighted sites and the constant parameters p0, p1, and p2.

The isotropic cluster is formed from the accessible sites connected with initial sites subset set.

Moore (1,d)-neighborhood on 3D square lattice consists of sites, at least one coordinate of which is different from the current site by one: e=c(e0,e1,e2), where
e0=c(-1, 1, -x, x, -x^2, x^2);
e1=colSums(matrix(e0[c(1,3, 2,3, 1,4, 2,4, 1,5, 2,5, 1,6, 2,6, 3,5, 4,5, 3,6, 4,6)], nrow=2));
e2=colMeans(matrix(p0[c(1,3,5, 2,3,5, 1,4,5, 2,4,5, 1,3,6, 2,3,6, 1,4,6, 2,4,6)], nrow=3)).

Minkowski distance between sites a and b depends on the exponent d:
rhoM <- function(a, b, d=1)
if (is.infinite(d)) return(apply(abs(b-a), 2, max))
else return(apply(abs(b-a)^d, 2, sum)^(1/d)).

Minkowski distance for sites from e1 and e2 subsets with the exponent d=1 is equal to rhoMe1=2 and rhoMe2=3.

Each element of the matrix frq is equal to the relative frequency with which the 3D square lattice site belongs to a cluster sample of size n.

Value

rfq

a 3D matrix of relative sampling frequencies for sites of the percolation lattice.

Author(s)

Pavel V. Moskalev <[email protected]>

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.

See Also

ssi3d, fssi2d, fssi20, fssi30, fssa2d, fssa3d

Examples

x <- y <- seq(33)
rfq <- fssi3d(n=200, p0=.285)
image(x, y, rfq[,,17], cex.main=1, 
main="Frequencies in the z=17 slice of isotropic (1,1)-clusters")
contour(x, y, rfq[,,17], levels=c(0.2,0.25,0.3), add=TRUE)
abline(h=17, lty=2); abline(v=17, lty=2)

Site cluster on Square Anisotropic 2D lattice with (1,0)-neighborhood

Description

ssa20() function provides sites labeling of the anisotropic cluster on 2D square lattice with von Neumann (1,0)-neighborhood.

Usage

ssa20(x=33, p=runif(4, max=0.9), 
      set=(x^2+1)/2, all=TRUE, shape=c(1,1))

Arguments

x

a linear dimension of 2D square percolation lattice.

p

a vector of relative fractions (0<p)&(p<1) of accessible sites (occupation probability) for lattice directions: (-x,+x,-y,+y).

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 2D square lattice with uniformly weighted sites acc and the vector p, distributed over the lattice directions.

The anisotropic cluster is formed from the accessible sites connected with the initial subset, and depends on the direction in 2D square lattice.

To form the cluster the condition acc[set+e[n]]<p[n] is iteratively tested for sites of the von Neumann (1,0)-neighborhood e for the current cluster perimeter set, where n is equal to direction in 2D square lattice.

Von Neumann (1,0)-neighborhood on 2D square lattice consists of sites, only one coordinate of which is different from the current site by one: e=c(-1, 1, -x, x).

Forming cluster ends with the exhaustion of accessible sites in von Neumann (1,0)-neighborhood of the current cluster perimeter.

Value

acc

an accessibility matrix for 2D square percolation lattice:
if acc[e]<p[n] then acc[e] is accessible site;
if acc[e]==1 then acc[e] is non-accessible site;
if acc[e]==2 then acc[e] belongs to a sites cluster.

Author(s)

Pavel V. Moskalev

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.

See Also

fssa20, ssa30, ssi20, ssi30, ssa2d, ssa3d

Examples

set.seed(20120507)
x <- y <- seq(33)
image(x, y, ssa20(), zlim=c(0,2), 
main="Anisotropic (1,0)-cluster")
abline(h=17, lty=2); abline(v=17, lty=2)

Site cluster on Square Anisotropic 2D lattice with (1,d)-neighborhood

Description

ssa2d() function provides sites labeling of the anisotropic cluster on 2D square lattice with Moore (1,d)-neighborhood.

Usage

ssa2d(x=33, p0=runif(4, max=0.8), 
            p1=colMeans(matrix(p0[c(
               1,3, 2,3, 1,4, 2,4)], nrow=2))/2,
            set=(x^2+1)/2, all=TRUE, shape=c(1,1))

Arguments

x

a linear dimension of 2D square percolation lattice.

p0

a vector of relative fractions (0<p0)&(p0<1) of accessible sites (occupation probability) for lattice directions: (-x,+x,-y,+y).

p1

averaged double combinations of p0-components weighted by Minkowski distance: p1=colMeans(matrix(p0[c(1,3,...)], nrow=2))/rhoMe1.

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 2D square lattice with uniformly weighted sites acc and the vectors p0 and p1, distributed over the lattice directions, and their combinations.

The anisotropic cluster is formed from the accessible sites connected with the initial subset set, and depends on the direction in 2D square lattice.

To form the cluster the condition acc[set+eN[n]]<pN[n] is iteratively tested for sites of the Moore (1,d)-neighborhood eN for the current cluster perimeter set, where eN is equal to e0 or e1 vector; pN is equal to p0 or p1 vector; n is equal to direction in 2D square lattice.

Moore (1,d)-neighborhood on 2D square lattice consists of sites, at least one coordinate of which is different from the current site by one: e=c(e0,e1), where
e0=c(-1, 1, -x, x);
e1=colSums(matrix(e0[c(1,3, 2,3, 1,4, 2,4)], nrow=2)).

Minkowski distance between sites a and b depends on the exponent d:
rhoM <- function(a, b, d=1)
if (is.infinite(d)) return(apply(abs(b-a), 2, max))
else return(apply(abs(b-a)^d, 2, sum)^(1/d)).

Minkowski distance for sites from e1 subset with the exponent d=1 is equal to rhoMe1=2.

Forming cluster ends with the exhaustion of accessible sites in Moore (1,d)-neighborhood of the current cluster perimeter.

Value

acc

an accessibility matrix for 2D square percolation lattice:
if acc[e]<pN[n] then acc[e] is accessible site;
if acc[e]==1 then acc[e] is non-accessible site;
if acc[e]==2 then acc[e] belongs to a sites cluster.

Author(s)

Pavel V. Moskalev

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.

See Also

fssa2d, ssa3d, ssa20, ssa30, ssi2d, ssi3d

Examples

set.seed(20120507)
x <- y <- seq(33)
image(x, y, ssa2d(), zlim=c(0,2), 
main="Anisotropic (1,1)-cluster")
abline(h=17, lty=2); abline(v=17, lty=2)

Site cluster on Square Anisotropic 3D lattice with (1,0)-neighborhood

Description

ssa30() function provides sites labeling of the anisotropic cluster on 3D square lattice with von Neumann (1,0)-neighborhood.

Usage

ssa30(x=33, p=runif(6, max=0.6), 
      set=(x^3+1)/2, all=TRUE, shape=c(1,1))

Arguments

x

a linear dimension of 3D square percolation lattice.

p

a vector of relative fractions (0<p)&(p<1) of accessible sites (occupation probability) for lattice directions: (-x,+x,-y,+y,-z,+z).

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 3D square lattice with uniformly weighted sites acc and the vector p, distributed over the lattice directions.

The anisotropic cluster is formed from the accessible sites connected with the initial subset set, and depends on the direction in 3D square lattice.

To form the cluster the condition acc[set+e[n]]<p[n] is iteratively tested for sites of the von Neumann (1,0)-neighborhood e for the current cluster perimeter set, where n is equal to direction in 3D square lattice.

Von Neumann (1,0)-neighborhood on 3D square lattice consists of sites, only one coordinate of which is different from the current site by one: e=c(-1, 1, -x, x, -x^2, x^2).

Forming cluster ends with the exhaustion of accessible sites in von Neumann (1,0)-neighborhood of the current cluster perimeter.

Value

acc

an accessibility matrix for 3D square percolation lattice:
if acc[e]<p[n] then acc[e] is accessible site;
if acc[e]==1 then acc[e] is non-accessible site;
if acc[e]==2 then acc[e] belongs to a sites cluster.

Author(s)

Pavel V. Moskalev

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.
[2] Moskalev, P.V. (2013) The structure of site percolation models on three-dimensional square lattices. Computer Research and Modeling, Vol.5, No.4, pp.607–622; in Russian.

See Also

fssa30, ssa20, ssi20, ssi30, ssa2d, ssa3d

Examples

# Example No.1. Axonometric projection of 3D cluster
require(lattice)
set.seed(20120521)
x <- y <- z <- seq(33)
cls <- which(ssa30(p=.09*c(1,6,1,3,2,1))>1, arr.ind=TRUE)
cloud(cls[,3] ~ cls[,1]*cls[,2],
xlim=range(x), ylim=range(y), zlim=range(z), 
col=rgb(1,0,0,0.4), xlab="x", ylab="y", zlab="z", main.cex=1,
main="Anisotropic (1,0)-cluster")

# Example No.2. Z=17 slice of 3D cluster
set.seed(20120521)
x <- y <- z <- seq(33)
cls <- ssa30(p=.09*c(1,6,1,3,2,1))
image(x, y, cls[,,17], zlim=c(0,2), cex.main=1, 
main="Z=17 slice of an anisotropic (1,0)-cluster")
abline(h=17, lty=2); abline(v=17, lty=2)

Site cluster on Square Anisotropic 3D lattice with (1,d)-neighborhood

Description

ssa3d() function provides sites labeling of the anisotropic cluster on 3D square lattice with Moore (1,d)-neighborhood.

Usage

ssa3d(x=33, p0=runif(6, max=0.4),
            p1=colMeans(matrix(p0[c(
               1,3, 2,3, 1,4, 2,4,
               1,5, 2,5, 1,6, 2,6,
               3,5, 4,5, 3,6, 4,6)], nrow=2))/2,
            p2=colMeans(matrix(p0[c(
               1,3,5, 2,3,5, 1,4,5, 2,4,5,
               1,3,6, 2,3,6, 1,4,6, 2,4,6)], nrow=3))/3,                 
            set=(x^3+1)/2, all=TRUE,
            shape=c(1,1))

Arguments

x

a linear dimension of 3D square percolation lattice.

p0

a vector of relative fractions (0<p0)&(p0<1) of accessible sites (occupation probability) for lattice directions: (-x,+x,-y,+y,-z,+z).

p1

averaged double combinations of p0-components weighted by Minkowski distance: p1=colMeans(matrix(p0[c(1,3,...)], nrow=2))/rhoMe1.

p2

averaged triple combinations of p0-components weighted by Minkowski distance: p2=colMeans(matrix(p0[c(1,3,5,...)], nrow=3))/rhoMe2.

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 3D square lattice with uniformly weighted sites acc and the vectors p0, p1, and p2, distributed over the lattice directions, and their combinations.

The anisotropic cluster is formed from the accessible sites connected with the initial subset set, and depends on the direction in 3D square lattice.

To form the cluster the condition acc[set+eN[n]]<pN[n] is iteratively tested for sites of the Moore (1,d)-neighborhood eN for the current cluster perimeter set, where eN is equal to e0, e1, or e2 vector; pN is equal to p0, p1, or p2 vector; n is equal to direction in 3D square lattice.

Moore (1,d)-neighborhood on 3D square lattice consists of sites, at least one coordinate of which is different from the current site by one: e=c(e0,e1,e2), where
e0=c(-1, 1, -x, x, -x^2, x^2);
e1=colSums(matrix(e0[c(1,3, 2,3, 1,4, 2,4, 1,5, 2,5, 1,6, 2,6, 3,5, 4,5, 3,6, 4,6)], nrow=2));
e2=colMeans(matrix(p0[c(1,3,5, 2,3,5, 1,4,5, 2,4,5, 1,3,6, 2,3,6, 1,4,6, 2,4,6)], nrow=3)).

Minkowski distance between sites a and b depends on the exponent d:
rho.mink <- function(a, b, d=1)
if (is.infinite(d)) return(apply(abs(b-a), 2, max))
else return(apply(abs(b-a)^d, 2, sum)^(1/d)).

Minkowski distance for sites from e1 and e2 subsets with the exponent d=1 is equal to rhoMe1=2 and rhoMe2=3.

Forming cluster ends with the exhaustion of accessible sites in Moore (1,d)-neighborhood of the current cluster perimeter.

Value

acc

an accessibility matrix for 3D square percolation lattice:
if acc[e]<pN[n] then acc[e] is accessible site;
if acc[e]==1 then acc[e] is non-accessible site;
if acc[e]==2 then acc[e] belongs to a sites cluster.

Author(s)

Pavel V. Moskalev

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.
[2] Moskalev, P.V. (2013) The structure of site percolation models on three-dimensional square lattices. Computer Research and Modeling, Vol.5, No.4, pp.607–622; in Russian.

See Also

fssa3d, ssa2d, ssa20, ssa30, ssi2d, ssi3d

Examples

# Example No.1. Axonometric projection of 3D cluster
require(lattice)
set.seed(20120521)
x <- y <- z <- seq(33)
cls <- which(ssa3d(p0=.09*c(1,6,1,3,2,1))>1, arr.ind=TRUE)
cloud(cls[,3] ~ cls[,1]*cls[,2],
xlim=range(x), ylim=range(y), zlim=range(z), 
col=rgb(1,0,0,0.4), xlab="x", ylab="y", zlab="z", main.cex=1,
main="Anisotropic (1,1)-cluster")

# Example No.2. Z=17 slice of 3D cluster
set.seed(20120521)
x <- y <- z <- seq(33)
cls <- ssa3d(p0=.09*c(1,6,1,3,2,1))
image(x, y, cls[,,17], zlim=c(0,2), cex.main=1, 
main="Z=17 slice of an anisotropic (1,1)-cluster")
abline(h=17, lty=2); abline(v=17, lty=2)

Site cluster on Square Isotropic 2D lattice with (1,0)-neighborhood

Description

ssi20() function provides sites labeling of the isotropic cluster on 2D square lattice with von Neumann (1,0)-neighborhood.

Usage

ssi20(x=33, p=0.592746, 
      set=(x^2+1)/2, all=TRUE, shape=c(1,1))

Arguments

x

a linear dimension of 2D square percolation lattice.

p

the relative fractions (0<p)&(p<1) of accessible sites (occupation probability) for percolation lattice.

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 2D square lattice with uniformly weighted sites acc and the constant parameter p.

The isotropic cluster is formed from the accessible sites connected with initial sites subset.

To form the cluster the condition acc[set+e]<p is iteratively tested for sites of the von Neumann (1,0)-neighborhood e for the current cluster perimeter set.

Von Neumann (1,0)-neighborhood on 2D square lattice consists of sites, only one coordinate of which is different from the current site by one: e=c(-1, 1, -x, x).

Forming cluster ends with the exhaustion of accessible sites in von Neumann (1,0)-neighborhood of the current cluster perimeter.

Value

acc

an accessiblity matrix for 2D square percolation lattice:
if acc[e]<p then acc[e] is accessible site;
if acc[e]==1 then acc[e] is non-accessible site;
if acc[e]==2 then acc[e] belongs to a sites cluster.

Author(s)

Pavel V. Moskalev

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.
[2] Moskalev, P.V. (2014) Estimates of threshold and strength of percolation clusters on square lattices with (1,d)-neighborhood. Computer Research and Modeling, Vol.6, No.3, pp.405–414; in Russian.

See Also

fssi20, ssi30, ssa20, ssa30, ssi2d, ssi3d

Examples

set.seed(20120507)
x <- y <- seq(33)
image(x, y, ssi20(), zlim=c(0,2), 
main="Isotropic (1,0)-cluster")
abline(h=17, lty=2); abline(v=17, lty=2)

Site cluster on Square Isotropic 2D lattice with (1,d)-neighborhood

Description

ssi2d() function provides sites labeling of the isotropic cluster on 2D square lattice with Moore (1,d)-neighborhood.

Usage

ssi2d(x=33, p0=0.5, p1=p0/2, 
      set=(x^2+1)/2, all=TRUE, shape=c(1,1))

Arguments

x

a linear dimension of 2D square percolation lattice.

p0

a relative fraction (0<p0)&(p0<1) of accessible sites (occupation probability) for percolation lattice.

p1

p0 value, weighted by Minkowski distance: p1=p0/rhoMe1.

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 2D square lattice with uniformly weighted sites acc and the constant parameters p0 and p1.

The isotropic cluster is formed from the accessible sites connected with initial sites subset set.

To form the cluster the condition acc[set+eN]<pN is iteratively tested for sites of the Moore (1,d)-neighborhood eN for the current cluster perimeter set, where eN is equal to e0 or e1 vector; pN is equal to p0 or p1 value.

Moore (1,d)-neighborhood on 2D square lattice consists of sites, at least one coordinate of which is different from the current site by one: e=c(e0,e1), where
e0=c(-1, 1, -x, x, -x^2, x^2);
e1=colSums(matrix(e0[c(1,3, 2,3, 1,4, 2,4)], nrow=2)).

Minkowski distance between sites a and b depends on the exponent d:
rhoM <- function(a, b, d=1)
if (is.infinite(d)) return(apply(abs(b-a), 2, max))
else return(apply(abs(b-a)^d, 2, sum)^(1/d)).

Minkowski distance for sites from e1 subset with the exponent d=1 is equal to rhoMe1=2.

Forming cluster ends with the exhaustion of accessible sites in Moore (1,d)-neighborhood of the current cluster perimeter.

Value

acc

an accessibility matrix for 2D square percolation lattice:
if acc[e]<pN then acc[e] is accessible site;
if acc[e]==1 then acc[e] is non-accessible site;
if acc[e]==2 then acc[e] belongs to a sites cluster.

Author(s)

Pavel V. Moskalev <[email protected]>

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.
[2] Moskalev, P.V. (2014) Estimates of threshold and strength of percolation clusters on square lattices with (1,d)-neighborhood. Computer Research and Modeling, Vol.6, No.3, pp.405–414; in Russian.

See Also

fssi2d, ssi3d, ssi20, ssi30, ssa2d, ssa3d

Examples

set.seed(20120507)
x <- y <- seq(33)
image(x, y, ssi2d(), zlim=c(0,2), 
main="Isotropic (1,1)-cluster")
abline(h=17, lty=2); abline(v=17, lty=2)

Site cluster on Square Isotropic 3D lattice with (1,0)-neighborhood

Description

ssi30() function provides sites labeling of the isotropic cluster on 3D square lattice with von Neumann (1,0)-neighborhood.

Usage

ssi30(x=33, p=0.311608, 
      set=(x^3+1)/2, all=TRUE, shape=c(1,1))

Arguments

x

a linear dimension of 3D square percolation lattice.

p

the relative fractions (0<p)&(p<1) of accessible sites (occupation probability) for percolation lattice.

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 3D square lattice with uniformly weighted sites acc and the constant parameter p.

The isotropic cluster is formed from the accessible sites connected with initial sites subset set.

To form the cluster the condition acc[set+e]<p is iteratively tested for sites of the von Neumann (1,0)-neighborhood e for the current cluster perimeter set.

Von Neumann (1,0)-neighborhood on 3D square lattice consists of sites, only one coordinate of which is different from the current site by one: e=c(-1, 1, -x, x, -x^2, x^2).

Forming cluster ends with the exhaustion of accessible sites in von Neumann (1,0)-neighborhood of the current cluster perimeter.

Value

acc

an accessiblity matrix for 3D square percolation lattice:
if acc[e]<p then acc[e] is accessible site;
if acc[e]==1 then acc[e] is non-accessible site;
if acc[e]==2 then acc[e] belongs to a sites cluster.

Author(s)

Pavel V. Moskalev

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.
[2] Moskalev, P.V. (2013) The structure of site percolation models on three-dimensional square lattices. Computer Research and Modeling, Vol.5, No.4, pp.607–622; in Russian.

See Also

fssi30, ssi20, ssa20, ssa30, ssi2d, ssi3d

Examples

# Example No.1. Axonometric projection of 3D cluster
require(lattice)
set.seed(20120507)
x <- y <- z <- seq(33)
cls <- which(ssi30(p=.285)>1, arr.ind=TRUE)
cloud(cls[,3] ~ cls[,1]*cls[,2],
xlim=range(x), ylim=range(y), zlim=range(z), 
col=rgb(1,0,0,0.4), xlab="x", ylab="y", zlab="z", main.cex=1,
main="Isotropic (1,0)-cluster")

# Example No.2. Z=17 slice of 3D cluster
set.seed(20120507)
cls <- ssi30(p=.285)
x <- y <- z <- seq(33)
image(x, y, cls[,,17], zlim=c(0,2), cex.main=1, 
main="Z=17 slice of an isotropic (1,0)-cluster")
abline(h=17, lty=2); abline(v=17, lty=2)

Site cluster on Square Isotropic 3D lattice with (1,d)-neighborhood

Description

ssi3d() function provides sites labeling of the isotropic cluster on 3D square lattice with Moore (1,d)-neighborhood.

Usage

ssi3d(x=33, p0=0.2, p1=p0/2, p2=p0/3, 
      set=(x^3+1)/2, all=TRUE, shape=c(1,1))

Arguments

x

a linear dimension of 3D square percolation lattice.

p0

a relative fraction (0<p0)&(p0<1) of accessible sites (occupation probability) for percolation lattice.

p1

p0 value, weighted by Minkowski distance: p1=p0/rhoMe1.

p2

p0 value, weighted by Minkowski distance: p2=p0/rhoMe2.

set

a vector of linear indexes of a starting sites subset.

all

logical; if all=TRUE, mark all sites from a starting subset; if all=FALSE, mark only accessible sites from a starting subset.

shape

a vector with two shape parameters of beta-distributed random variables, weighting the percolation lattice sites.

Details

The percolation is simulated on 3D square lattice with uniformly weighted sites acc and the constant parameters p0, p1, and p2.

The isotropic cluster is formed from the accessible sites connected with initial sites subset set.

To form the cluster the condition acc[set+eN]<pN is iteratively tested for sites of the Moore (1,d)-neighborhood eN for the current cluster perimeter set, where eN is equal to e0, e1 or e2 vector; pN is equal to p0, p1 or p2 value.

Moore (1,d)-neighborhood on 3D square lattice consists of sites, at least one coordinate of which is different from the current site by one: e=c(e0,e1,e2), where
e0=c(-1, 1, -x, x, -x^2, x^2);
e1=colSums(matrix(e0[c(1,3, 2,3, 1,4, 2,4, 1,5, 2,5, 1,6, 2,6, 3,5, 4,5, 3,6, 4,6)], nrow=2));
e2=colMeans(matrix(p0[c(1,3,5, 2,3,5, 1,4,5, 2,4,5, 1,3,6, 2,3,6, 1,4,6, 2,4,6)], nrow=3)).

Minkowski distance between sites a and b depends on the exponent d:
rhoM <- function(a, b, d=1)
if (is.infinite(d)) return(apply(abs(b-a), 2, max))
else return(apply(abs(b-a)^d, 2, sum)^(1/d)).

Minkowski distance for sites from e1 and e2 subsets with the exponent d=1 is equal to rhoMe1=2 and rhoMe2=3.

Forming cluster ends with the exhaustion of accessible sites in Moore (1,d)-neighborhood of the current cluster perimeter.

Value

acc

an accessibility matrix for 3D square percolation lattice:
if acc[e]<pN then acc[e] is accessible site;
if acc[e]==1 then acc[e] is non-accessible site;
if acc[e]==2 then acc[e] belongs to a sites cluster.

Author(s)

Pavel V. Moskalev

References

[1] Moskalev, P.V. Percolation modeling of porous structures. Moscow: URSS, 2018. 240 pp; in Russian.
[2] Moskalev, P.V. (2013) The structure of site percolation models on three-dimensional square lattices. Computer Research and Modeling, Vol.5, No.4, pp.607–622; in Russian.

See Also

fssi3d, ssi2d, ssi20, ssi30, ssa2d, ssa3d

Examples

# Example No.1. Axonometric projection of 3D cluster
require(lattice)
set.seed(20120507)
x <- y <- z <- seq(33)
cls <- which(ssi3d(p0=.285)>1, arr.ind=TRUE)
cloud(cls[,3] ~ cls[,1]*cls[,2],
xlim=range(x), ylim=range(y), zlim=range(z), 
col=rgb(1,0,0,0.4), xlab="x", ylab="y", zlab="z", main.cex=1,
main="Isotropic (1,1)-cluster")

# Example No.2. Z=17 slice of 3D cluster
set.seed(20120507)
cls <- ssi3d(p0=.285)
x <- y <- z <- seq(33)
image(x, y, cls[,,17], zlim=c(0,2), cex.main=1, 
main="Z=17 slice of an isotropic (1,1)-cluster")
abline(h=17, lty=2); abline(v=17, lty=2)