R/z3_gen_lm_mgmt.R

Defines functions gen_lm_mgmt

Documented in gen_lm_mgmt

#' Obtain estimates of U_msy and S_msy given alpha and beta
#'
#' Converts alpha and beta into Smsy and Umsy.
#'
#' @param @alpha a numeric vector representing the alpha parameter from a SRA.
#'   Can be length > 1.
#' @param @beta a numeric vector representing the beta parameter from a SRA.
#'   Can be length > 1.
#' @note The conversion of alpha to U_msy is an approximation, as there is no analytical solution.
#'
#' @export

gen_lm_mgmt = function(alpha, beta) {
  log_alpha = log(alpha)

  U_msy = log_alpha * (0.5 - (0.65 * log_alpha ^1.27)/(8.7 + log_alpha^1.27))
  U_msy[U_msy == "NaN"] = 0
  U_msy[U_msy < 0] = 0
  S_msy = U_msy/beta

  return(list(U_msy = U_msy, S_msy = S_msy))
}
bstaton1/SimSR documentation built on Aug. 20, 2019, 9:43 a.m.