knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>", 
  fig.width = 8, 
  fig.height = 5
)
library(MEMC)
library(ggplot2)
theme_set(theme_bw(base_size = 14))

The memc_configure function allows users to build their own SOM model. All of the MEMC models use the same SOM pool structure but users will be able to decide which of the following dynamics.

The memc_configure function allows users to build their own SOM model. All of the MEMC models use the same SOM pool structure but users will be able to decide which of the formulations (LM, MM, RMM, ECA, or DD) are used for POM decomposition (1), DOM uptake (2), and microbial biomass decay (3). The following example will demonstrate how changing the DOM uptake flux impacts the model projections.

Set up the model configuration using the default paramaters and inital carbon pool values.

# Running memc_configure will print a table describing the model configuration. 
mod1 <- memc_configure(params = memc_params, 
                            state = memc_initial_state, 
                            name = "Model 1", 
                            DOMuptake = "MM", 
                            POMdecomp = "LM", 
                            MBdecay = "LM")

Take a look at all the details of the new model configuraiton

print(mod1)

or the summary table of the dynamics being used.

summary(mod1)

Use memc_solve to run our model.

mod1_out <- memc_solve(mod = mod1, time = 0:50)
head(mod1_out)

Now switch the DOM uptake to use the RMM dynamics.

# Running memc_configure will print a table describing the model configuration. 
mod2 <- memc_configure(params = memc_params, 
                            state = memc_initial_state, 
                            name = "Model 2", 
                            DOMuptake = "RMM", 
                            POMdecomp = "LM", 
                            MBdecay = "LM")
mod2_out <- memc_solve(mod = mod2, time = 0:50)

Now try setting the DOM uptake to ECA dynamics.

# Running memc_configure will print a table describing the model configuration. 
mod3 <- memc_configure(params = memc_params, 
                            state = memc_initial_state, 
                            name = "Model 3", 
                            DOMuptake = "ECA", 
                            POMdecomp = "LM", 
                            MBdecay = "LM")
mod3_out <- memc_solve(mod = mod3, time = 0:50)

Compare the model results with one another.

plot(rbind(mod1_out, mod2_out, mod3_out))

For more examples and tutorials please see our online documentation.



Microbial-Explicit-Model/MEMC documentation built on April 12, 2025, 12:50 p.m.