# Create an auxiliary for an intermediate calculation
sfm <- stockflow() |>
stock(population, eqn = 100) |>
constant(carrying_capacity, eqn = 1000) |>
auxiliary(density, eqn = population / carrying_capacity, label = "Density")
Run the code above in your browser using DataLab