diff --git a/R/define_inputs.R b/R/define_inputs.R index bf5f39f..217a0d2 100644 --- a/R/define_inputs.R +++ b/R/define_inputs.R @@ -1,4 +1,4 @@ -#' make a list of bird parameters for input into CRM +#' Make a list of bird parameters for input into CRM #' #' Makes a list of avian biological parameters for the bird(s) being modelled #' as a function directly in R. This function is designed for R-based workflows. @@ -15,8 +15,7 @@ #' - a single number representing the average (preferably median) of the #' variable # -#' @returns list where items define the value or stochastic distribution f -#' or each parameter +#' @returns list whose items define the value or stochastic distribution for each parameter #' #' @param species char; species identifier #' @param bird_length Length of archetype bird (metres), or distribution @@ -82,9 +81,9 @@ define_bird <- function( #' define_turbine #' -#' make a list of turbine parameters for input into the default CRM +#' Make a list of turbine parameters for input into the default CRM. #' -#' Makes a list of parameters for the a given turbine +#' Makes a list of parameters for the a given turbine. #' #' # Details #' @@ -95,13 +94,17 @@ define_bird <- function( #' up stochastic inputs. #' - a single number representing the average (preferably median) of the #' variable +#' +#' If this object is being defined for multiple turbines of the same model +#' `prop_operational` should be the average between all turbines. For example +#' if there are two turbines, and one is operational for 24 hours while the other +#' is operational for 18 hours each day, then `prop_operational = (0.75 + 1)/2 = 0.875`. #' #' -#' @returns list where items define the value or stochastic distribution for +#' @returns list whose items define the value or stochastic distribution for #' each parameter #' -#' @param model_id character; Label for turbine model - allows the user to -#'define multiple turbine types on a site +#' @param model_id character; Label for turbine model #' @param blade_length blade length (m) #' @param blade_thickness_narrow the thickness of the blade (side on) at its thinnest point (m) #' @param blade_thickness_wide the thickness of the blade (side on) at its widest point (m) diff --git a/R/p_collision.R b/R/p_collision.R index c735994..805ec5a 100644 --- a/R/p_collision.R +++ b/R/p_collision.R @@ -146,6 +146,9 @@ prob_collision_static <- function( #' @param bird_speed numeric; Average flight speed (m/sec) #' @param prop_at_height proportion of flights at rotor swept height #' @param prop_below_height proportion of flights below rotor swept height +#' @param prop_operational numeric; Proportion of a 24 hour day that turbines +#' are operational. A single number or distribution information using +#' [set_random]. Default 1. See [define_turbine()] for more detail. #' #' @return numeric; probability of collision with leading edge of blade. #' Range from 0 to 1 @@ -179,7 +182,8 @@ prob_collision_dynamic <- function( bird_length, bird_speed, prop_at_height, - prop_below_height + prop_below_height, + prop_operational = 1 ) { stopifnot( @@ -209,5 +213,5 @@ prob_collision_dynamic <- function( presented_area <- presented_area * prop_at_height / (prop_at_height+prop_below_height) - return(presented_area/turbine_plane_area) + return(presented_area/turbine_plane_area*prop_operational) } \ No newline at end of file diff --git a/man/define_bird.Rd b/man/define_bird.Rd index 727f115..354d9ac 100644 --- a/man/define_bird.Rd +++ b/man/define_bird.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/define_inputs.R \name{define_bird} \alias{define_bird} -\title{make a list of bird parameters for input into CRM} +\title{Make a list of bird parameters for input into CRM} \usage{ define_bird( species, @@ -33,8 +33,7 @@ the bird is active onsite} \item{avoidance_static}{avoidance rate relative to a static turbine} } \value{ -list where items define the value or stochastic distribution f -or each parameter +list whose items define the value or stochastic distribution for each parameter } \description{ Makes a list of avian biological parameters for the bird(s) being modelled diff --git a/man/define_turbine.Rd b/man/define_turbine.Rd index 9df9f33..798e9de 100644 --- a/man/define_turbine.Rd +++ b/man/define_turbine.Rd @@ -25,8 +25,7 @@ define_turbine( ) } \arguments{ -\item{model_id}{character; Label for turbine model - allows the user to -define multiple turbine types on a site} +\item{model_id}{character; Label for turbine model} \item{blade_length}{blade length (m)} @@ -63,14 +62,14 @@ are operational. A single number or distribution information using \link{set_random}. Default 1} } \value{ -list where items define the value or stochastic distribution for +list whose items define the value or stochastic distribution for each parameter } \description{ -make a list of turbine parameters for input into the default CRM +Make a list of turbine parameters for input into the default CRM. } \details{ -Makes a list of parameters for the a given turbine +Makes a list of parameters for the a given turbine. } \section{Details}{ Each input to this function must be either @@ -81,6 +80,11 @@ up stochastic inputs. \item a single number representing the average (preferably median) of the variable } + +If this object is being defined for multiple turbines of the same model +\code{prop_operational} should be the average between all turbines. For example +if there are two turbines, and one is operational for 24 hours while the other +is operational for 18 hours each day, then \code{prop_operational = (0.75 + 1)/2 = 0.875}. } \examples{ diff --git a/man/prob_collision_dynamic.Rd b/man/prob_collision_dynamic.Rd index bd01c12..bcf27da 100644 --- a/man/prob_collision_dynamic.Rd +++ b/man/prob_collision_dynamic.Rd @@ -15,7 +15,8 @@ prob_collision_dynamic( bird_length, bird_speed, prop_at_height, - prop_below_height + prop_below_height, + prop_operational = 1 ) } \arguments{ @@ -40,6 +41,10 @@ prob_collision_dynamic( \item{prop_at_height}{proportion of flights at rotor swept height} \item{prop_below_height}{proportion of flights below rotor swept height} + +\item{prop_operational}{numeric; Proportion of a 24 hour day that turbines +are operational. A single number or distribution information using +\link{set_random}. Default 1. See \code{\link[=define_turbine]{define_turbine()}} for more detail.} } \value{ numeric; probability of collision with leading edge of blade. diff --git a/vignettes/deterministic-example.Rmd b/vignettes/deterministic-example.Rmd index 5c6eff6..a05a72f 100644 --- a/vignettes/deterministic-example.Rmd +++ b/vignettes/deterministic-example.Rmd @@ -345,7 +345,8 @@ df_turbines$p_coll_dyn <- prob_collision_dynamic( bird_length = wte$bird_length, bird_speed = wte$bird_speed, prop_at_height = prop_at_height, - prop_below_height = prop_below_height + prop_below_height = prop_below_height, + prop_operational = v90_single$prop_operational ) diff --git a/vignettes/one-bird-one-turbine.Rmd b/vignettes/one-bird-one-turbine.Rmd index ac3e36d..5fe7809 100644 --- a/vignettes/one-bird-one-turbine.Rmd +++ b/vignettes/one-bird-one-turbine.Rmd @@ -117,7 +117,8 @@ p_coll_dyn <- prob_collision_dynamic( bird_length = wte$bird_length, bird_speed = wte$bird_speed, prop_at_height = 0.75, - prop_below_height = 0.2 + prop_below_height = 0.2, + prop_operational = v90_single$prop_operational ) p_coll_dyn + p_coll_static diff --git a/vignettes/simple-simulation-example.Rmd b/vignettes/simple-simulation-example.Rmd index 537673c..e8f2558 100644 --- a/vignettes/simple-simulation-example.Rmd +++ b/vignettes/simple-simulation-example.Rmd @@ -490,7 +490,8 @@ lst_results <- lapply(1:iterations, function(i) { bird_length = bird_i$bird_length, bird_speed = bird_i$bird_speed, prop_at_height = prop_at_height1_i, - prop_below_height = prop_below_height1_i + prop_below_height = prop_below_height1_i, + prop_operational = turbines1_i$prop_operational ) df_turbines_results[df_turbines_results$model == "Turbine 150", @@ -505,7 +506,8 @@ lst_results <- lapply(1:iterations, function(i) { bird_length = bird_i$bird_length, bird_speed = bird_i$bird_speed, prop_at_height = prop_at_height2_i, - prop_below_height = prop_below_height2_i + prop_below_height = prop_below_height2_i, + prop_operational = turbines2_i$prop_operational )