Sign inGet started
← Back to all guides

Guide BJH analysis in Deepnote

By Filip Žitný

Updated on July 1, 2024

Setting Up Your Notebook Deepnote

import numpy as np 
import pandas as pd
# !pip install numpy pandas

Loading and Preparing Data

Load Adsorption Isotherm Data:

Ensure you have your experimental adsorption isotherm data ready. This typically includes relative pressure (P/P₀) and the corresponding amount of gas adsorbed (usually in cm³/g or another relevant unit).

# Example data loading (replace with your actual data loading code)
data = pd.read_csv("path_to_your_data.csv")
# Ensure your data columns are appropriately named, e.g., 'P/P0' and 'Volume_adsorbed'

BJH Calculation Methods

Implement BJH Methods:

BJH analysis involves several methods (Standard, Faas, Kruk-Jaroniec-Sayari). Implement functions or scripts for each method based on their respective equations and corrections.

Define functions to calculate Kelvin radii, film thickness, pore volumes, and surface areas as per the BJH method you are implementing (Standard, Faas, or Kruk-Jaroniec-Sayari).

def kelvin_radius(APF, P_over_P0):
    # Calculate Kelvin radius using the Kelvin equation
    return -APF / np.log(P_over_P0)

def thickness_Harkins_Jura(P_over_P0):
    # Calculate thickness using Harkins and Jura thickness equation
    return np.sqrt(13.99 / (0.034 - np.log10(P_over_P0)))

# Define functions for Standard, Faas, and Kruk-Jaroniec-Sayari methods similarly

Performing BJH Analysis

Iterate Over Isotherm Data:

Use a loop or apply functions to iterate over each data point in your isotherm dataset. Perform calculations to derive pore volumes and areas based on the chosen BJH method.

# Example loop for Standard method
for index, row in data.iterrows():
    P_over_P0 = row['P/P0']
    APF = calculate_APF(...)  # Calculate Adsorbate Property Factor
    Rc = kelvin_radius(APF, P_over_P0)
    Tw = thickness_Harkins_Jura(P_over_P0)
    # Calculate pore volume and area using formulas provided
    Vp = calculate_pore_volume(...)
    Ap = calculate_pore_area(...)
    # Store or append results to a DataFrame or output format of your choice

Visualizing Results

Visualize Pore Size Distributions:

Use plotting libraries such as matplotlib or seaborn to visualize the pore size distributions derived from your BJH analysis. Plot cumulative pore volume or area distributions within specified pore size limits.

import matplotlib.pyplot as plt

# Example plotting (customize based on your specific data and requirements)
plt.figure(figsize=(8, 6))
plt.plot(pore_sizes, cumulative_volume, label='Cumulative Pore Volume')
plt.xlabel('Pore Size (Å)')
plt.ylabel('Cumulative Volume (cm³/g)')
plt.title('BJH Pore Volume Distribution')
plt.legend()
plt.grid(True)
plt.show()

9.png

Conclusion

By following these steps in Deepnote, you can effectively perform BJH pore size distribution analysis using various BJH methods. Make sure to adapt the code snippets provided based on your specific data format, equations used, and desired output format. Deepnote's collaborative features and Python environment make it suitable for iterative data analysis and scientific computations like BJH pore analysis. If you encounter any issues, please get in touch with our support. Happy analyzing in Deepnote!

Filip Žitný

Data Scientist

Follow Filip on Twitter, LinkedIn and GitHub

That’s it, time to try Deepnote

Get started – it’s free
Book a demo

Footer

Solutions

  • Notebook
  • Data apps
  • Machine learning
  • Data teams

Product

Company

Comparisons

Resources

  • Privacy
  • Terms

© Deepnote