fssa2d {SPSL} | R Documentation |
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 |
p1 |
averaged double combinations of |
set |
a vector of linear indexes of a starting sites subset. |
all |
logical; if |
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 <moskalefff@gmail.com>
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)