Grt-Cpx: Pattison, Newton, 1989 <C>

Details

This sensor from TPF collection

Article
Collibration
Precision
Ranges
Renew sensors

Использовать Проверить

  • заголовок
  • краткое описание
  • статья
  • ссылка
  • карточка
  • подробное описание
  • код
  • тест

Source

source("utilities_tpf.r");

sensors.t.grt_cpx_pattison_newton_1989_c <- function(Grt, Cpx, P, ...){
    Grt <- tpf.recalc_minaral("GRT2",Grt);
    Cpx <- tpf.recalc_minaral("CPX1",Cpx);
    Cpx <- tpf.recalc_minaral("CPX",Cpx);

    XX <- Grt$Fe_p2_pfu / Grt$Mg_pfu;
    Y <- Grt$Ca_pfu / (Grt$Fe_p2_pfu + Grt$Mg_pfu + Grt$Mn_pfu + Grt$Ca_pfu);
    X <- Grt$Mg_pfu / (Grt$Fe_p2_pfu + Grt$Mg_pfu);
    Z <- Cpx$Fe_p2_pfu / Cpx$Mg_pfu;
    N <- Cpx$Na2O_wtp;
    if (N>2.2) {
    warning(" CANNOT BE USED FOR NA2O IN CPX >2.2 W.");
    }
    if (N<2.2) {
    if (X<0.6) {
    if (X<0.125) {
    warning(" CANNOT BE USED FOR MG/(FE2+MG) IN GRT <0.125 ");
    }
    if (X>0.125) {
    if (Y<0.4) {
    warning(" CANNOT BE USED FOR CA/(FE2+MG+CA+MN) IN GRT <0.4 ");
    }
    if (Y>0.40) {
    if (Y<0.52) {
    F <- 10 * (Y - 0.4);
    A0 <- 14.64 + F * (9.408 - 14.64);
    B0 <-  - 18.72 + F * ( - 12.37 + 18.72);
    C0 <- 6.940 + F * (4.775 - 6.94);
    D0 <-  - 0.2583 + F * ( - 0.2331 + 0.2583);
    A1 <- 44900 + F * (38840 - 44900);
    B1 <-  - 55250 + F * ( - 47880 + 55250);
    C1 <- 18820 + F * (16300 - 18820);
    D1 <- 712 + F * (859 - 712);
    K <- log(XX / Z);
    T <- (A1 * X^3 + B1 * X^2 + C1 * X + D1) / (K + A0 * X^3 + B0 * X^2 + C0 * X + D0) + 5.5 * (P - 15) - 273;
    warning(" ONLY FE2 IS INVOLVED IN CALCULATIONS");
    }
    }
    if (Y>0.52) {
    warning(" CANNOT BE USED FOR CA/(FE2+MG+CA+MN) IN GRT >0.52");
    }
    }
    }
    if (X>0.6) {
    warning(" CANNOT BE USED FOR MG/(FE2+MG) IN GRT > 0.6");
    }
    }
    return(data.frame(Name=paste0(Cpx$Name,"-", Grt$Name),P=P,T_calc=T));
}

sensors.t.grt_cpx_pattison_newton_1989_c.args <- function(){
    ars <- list();
    ars$minerals <- c("Grt", "Cpx");
    ars$ranges <- c("P");
    return(ars);
}

#sensors.t.grt_cpx_pattison_newton_1989_c.test <- function(){
#
#}
, ,