R/inv_LL3.R

Defines functions inv_LL3

Documented in inv_LL3

#' @title Inverse of the dose-response models.
#' @description Built-in the inverse of dose-response models.
#' @param kv_kvs valve position
#' @param b steepness
#' @param d upper value
#' @param e the effective dose
#' @importFrom stats uniroot
#' @return position
#' @export
#' @examples
#' inv_LL3(0.4567872, -2.39, 1.39, 67.42 )
inv_LL3 <- function( kv_kvs, b, d, e ){
  root <- uniroot( function(x){ d/(1+exp(b*(log(x)-log(e))))- kv_kvs} ,
                   lower = 0,
                   upper = 100,
                   tol   = 1e-10)
  return(root$root)
}
ratral/hyd4gpv documentation built on Feb. 5, 2022, 10:30 p.m.