library(iemisc)
library(iemiscdata)
# The equations used in this function were solved analytically after
# following these steps:
library(rSymPy) # review the package to determine its system dependencies
Q <- Var("Q")
n <- Var("n")
k <- Var("k")
Sf <- Var("Sf")
y <- Var("y")
b <- Var("b")
# Simplify with rSymPy
eqsimp <- sympy("expr = n*Q*(b+2*y)**(2/3)-k*(b*y)**(5/3)*sqrt(Sf)")
# eqsimp is "Q*n - b*k*y*Sf**(1/2)"
# This is the equation that was used to solve for the missing variables
# Modified Exercise 4.1 from Sturm (page 153)
Manningrect(Q = 3000, b = 60, Sf = 0.002, n = 0.025, units = "Eng")
# Q = 3000 cfs, b = 60 ft, Sf = 0.002 ft/ft, n = 0.025, units = English
# units
# This will solve for y since it is missing and y will be in ft
# Modified Exercise 4.5 from Sturm (page 154)
Manningrect(Q = 950, b = 45, Sf = 0.022, n = 0.023, units = "SI")
# Q = 950 m^3/s, b = 45 m, Sf = 0.022 m/m, n = 0.023, units = SI units
# This will solve for y since it is missing and y will be in m
# Modified Exercise 4.5 from Sturm (page 154)
# See \\code{\\link[iemiscdata]{nchannel}} for the Manning's n table that the
# following example uses
# Use the normal Manning's n value for 1) Natural streams - minor streams
# (top width at floodstage < 100 ft), 2) Mountain streams, no vegetation
# in channel, banks usually steep, trees and brush along banks submerged at
# high stages and 3) bottom: gravels, cobbles, and few boulders.
data(nchannel)
nlocation <- grep("bottom: gravels, cobbles, and few boulders",
nchannel$"Type of Channel and Description")
n <- nchannel[nlocation, 3] # 3 for column 3 - Normal n
Manningtrap(Q = 950, b = 10, m = 2, Sf = 0.022, n = n, units = "SI")
# Q = 950 m^3/s, b = 10 m, m = 2, Sf = 0.022 m/m, n = 0.04, units = SI
# units
# This will solve for y since it is missing and y will be in m
Run the code above in your browser using DataLab