library(photosynthesis)
# Use photosynthesis() to simulate 'real' values
# `replace = ...` sets parameters to meet assumptions of `simulate_error()`
lp = make_leafpar(replace = list(
g_sc = set_units(0.1, mol/m^2/s),
g_uc = set_units(0, mol/m^2/s),
k_mc = set_units(0, 1),
k_sc = set_units(0, 1),
k_uc = set_units(0, 1)
),
use_tealeaves = FALSE)
ep = make_enviropar(replace = list(
wind = set_units(Inf, m/s)
), use_tealeaves = FALSE)
bp = make_bakepar()
cs = make_constants(use_tealeaves = FALSE)
chamber_pars = data.frame(
flow = set_units(600, umol / s),
leaf_area = set_units(6, cm ^ 2),
sigma_CO2_s = 0.1,
sigma_CO2_r = 0.1,
sigma_H2O_s = 0.1,
sigma_H2O_r = 0.1
)
ph = photosynthesis(lp, ep, bp, cs, use_tealeaves = FALSE, quiet = TRUE) |>
simulate_error(chamber_pars, n = 1L)
Run the code above in your browser using DataLab