# Compute orbital speed for varying Hs
S <- t(sapply(1:10, function(h) {
jonswap(h)$spec
}))
orb_speeds <- compute_orbital_speeds(S, rscd_freq, depth = 100, z = 10)
plot(1:10, orb_speeds[, 1],
type = "l",
ylim = range(orb_speeds),
xlab = "Hs (m)",
ylab = "Orbital speed RMS (m/s)"
)
lines(1:10, orb_speeds[, 2], type = "l", col = "red")
Run the code above in your browser using DataLab