simulate_Isingland {Isinglandr} | R Documentation |
Simulate a 2D Ising landscape
Description
Perform a numeric simulation using the landscape. The simulation is performed
using a similar algorithm as Glauber dynamics, that the transition possibility
is determined by the difference in the potential function, and the steady-state
distribution is the same as the Boltzmann distribution (if not setting beta2
).
Note that, the conditional transition possibility of this simulation
may be different from Glauber dynamics or other simulation methods.
Usage
simulate_Isingland(l, ...)
## S3 method for class ''2d_Isingland''
simulate_Isingland(
l,
mode = "single",
initial = 0,
length = 100,
beta2 = l$beta,
...
)
## S3 method for class ''2d_Isingland_matrix''
simulate_Isingland(
l,
mode = "single",
initial = 0,
length = 100,
beta2 = NULL,
...
)
Arguments
l |
An |
... |
Not in use. |
mode |
One of |
initial |
An integer indicating the initial number of active nodes for the simulation. Float numbers will be converted to an integer automatically. |
length |
An integer indicating the simulation length. |
beta2 |
The |
Details
In each simulation step, the system can have one more active node, one less active node, or the same number of active nodes (if possible; so if all nodes are already active then it is not possible to have one more active node). The possibility of the three cases is determined by their potential function:
P(n_{t}=b|n_{t-1}=a) = \frac{e^{-\beta U(b)}}{\sum_{i \in \{a-1,a,a+1\},0\leq i\leq N}e^{-\beta U(i)}}, \ \mathrm{if} \ b\in\{a-1,a,a+1\}\ \&\ 0\leq i\leq N; 0, \mathrm{otherwise},
where n_{t}
is the number of active nodes at the time t
, and
U(n)
is the potential function.
Value
A sim_Isingland
object with the following components:
-
output
A tibble of the simulation output. -
landscape
The landscape object supplied to this function. -
mode
A character representing the mode of the simulation.
Examples
Nvar <- 10
m <- rep(0, Nvar)
w <- matrix(0.1, Nvar, Nvar)
diag(w) <- 0
result1 <- make_2d_Isingland(m, w)
plot(result1)
set.seed(1614)
sim1 <- simulate_Isingland(result1, initial = 5)
plot(sim1)