Common: PTExl3

Calculation from PTExl3 spreadsheet.

Details

Reference TPF
Input P2O5_wtp, SiO2_wtp, TiO2_wtp, Al2O3_wtp, Cr2O3_wtp, V2O3_wtp, Sc2O3_wtp, Fe2O3_wtp, FeO_wtp, MnO_wtp, MgO_wtp, NiO_wtp, CoO_wtp, CaO_wtp, SrO_wtp, Na2O_wtp, K2O_wtp, Li2O_wtp, Rb2O_wtp, CuO_wtp, ZnO_wtp, CdO_wtp, PbO_wtp, SnO2_wtp, ZrO2_wtp, CeO2_wtp, Y2O3_wtp, La2O3_wtp
Results pfu

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

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

Source

recalc.oxygen_ptexl3 <- function (wtp_data, count=12, ...)
{
oxnames <- c('P2O5_wtp','SiO2_wtp', 'TiO2_wtp', 'Al2O3_wtp', 'Cr2O3_wtp',
             'V2O3_wtp', 'Sc2O3_wtp', 'Fe2O3_wtp', 'FeO_wtp', 'MnO_wtp',
             'MgO_wtp', 'NiO_wtp', 'CoO_wtp', 'CaO_wtp', 'SrO_wtp',
             'Na2O_wtp', 'K2O_wtp', 'Li2O_wtp', 'Rb2O_wtp', 'CuO_wtp',
             'ZnO_wtp', 'CdO_wtp', 'PbO_wtp', 'SnO2_wtp', 'ZrO2_wtp',
             'CeO2_wtp', 'Y2O3_wtp', 'La2O3_wtp');

pfunames <- c('P_pfu','Si_pfu', 'Ti_pfu', 'Al_pfu', 'Cr_pfu',
             'V_pfu', 'Sc_pfu', 'Fe_p3_pfu', 'Fe_p2_pfu', 'Mn_pfu',
             'Mg_pfu', 'Ni_pfu', 'Co_pfu', 'Ca_pfu', 'Sr_pfu',
             'Na_pfu', 'K_pfu', 'Li_pfu', 'Rb_pfu', 'Cu_pfu',
             'Zn_pfu', 'Cd_pfu', 'Pb_pfu', 'Sn_pfu', 'Zr_pfu',
             'Ce_pfu', 'Y_pfu', 'La_pfu');
             
oxwt    <- c(70.9738, 60.086, 79.88, 50.9815, 75.996,
             74.942,  68.956, 79.847, 71.847, 70.938,
             40.305, 74.69, 74.9332, 56.08, 103.62,
             30.9898, 47.098, 14.941, 93.47, 79.546,
             81.38, 128.41, 223.19, 150.71, 123.22,
             172.12, 112.906, 162.91);

wtp_s <- selectNames(wtp_data,oxnames);

wtp_norm <-  rowApply(`/`, wtp_s, oxwt);

names(wtp_norm) <- pfunames;

ox_coeffs <- c(2.5, 2, 2 ,
               1.5, 1.5, 1.5, 1.5, 1.5,
               1, 1, 1, 1, 1,
               1, 1, 0.5, 0.5, 0.5,
               0.5, 1, 1, 1, 1,
               2, 2, 2,
               1.5, 1.5);
               
oxsum <- rowApply(`*`, wtp_norm, ox_coeffs)
oxsum <- rowSums(oxsum)

pfu <- wtp_norm * count / oxsum;
pfu_sum <- rowSums(pfu);
pfu$Sum <- pfu_sum;

return(cbind(data.frame(Name = wtp_data$Name), pfu));
}