# Rafael de Souza, UNC
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License version 3 as published by
#the Free Software Foundation.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
# A copy of the GNU General Public License is available at
# http://www.r-project.org/Licenses/
#
#' @title Estimate reaction rates
#' @description Calculate numerical reaction rates
#' @aliases NumRateHe3ag
#' @usage NumRateHe3ag(a.scale = a.scale,T9 = T9)
#' @format \describe{
#' \item{x}{
#' The function has two arguments: a.scale, T9}
#' }
#' @param a.scale a.scale
#' @param T9 T9
#' @return nuclear_rate
#' @examples
#' library(nuclear)
#'
#' NumRateHe3ag(1,1)
#'
#' @author Rafael de Souza, UNC, and Christian Illiadis, UNC
#'
#' @keywords Nuclear rate
#' @export
#'
#'
NumRateHe3ag <- Vectorize(function(a.scale,T9){
# Constants
M0 = 3.0160293; M1 = 4.001506179127; # masses (amu) of p and d
Z0 = 2; Z1 = 2 ; # charges of t and d
# DEFINITIONS
mue <- (M0*M1)/(M0 + M1) # Reduced Center of Mass
dpieta <- function(E){0.98951013*Z0*Z1*sqrt(mue/E)} # 2 pi eta
# ----------------------------------------------------
# Integrand
# ----------------------------------------------------
integrand <- function(E,T9) {exp(-dpieta(E))*sfactorHe3ag(E,a.scale)*exp(-E/(0.086173324*T9))}
# Integrand, this means that we are looking at Gamow*S-factor*Boltzmann Factor
# CALCULATE Nuclear rate
Nasv <- function(Temp){(3.7318e10/Temp^{3/2})*sqrt(1/mue)*integrate(integrand, lower = 1e-5, upper = 3,
abs.tol = 0L,T9 = Temp)$value}
# Note to self, the limits of integration, in some sense, the scale should be appropriate.
# From HELP, the first argument MUST BE integrated. The optional argument T9 is used to be substituted in
# Nasv <-> N A <sigma v >
out <- Nasv(T9)
return(Nasv=out)
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.