Modeling Adsorption Isotherms with AdsorpR

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(AdsorpR)
library(ggplot2)

๐Ÿ“ฆ Introduction

The AdsorpR package provides functions for modeling four classical adsorption isotherms:

These models are commonly used in environmental and chemical engineering studies to describe sorption mechanisms of contaminants onto solid adsorbents.

๐Ÿงช Sample Dataset

We demonstrate model usage using a simple example dataset representing equilibrium concentration (Ce) and the amount adsorbed (Qe):

Ce <- c(1, 2, 3, 4, 5)
Qe <- c(0.8, 1.5, 2.1, 2.6, 2.9)

๐Ÿ“ Langmuir Isotherm

result_l <- langmuir_model(Ce, Qe)
print(result_l[1:2])        # Qmax and KL
print(result_l$`Model Summary`)
result_l$Plot

๐Ÿ“ Freundlich Isotherm

result_f <- freundlich_model(Ce, Qe)
print(result_f[1:2])        # Kf and n
print(result_f$`Model Summary`)
result_f$Plot

๐Ÿ“ BET Isotherm

result_b <- bet_model(Ce, Qe)
print(result_b[1:2])        # Qm and Cb
print(result_b$`Model Summary`)
result_b$Plot

๐Ÿ“ Temkin Isotherm

result_t <- temkin_model(Ce, Qe)
print(result_t[1:2])        # A and B
print(result_t$`Model Summary`)
result_t$Plot

๐Ÿ” Non-linear Isotherm Modeling

Non-linear Langmuir

Ce <- c(1, 2, 4, 6, 8, 10)
Qe <- c(0.9, 1.6, 2.3, 2.7, 2.9, 3.0)
result <- nonlinear_langmuir(Ce, Qe)
print(result$`Langmuir Qmax (mg/g)`)
print(result$`Langmuir KL (L/mg)`)
print(result$AIC)
print(result$`Pseudo R2`)
print(result$Plot)

Non-linear Freundlich

Ce <- c(0.5, 1, 2, 4, 6, 8)
Qe <- c(0.3, 0.8, 1.6, 2.4, 2.9, 3.2)
result <- nonlinear_freundlich(Ce, Qe)
print(result$`Freundlich Kf`)
print(result$`Freundlich n`)
print(result$AIC)
print(result$`Pseudo R2`)
print(result$Plot)

Non-linear BET

Ce <- c(1, 2.5, 4, 5.5, 7)
Qe <- c(0.4, 1.0, 1.7, 2.3, 2.7)
result <- nonlinear_bet(Ce, Qe)
print(result$`BET Qm (mg/g)`)
print(result$`BET Cb`)
print(result$AIC)
print(result$`Pseudo R2`)
print(result$Plot)

Non-linear Temkin

Ce <- c(0.5, 1.5, 3, 4.5, 6)
Qe <- c(0.7, 1.3, 2.0, 2.4, 2.7)
result <- nonlinear_temkin(Ce, Qe)
print(result$`Temkin A`)
print(result$`Temkin B`)
print(result$AIC)
print(result$`Pseudo R2`)
print(result$Plot)

๐Ÿ“ Conclusion

The AdsorpR package offers a clean and structured way to fit adsorption isotherm models and visualize results using ggplot2. It is useful for:



Try the AdsorpR package in your browser

Any scripts or data that you put into this service are public.

AdsorpR documentation built on April 12, 2025, 1:23 a.m.