Introduction to PUPAIM

library(PUPAIM)

PUPAIM

This is the introduction to the package ’“PUPAIM”. This package is a collection of physical and chemical adsorption isotherm models. This package caters both the linear and nonlinear functions of the adsorption isotherm models, and can give information about the parameters of the isotherm used as well as the linear regression and the error analysis of that isotherm. Using this package, fitting of adsorption data to different adsorption isotherm models can be made easily.

Adsorption Plot

Ce <- c(0.01353, 0.04648, 0.13239, 0.27714, 0.41600, 0.63607, 0.80435, 1.10327, 1.58223)
Qe <- c(0.03409, 0.06025, 0.10622, 0.12842, 0.15299, 0.15379, 0.15735, 0.15735, 0.16607)
data <- data.frame(Ce,Qe)

plot(data,main = "Adsorption Data", xlab = "Ce", 
         ylab = "Qe")

This is an example of an adsorption plot with the equilibrium capacity (Ce) on the x-axis and the adsorbed capacity (Qe) on the y-axis.Depending on the adsorption isotherm model, these variables may change as well as the line of fit.

There are several isotherm models that can be applied in adsorption systems. These includes: (1) One-parameter isotherm model - Henry’s linear model; (2) Two-parameter isotherm model - Langmuir isotherm model, Freundlich isotherm model, Temkin isotherm model, Halsey isotherm model, Elovich isotherm model, Hill-Deboer isotherm model, Fowler-Guggenheim isotherm model, Dubinin-Radushkevich isotherm model, Flory-Huggins isotherm model, Hill isotherm model, Hankin-Jura isotherm model, Jovanovic isotherm model, Bruanuer-Emett-Teller (BET) isotherm model and Kiselev isotherm model; (3) Three-parameter isotherm model - Redlich-Peterson isotherm model, Sips isotherm model, Toth isotherm model, Koble-Carrigan isotherm model, Kahn isotherm model, Radke-Prausnitz isotherm model, and Jossens isotherm model; (4) Four-parameter isotherm model - Baudu isotherm model, Weber-Van Vliet isotherm model, Marczewski-Jaronic isotherm model, and Fritz-Schlunder isotherm model; (5) Five-parameter isotherm model - Fritz-Schlunder isotherm model. Adsorption isotherm models are not limited to these since there are still more other isotherm models in existence.

If a single adsorption data is used to these isotherm models, the corresponding data fitting as well as error analysis would different from one to another.

Example: One-Parameter Adsorption Isotherm Model

Ce <- c(0.01353, 0.04648, 0.13239, 0.27714, 0.41600, 0.63607, 0.80435, 1.10327, 1.58223)
Qe <- c(0.03409, 0.06025, 0.10622, 0.12842, 0.15299, 0.15379, 0.15735, 0.15735, 0.16607)
data <- data.frame(Ce,Qe)

henryanalysis(Ce, Qe)
#> [1] "Henry Isotherm Analysis"
#> 
#> Call:
#> lm(formula = y ~ x)
#> 
#> Residuals:
#>      Min       1Q   Median       3Q      Max 
#> -0.05242 -0.02854  0.01149  0.02369  0.03866 
#> 
#> Coefficients:
#>             Estimate Std. Error t value Pr(>|t|)   
#> (Intercept)  0.08558    0.01628   5.258  0.00118 **
#> x            0.06911    0.02175   3.178  0.01554 * 
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Residual standard error: 0.03263 on 7 degrees of freedom
#> Multiple R-squared:  0.5906, Adjusted R-squared:  0.5321 
#> F-statistic:  10.1 on 1 and 7 DF,  p-value: 0.01554
#> 
#> [1] "K"
#> [1] 0.06910649
#> [1] "Akaike Information Criterion"
#> [1] -32.32572
#> [1] "Bayesian Information Criterion"
#> [1] -31.73405
#> $`Relative Mean Square Error`
#> [1] 0.02877796
#> 
#> $`Mean Absolute Error`
#> [1] 0.02539692
#> 
#> $`Mean Squared Error`
#> [1] 0.000828171
#> 
#> $`Relative Absolute Error`
#> [1] 0.6659385
#> 
#> $`Standard Error for the Regression S`
#> [1] 5.507576e-17

Example: Two-Parameter Adsorption Isotherm Model

Ce <- c(0.01353, 0.04648, 0.13239, 0.27714, 0.41600, 0.63607, 0.80435, 1.10327, 1.58223)
Qe <- c(0.03409, 0.06025, 0.10622, 0.12842, 0.15299, 0.15379, 0.15735, 0.15735, 0.16607)
data <- data.frame(Ce,Qe)

hill.LM(Ce, Qe)
#> [1] "Hill Isotherm Linear Analysis"
#> 
#> Call:
#> lm(formula = y ~ x)
#> 
#> Residuals:
#>      Min       1Q   Median       3Q      Max 
#> -0.10629 -0.05076  0.01193  0.02262  0.16555 
#> 
#> Coefficients:
#>             Estimate Std. Error t value Pr(>|t|)    
#> (Intercept)  0.93956    0.03790   24.79 4.43e-08 ***
#> x            0.86213    0.04431   19.45 2.36e-07 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Residual standard error: 0.0856 on 7 degrees of freedom
#> Multiple R-squared:  0.9818, Adjusted R-squared:  0.9792 
#> F-statistic: 378.5 on 1 and 7 DF,  p-value: 2.365e-07
#> 
#> [1] "nh"
#> [1] 0.8621345
#> [1] "Kd"
#> [1] -0.9395641
#> [1] "qh"
#> [1] 0.1785724
#> [1] "Aikake Information Criterion"
#> [1] -14.9659
#> [1] "Bayesian Information Criterion"
#> [1] -14.37422
#> $`Relative Mean Squared Error`
#> [1] 0.07549337
#> 
#> $`Mean Absolute Error`
#> [1] 0.05699024
#> 
#> $`Mean Squared Error`
#> [1] 0.005699248
#> 
#> $`Relative Absolute Error`
#> [1] 0.1186211
#> 
#> $`Standard Error for the Regression S`
#> [1] 8.707216e-16

hillanalysis(Ce, Qe)
#> [1] "Hill Isotherm Nonlinear Analysis"
#> 
#> Formula: y ~ ((qh * x^nh)/(Kd + x^nh))
#> 
#> Parameters:
#>    Estimate Std. Error t value Pr(>|t|)    
#> qh 0.178572   0.008176  21.841 6.02e-07 ***
#> nh 0.895025   0.104650   8.553  0.00014 ***
#> Kd 0.111296   0.040343   2.759  0.03291 *  
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Residual standard error: 0.005496 on 6 degrees of freedom
#> 
#> Algorithm "port", convergence message: relative convergence (4)
#> 
#> [1] "Akaike Information Criterion"
#> [1] -63.77458
#> [1] "Bayesian Information Criterion"
#> [1] -62.98569
#> $`Root Mean Squared Error`
#> [1] 0.6358941
#> 
#> $`Mean Absolute Error`
#> [1] 0.003279588
#> 
#> $`Mean Squared Error`
#> [1] 2.013943e-05
#> 
#> $`Relative Absolute Error`
#> [1] 0.08599483
#> 
#> $`Standard Error for the Regression S`
#> [1] 0.0007138005
#> 
#> 
#> Call:
#> lm(formula = Qe ~ predict(fit2))
#> 
#> Residuals:
#>        Min         1Q     Median         3Q        Max 
#> -0.0059912 -0.0038649  0.0000993  0.0009123  0.0094829 
#> 
#> Coefficients:
#>               Estimate Std. Error t value Pr(>|t|)    
#> (Intercept)   0.001776   0.004889   0.363    0.727    
#> predict(fit2) 0.987352   0.037071  26.634 2.69e-08 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Residual standard error: 0.005041 on 7 degrees of freedom
#> Multiple R-squared:  0.9902, Adjusted R-squared:  0.9888 
#> F-statistic: 709.4 on 1 and 7 DF,  p-value: 2.695e-08

Example: Three-Parameter Adsorption Isotherm Model

Ce <- c(0.01353, 0.04648, 0.13239, 0.27714, 0.41600, 0.63607, 0.80435, 1.10327, 1.58223)
Qe <- c(0.03409, 0.06025, 0.10622, 0.12842, 0.15299, 0.15379, 0.15735, 0.15735, 0.16607)
data <- data.frame(Ce,Qe)

redlichpeterson.LM(Qe, Ce)
#> [1] "Redlich-Peterson Isotherm Linear Analysis"
#> 
#> Call:
#> lm(formula = y ~ x)
#> 
#> Residuals:
#>      Min       1Q   Median       3Q      Max 
#> -0.40185 -0.25413  0.02166  0.13093  0.59882 
#> 
#> Coefficients:
#>             Estimate Std. Error t value Pr(>|t|)    
#> (Intercept)    2.050      0.237   8.651 5.52e-05 ***
#> x            -49.319      7.632  -6.462 0.000346 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Residual standard error: 0.3192 on 7 degrees of freedom
#> Multiple R-squared:  0.8564, Adjusted R-squared:  0.8359 
#> F-statistic: 41.76 on 1 and 7 DF,  p-value: 0.0003462
#> 
#> [1] "Krep"
#> [1] 0.4878194
#> [1] "Arep"
#> [1] -24.05862
#> [1] "Nrep"
#> [1] 1.759505
#> [1] "Aikake Information Criterion"
#> [1] 8.725798
#> [1] "Bayesian Information Criterion"
#> [1] 9.317471
#> $`Relative Mean Squared Error`
#> [1] 0.2815331
#> 
#> $`Mean Absolute Error`
#> [1] 0.2115007
#> 
#> $`Mean Squared Error`
#> [1] 0.07926087
#> 
#> $`Relative Absolute Error`
#> [1] 0.3698422
#> 
#> $`Standard Error for the Regression S`
#> [1] 1.300837e-15

redlichpetersonanalysis(Qe, Ce)
#> [1] "Redlich-Peterson Isotherm Nonlinear Analysis"
#> 
#> Formula: y ~ (Krp * x)/(1 + (Arp * (x^g)))
#> 
#> Parameters:
#>     Estimate Std. Error t value Pr(>|t|)
#> Krp    1.678      3.679   0.456    0.664
#> Arp  -18.557    180.161  -0.103    0.921
#> g      1.760      5.722   0.308    0.769
#> 
#> Residual standard error: 0.2448 on 6 degrees of freedom
#> 
#> Algorithm "port", convergence message: false convergence (8)
#> 
#> [1] "Aikake Information Criterion"
#> [1] 4.563126
#> [1] "Bayesian Information Criterion"
#> [1] 5.352024
#> $`Relative Mean Squared Error`
#> [1] 0.1999124
#> 
#> $`Mean Absolute Error`
#> [1] 0.1741445
#> 
#> $`Mean Squared Error`
#> [1] 0.03996497
#> 
#> $`Relative Absolute error`
#> [1] 0.4127507
#> 
#> $`Standard Error for the Regression S`
#> [1] 0.2612517
#> 
#> 
#> Call:
#> lm(formula = Qe ~ predict(fit2))
#> 
#> Residuals:
#>      Min       1Q   Median       3Q      Max 
#> -0.34274 -0.09869 -0.01216  0.12168  0.23508 
#> 
#> Coefficients:
#>               Estimate Std. Error t value Pr(>|t|)    
#> (Intercept)    -0.1779     0.1214  -1.465  0.18633    
#> predict(fit2)   1.1595     0.1615   7.181  0.00018 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Residual standard error: 0.1961 on 7 degrees of freedom
#> Multiple R-squared:  0.8805, Adjusted R-squared:  0.8634 
#> F-statistic: 51.57 on 1 and 7 DF,  p-value: 0.0001804

Example: Four-Parameter Adsorption Isotherm Model

Ce <- c(0.01353, 0.04648, 0.13239, 0.27714, 0.41600, 0.63607, 0.80435, 1.10327, 1.58223)
Qe <- c(0.03409, 0.06025, 0.10622, 0.12842, 0.15299, 0.15379, 0.15735, 0.15735, 0.16607)
data <- data.frame(Ce,Qe)

FS4analysis(Ce, Qe)
#> [1] "Fritz-Schlunder Four Parameter Isotherm Nonlinear Analysis"
#> 
#> Formula: y ~ (C * x^a)/(1 + D * x^b)
#> 
#> Parameters:
#>   Estimate Std. Error t value Pr(>|t|)    
#> C  0.62499    0.44719   1.398   0.2211    
#> D  2.87927    2.79846   1.029   0.3507    
#> a  0.67949    0.17620   3.856   0.0119 *  
#> b  0.84770    0.06944  12.208 6.52e-05 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Residual standard error: 0.005249 on 5 degrees of freedom
#> 
#> Number of iterations to convergence: 11 
#> Achieved convergence tolerance: 6.613e-06
#> 
#> [1] "Akaike Information Criterion"
#> [1] -64.24246
#> [1] "Bayesian Information Criterion"
#> [1] -63.25634
#> $`Root Mean Squared Error`
#> [1] 0.00391273
#> 
#> $`Mean Absolute Error`
#> [1] 0.003466885
#> 
#> $`Mean Squared Error`
#> [1] 1.530946e-05
#> 
#> $`Relative Absolute Error`
#> [1] 0.09090599
#> 
#> $`Standard Error for the Regression S`
#> [1] 0.002872805
#> 
#> 
#> Call:
#> lm(formula = Qe ~ predict(fit3))
#> 
#> Residuals:
#>       Min        1Q    Median        3Q       Max 
#> -0.004354 -0.004107 -0.001295  0.002352  0.007638 
#> 
#> Coefficients:
#>                Estimate Std. Error t value Pr(>|t|)    
#> (Intercept)   0.0006429  0.0043268   0.149    0.886    
#> predict(fit3) 0.9954182  0.0328031  30.345 1.09e-08 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> Residual standard error: 0.00443 on 7 degrees of freedom
#> Multiple R-squared:  0.9925, Adjusted R-squared:  0.9914 
#> F-statistic: 920.8 on 1 and 7 DF,  p-value: 1.089e-08

Published Journals

The PUPAIM R package is a very effective tool to fitting a certain adsorption isotherm model. As what demonstrated by the published journal of Mr. Lloyd de Osio, an undergraduate Chemistry student, and Mr. Chester C. Deocaris, the maintainer of PUPAIM package, with the title: > “FITTING HENRY’S ADSORPTION ISOTHERM MODEL IN R USING THE PUPAIM PACKAGE” (via)