## calculate spectrum (i.e., fig. 1b in Tsai et al., 2012)
p_bedload <- model_bedload(d_s = 0.7,
s_s = 0.1,
r_s = 2650,
q_s = 0.001,
h_w = 4,
w_w = 50,
a_w = 0.005,
f = c(0.1, 20),
r_0 = 600,
f_0 = 1,
q_0 = 20,
e_0 = 0,
v_0 = 1295,
x_0 = 0.374,
n_0 = 1,
res = 100,
eseis = TRUE)
## plot spectrum
plot_spectrum(data = p_bedload,
ylim = c(-170, -110))
## define empiric grain-size distribution
gsd_empiric <- data.frame(d = c(0.70, 0.82, 0.94, 1.06, 1.18, 1.30),
p = c(0.02, 0.25, 0.45, 0.23, 0.04, 0.00))
## calculate spectrum
p_bedload <- model_bedload(gsd = gsd_empiric,
r_s = 2650,
q_s = 0.001,
h_w = 4,
w_w = 50,
a_w = 0.005,
f = c(0.1, 20),
r_0 = 600,
f_0 = 1,
q_0 = 20,
e_0 = 0,
v_0 = 1295,
x_0 = 0.374,
n_0 = 1,
res = 100,
eseis = TRUE)
## plot spectrum
plot_spectrum(data = p_bedload,
ylim = c(-170, -110))
## define mean and sigma for parametric distribution function
d_50 <- 1
sigma <- 0.1
## define raised cosine distribution function following Tsai et al. (2012)
d_1 <- 10^seq(log10(d_50 - 5 * sigma),
log10(d_50 + 5 * sigma),
length.out = 20)
sigma_star <- sigma / sqrt(1 / 3 - 2 / pi^2)
p_1 <- (1 / (2 * sigma_star) *
(1 + cos(pi * (log(d_1) - log(d_50)) / sigma_star))) / d_1
p_1[log(d_1) - log(d_50) > sigma_star] <- 0
p_1[log(d_1) - log(d_50) < -sigma_star] <- 0
p_1 <- p_1 / sum(p_1)
gsd_raised_cos <- data.frame(d = d_1,
p = p_1)
Run the code above in your browser using DataLab