Различия
Здесь показаны различия между двумя версиями данной страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
sensors:p:grt_cpx_beyer [2017/06/01 13:32] admin |
sensors:p:grt_cpx_beyer [2018/11/12 15:08] (текущий) |
||
---|---|---|---|
Строка 34: | Строка 34: | ||
sensors.p.grt_cpx_beyer <- function(Grt, Cpx, Temp, usePFU = FALSE, ...){ | sensors.p.grt_cpx_beyer <- function(Grt, Cpx, Temp, usePFU = FALSE, ...){ | ||
- | row_names <- paste0(Grt$Name,"-",Cpx$Name); | + | presults <- data.frame(Name = paste0(Grt$Name,"-",Cpx$Name)); |
| | ||
if(!usePFU){ | if(!usePFU){ | ||
Grt <- recalc.grt_nm(Grt); | Grt <- recalc.grt_nm(Grt); | ||
- | Cpx <- recalc.px_nm(Grt); | + | Cpx <- recalc.px_nm(Cpx); |
} | } | ||
| | ||
Строка 98: | Строка 98: | ||
| | ||
Grt$Pyr_RTLn_X3Y2 <- 8.314*T*log(Grt$X_Mg^3); | Grt$Pyr_RTLn_X3Y2 <- 8.314*T*log(Grt$X_Mg^3); | ||
- | Grt$Grs_RTlna_MgAl <- 3*Grt$Pyr_RTg + Grt$Pyr_RTLn_X3Y2; | + | Grt$Pyr_RTlna_MgAl <- 3*Grt$Pyr_RTg + Grt$Pyr_RTLn_X3Y2; |
- | | + | |
- | return(Grt); | + | Cpx$W_MgFe <- 0; |
+ | Cpx$W_MgAl <- 4849; | ||
+ | Cpx$W_FeAl <- 3573; | ||
+ | |||
+ | Cpx$W_CaNa <- 11567; | ||
+ | Cpx$W_MgNa <- -35873; | ||
+ | Cpx$W_FeNa <- 59319; | ||
+ | Cpx$W_CaMg <- 24920; | ||
+ | Cpx$W_CaFe <- -49275; | ||
+ | Cpx$W_FeMg <- 0; | ||
+ | Cpx$W_AlSi <- 7038; | ||
+ | |||
+ | Cpx$Dio_RTLn_XM1XM2Xtet <- 8.314*T*log(Cpx$Ca_M2_pfu*Cpx$Mg_M1_pfu*(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M2 <- Cpx$Dio_RTLn_M2; | ||
+ | |||
+ | Cpx$CaTs_RTLn_M1 <- Cpx$Mg_M1_pfu^2*Cpx$W_MgAl+Cpx$Fe_M1_p2_pfu^2*Cpx$W_FeAl+ | ||
+ | Cpx$Mg_M1_pfu*Cpx$Fe_M1_p2_pfu*(Cpx$W_MgAl+Cpx$W_FeAl-Cpx$W_MgFe); | ||
+ | |||
+ | Cpx$CaTs_RTLn_tet <- Cpx$W_AlSi*(Cpx$Si_pfu/2)^2; | ||
+ | |||
+ | Cpx$CaTs_Recip <- (1-Cpx$Al_M1_pfu)*(Cpx$Fe_M2_pfu*(-21000))- | ||
+ | Cpx$Fe_M1_p2_pfu*(Cpx$Fe_M2_pfu*(-4680)+Cpx$Mg_M2_pfu*(-5010)); | ||
+ | |||
+ | Cpx$CaTs_RTLna_CaAlAl <- Cpx$CaTs_RTLn_XM1XM2Xtet + Cpx$CaTs_RTLn_M2 + Cpx$CaTs_RTLn_M1 + | ||
+ | Cpx$CaTs_RTLn_tet + Cpx$CaTs_Recip; | ||
+ | |||
+ | presults$RTLnK <- Cpx$CaTs_RTLna_CaAlAl +Cpx$Dio_RTLna_CaMgSi -1/3*Grt$Pyr_RTlna_MgAl -2/3*Grt$Grs_RTlna_CaAl; | ||
+ | |||
+ | presults$K <- exp(presults$RTLnK/(8.314*T)); | ||
+ | |||
+ | presults$dGt <- 16500-23.5*T; | ||
+ | |||
+ | presults$P <- -(presults$dGt+8.314*T*log(presults$K))/(0.719*1000); | ||
+ | # if NA -> "no Al4 in cpx!" | ||
+ | |||
+ | return(data.frame(Name = presults$Name, T=Temp, P_calc = presults$P)); | ||
} | } | ||
Строка 115: | Строка 169: | ||
cpx = data.frame(Name='Cpx', Si_pfu=c(1.962), Al_pfu=c(0.244), Fe_p2_pfu=c(0.09), Mg_pfu=c(0.741), Ca_pfu=c(0.783), Na_pfu=c(0.171)); | cpx = data.frame(Name='Cpx', Si_pfu=c(1.962), Al_pfu=c(0.244), Fe_p2_pfu=c(0.09), Mg_pfu=c(0.741), Ca_pfu=c(0.783), Na_pfu=c(0.171)); | ||
| | ||
- | ret = sensors.p.grt_cpx_beyer(grt, cpx, 1000, usePFU = TRUE); | + | ret = sensors.p.grt_cpx_beyer(grt, cpx, 1007, usePFU = TRUE); |
print(ret); | print(ret); | ||
} | } | ||
</Code> | </Code> | ||
+ | {{tag> MA_igroup Grt Cpx fixed}} |