R/Nq.R

#' Bearing capacity factor Nq
#' @description Taken from "geotech" package. Calculate the bearing capacity factor Nq using either the Terzaghi or Vesic methods.
#' @param phi Friction angle in degrees
#' @param case "general" or "local" to indicate general or local shear failure ("general" is default)
#' @param method "Terzaghi" or "Vesic" ("Terzaghi" is default)
#'
#' @return Bearing capacity factor
#' @export
#'
#' @references Coduto, D.P., Kitch, W.A., and Yeung, M.R. (2016). Foundation Design: Principles and Practices, Pearson, Boston.
#' @references Terzaghi, K. (1943). Theoretical Soil Mechanics, John Wiley, New York
#' @references Vesic, A.S. (1973). Analysis of Ultimate Loads of Shallow Foundations, ASCE Journal of the Soil Mechanics and Foundations Division, Vol. 99, No. SM1, pp. 45-73.
#'
#' @examples
#' Nq(phi = 20, case = "local", method = "Terzaghi")
#'
Nq = function (phi, case = "general", method = "Terzaghi")
{
  if (case != "general" && case != "local")
    stop("Case may only be 'general' or 'local'.")
  if (method != "Terzaghi" && method != "Vesic")
    stop("Case may only be 'Terzaghi' or 'Vesic'.")
  if (case == "local")
    phi <- atan(2/3 * tan(phi * pi/180)) * 180/pi
  phi.deg <- phi
  phi.rad <- phi * pi/180
  if (method == "Terzaghi") {
    num <- exp(2 * pi * (3/4 - phi.deg/360) * tan(phi.rad))
    den <- 2 * (cos((45 + phi.deg/2) * pi/180))^2
    Nq.value <- num/den
  }
  else {
    if (method == "Vesic") {
      Nq.value <- tan((45 + phi.deg/2) * pi/180)^2 * exp(pi *
                                                           tan(phi.rad))
    }
  }
  return(Nq.value)
}
maxgav13/GMisc documentation built on June 12, 2022, 3:48 a.m.