# Cross section
x <- c(-0.85, 3, 15, 18.85)
z <- c(3.85, 0, 0, 3.85)
cs<- CSarbitrary(x = x, z = z, xb_l = 3, xb_r = 15,
kSt_B = 45)
# Channel
flow_max_freeboard(cs, sigma_wz = 0.3, fv = FALSE, J = 2.2 * 10^-2)
# Dam
flow_max_freeboard(cs, sigma_wz = 0.3, fv = TRUE, J = 2.2 * 10^-2)
# Bridge
flow_max_freeboard(cs, sigma_wz = 0.3, fv = TRUE, ft = 0.5,
J = 2.2 * 10^-2)
# Sensitivity analysis for slope
J <- seq(1, 3, 0.1) * 10^-2
Q <- sapply(J, function(J) {
flow_max_freeboard(cs, sigma_wz = 0.3, fv = TRUE, ft = 0.5,
J = J)$Qmax
})
plot(J, Q, type = "l")
Run the code above in your browser using DataLab