R/autocatalytic_network.R, R/chemistry.R
autocatalytic_network.RdCreates a random network of molecular types where some molecules catalyze the production of others. This simplified model is useful for visualizing how mutually reinforcing chemical systems may grow.
Creates a random network of molecular types where some molecules catalyze the production of others. This simplified model is useful for visualizing how mutually reinforcing chemical systems may grow.
autocatalytic_network(
n_types = 10,
steps = 100,
catalysis_probability = 0.15,
base_rate = 0.05,
catalytic_boost = 0.1,
decay_rate = 0.02,
seed = NULL
)
autocatalytic_network(
n_types = 10,
steps = 100,
catalysis_probability = 0.15,
base_rate = 0.05,
catalytic_boost = 0.1,
decay_rate = 0.02,
seed = NULL
)Number of molecular types.
Number of simulation steps.
Probability that one molecule type catalyzes another.
Baseline production rate.
Additional production rate from catalysts.
Fraction of each molecule type lost per step.
Optional random seed.
A list containing a time-series tibble and the catalysis matrix.
A list containing a time-series tibble and the catalysis matrix.
net <- autocatalytic_network(n_types = 5, steps = 20, seed = 2)
head(net$time_series)
#> # A tibble: 6 × 3
#> step molecule abundance
#> <int> <chr> <dbl>
#> 1 0 M1 0.540
#> 2 0 M2 0.234
#> 3 0 M3 0.421
#> 4 0 M4 0.966
#> 5 0 M5 0.219
#> 6 1 M1 0.579
net <- autocatalytic_network(n_types = 5, steps = 20, seed = 2)
head(net$time_series)
#> # A tibble: 6 × 3
#> step molecule abundance
#> <int> <chr> <dbl>
#> 1 0 M1 0.540
#> 2 0 M2 0.234
#> 3 0 M3 0.421
#> 4 0 M4 0.966
#> 5 0 M5 0.219
#> 6 1 M1 0.579