This sensor from TPF collection
Article | |
---|---|
Collibration | |
Precision | |
Ranges | |
Renew sensors |
source("utilities_tpf.r"); sensors.p.grt_pl_qtz_sil_bhattacharya_1985 <- function(Grt, Pl, Qtz, Sil, Temp, ...){ T <- Temp; Pl <- tpf.recalc_minaral("PL",Pl); Grt <- tpf.recalc_minaral("GRT",Grt); X <- Grt$Ca_pfu / (Grt$Mg_pfu + Grt$Ca_pfu + Grt$Mn_pfu + Grt$Fe_p2_pfu + Grt$Fe_p3_pfu); Y <- Grt$Mg_pfu / (Grt$Mg_pfu + Grt$Ca_pfu + Grt$Mn_pfu + Grt$Fe_p2_pfu + Grt$Fe_p3_pfu); Z <- (Grt$Fe_p2_pfu + Grt$Fe_p3_pfu) / (Grt$Mg_pfu + Grt$Ca_pfu + Grt$Mn_pfu + Grt$Fe_p2_pfu + Grt$Fe_p3_pfu); M <- Grt$Mn_pfu / (Grt$Mg_pfu + Grt$Ca_pfu + Grt$Mn_pfu + Grt$Fe_p2_pfu + Grt$Fe_p3_pfu); N <- Pl$Ca_pfu / (Pl$Ca_pfu + Pl$Na_pfu + Pl$K_pfu); if (X<0.04) { if (M<0.03) { TT <- T + 273; A <- X * exp((3300 - 1.5 * TT) * (Y^2 + Y * Z) / TT / 1.9872); B <- N * (1 + N)^2 / 4 * exp((2050 + 9392 * N) * (1 - N)^2 / 1.9872 / TT); P <- 41.84 / (45.5 * X - 58.7) * (( - 1.17 + 0.0238 * T) * 1000 * ( - 1.305) - 5.962 * TT * log(A / B)) / 1000; } } if (X>0.04) { warning(" CANNOT BE USED FOR CA/(CA+MG+FE+MN) IN GRT > 0.04"); } if (M>0.03) { warning(" CANNOT BE USED FOR MN/(CA+MG+FE+MN) IN GRT > 0.03"); } return(data.frame(Name=paste0(Pl$Name,"-", Grt$Name),Temp=Temp,P_calc=P)); } sensors.p.grt_pl_qtz_sil_bhattacharya_1985.args <- function(){ ars <- list(); ars$minerals <- c("Grt", "Pl", "Qtz", "Sil"); ars$ranges <- c("Temp"); return(ars); } #sensors.p.grt_pl_qtz_sil_bhattacharya_1985.test <- function(){ # #}