This sensor from TPF collection
Article | |
---|---|
Collibration | |
Precision | |
Ranges | |
Renew sensors |
source("utilities_tpf.r"); sensors.p.grt_hbl_pl_qtz_kohn_spear_1989_c <- function(Grt, Hbl, Pl, Qtz, Temp, ...){ T <- Temp; Pl <- tpf.recalc_minaral("PL",Pl); Grt <- tpf.recalc_minaral("GRT",Grt); Hbl <- tpf.recalc_minaral("HBL",Hbl); PG <- Grt$Mg_pfu / (Grt$Mg_pfu + Grt$Fe_p2_pfu + Grt$Fe_p3_pfu + Grt$Mn_pfu + Grt$Ca_pfu); AG <- (Grt$Fe_p2_pfu + Grt$Fe_p3_pfu) / (Grt$Fe_p2_pfu + Grt$Fe_p3_pfu + Grt$Mg_pfu + Grt$Mn_pfu + Grt$Ca_pfu); SG <- Grt$Mn_pfu / (Grt$Mg_pfu + Grt$Fe_p2_pfu + Grt$Fe_p3_pfu + Grt$Mn_pfu + Grt$Ca_pfu); GG <- Grt$Ca_pfu / (Grt$Mg_pfu + Grt$Fe_p2_pfu + Grt$Fe_p3_pfu + Grt$Mn_pfu + Grt$Ca_pfu); AN <- Pl$Ca_pfu / (Pl$Ca_pfu + Pl$Na_pfu + Pl$K_pfu); AB <- Pl$Na_pfu / (Pl$Ca_pfu + Pl$Na_pfu + Pl$K_pfu); MPRG1 <- 4 * Hbl$Al_c6_pfu / 2 * (2 - Hbl$Al_c6_pfu - Hbl$Ti_pfu - Hbl$Cr_pfu - Hbl$Fe_p3_pfu) * Hbl$Mg_pfu / (Hbl$Fe_p2_pfu + Hbl$Fe_p3_pfu + Hbl$Mg_pfu) / 2; MPRG2 <- (Hbl$Si_pfu + Hbl$Al_c4_pfu + Hbl$Al_c6_pfu + Hbl$Ti_pfu + Hbl$Cr_pfu + Hbl$Fe_p2_pfu + Hbl$Fe_p3_pfu + Hbl$Mn_pfu + Hbl$Mg_pfu + Hbl$Ca_pfu + Hbl$Na_pfu - 15); MTR1 <- (1 - (Hbl$Si_pfu + Hbl$Al_c4_pfu + Hbl$Al_c6_pfu + Hbl$Ti_pfu + Hbl$Cr_pfu + Hbl$Fe_p2_pfu + Hbl$Fe_p3_pfu + Hbl$Mn_pfu + Hbl$Mg_pfu + Hbl$Ca_pfu + Hbl$Na_pfu - 15) - Hbl$K_pfu); MTR2 <- ((2 - Hbl$Al_c6_pfu - Hbl$Ti_pfu - Hbl$Cr_pfu - Hbl$Fe_p3_pfu) * Hbl$Mg_pfu / (Hbl$Fe_p2_pfu + Hbl$Fe_p3_pfu + Hbl$Mg_pfu) / 2)^2; MNN <- Hbl$Ca_pfu; MGG <- Hbl$Ti_pfu; NAH <- Hbl$Na_pfu; KH <- Hbl$K_pfu; ALH <- Hbl$Al_c4_pfu + Hbl$Al_c6_pfu; XH <- (Hbl$Fe_p3_pfu + Hbl$Fe_p2_pfu) / (Hbl$Fe_p2_pfu + Hbl$Fe_p3_pfu + Hbl$Mg_pfu); MPRG <- MPRG1 * MPRG2; MTR <- MTR1 * MTR2; TT <- T + 273; AP <- (PG * exp((13800 - 6.28 * TT) * (GG^2 + AG * GG + GG * SG) / 8.314 / TT))^3; AGR <- (GG * exp((13800 - 6.28 * TT) * (PG^2 + AG * PG + PG * SG) / 8.314 / TT))^3; AAN <- AN * exp(610.34 / TT - 0.3837); K1 <- (AGR^2 * AP * MPRG^3) / (AAN^6 * AB^3 * MTR^3); if (XH<0.7) { if (XH>0.4) { P <- (44724 + TT * (51.9 + 8.314 * log(K1))) / 9190; warning("MG-EQUIVALENT OF BAROMETRY, HBL ACTIVITY- MODEL 2"); } if (XH>0.7) { warning(" ONLY FOR FE/(FE+MG) IN HBL <0.7"); } if (XH<0.4) { warning(" ONLY FOR FE/(FE+MG) IN HBL >0.4"); } if (KH>0.4001) { warning(" ONLY FOR K IN HBL <0.4"); } if (NAH>0.6001) { warning(" ONLY FOR NA IN HBL <0.6"); } if (NAH<0.2999) { warning(" ONLY FOR NA IN HBL >0.3"); } if (ALH>3.75001) { warning(" ONLY FOR AL IN HBL <3.75"); } if (ALH<1.8999) { warning(" ONLY FOR AL IN HBL >1.9"); } if (MGG>0.274) { warning(" ONLY FOR TI IN HBL <0.275"); } if (MNN<1.499) { warning(" ONLY FOR CA IN HBL >1.5"); } if (AN>0.75) { warning(" ONLY FOR CA/(CA+NA+K) IN PL <0.75"); } if (AN<0.15) { warning(" ONLY FOR CA/(CA+NA+K) IN PL >0.15"); } if (SG>0.15) { warning(" ONLY FOR MN/(CA+FE+MG+MN) IN GRT <0.15"); } } return(data.frame(Name=paste0(Pl$Name,"-", Hbl$Name,"-", Grt$Name),Temp=Temp,P_calc=P)); } sensors.p.grt_hbl_pl_qtz_kohn_spear_1989_c.args <- function(){ ars <- list(); ars$minerals <- c("Grt", "Hbl", "Pl", "Qtz"); ars$ranges <- c("Temp"); return(ars); } #sensors.p.grt_hbl_pl_qtz_kohn_spear_1989_c.test <- function(){ # #}