Skip to content

Commit

Permalink
docs: finalize docs for release
Browse files Browse the repository at this point in the history
  • Loading branch information
pauliacomi committed Feb 23, 2022
1 parent b0752aa commit 7f4b3c7
Show file tree
Hide file tree
Showing 29 changed files with 584 additions and 159 deletions.
19 changes: 14 additions & 5 deletions docs/examples/alphas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"source": [
"# The $\\alpha_s$ method\n",
"\n",
"Very similar to the t-plot method, the $\\alpha_s$ method compares an isotherm on a porous material with one that was taken on a reference non-porous surface. The reference isotherm should be measured over a wide pressure range, to be able to compare loading values. First, make sure the data is imported notebook."
"Very similar to the t-plot method, the $\\alpha_s$ method compares an isotherm on\n",
"a porous material with one that was taken on a reference non-porous surface. The\n",
"reference isotherm should be measured over a wide pressure range, to be able to\n",
"compare loading values. First, make sure the data is imported notebook."
]
},
{
Expand Down Expand Up @@ -37,7 +40,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Unfortunately, we don't have a reference isotherm in our data. We are instead going to be creative and assume that the adsorption on the silica ($SiO_2$ sample) is a good representation of an adsorption on a non-porous version of the MCM-41 sample. Let's try:"
"Unfortunately, we don't have a reference isotherm in our data. We are instead\n",
"going to be creative and assume that the adsorption on the silica ($SiO_2$\n",
"sample) is a good representation of an adsorption on a non-porous version of the\n",
"MCM-41 sample. Let's try:"
]
},
{
Expand Down Expand Up @@ -71,7 +77,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The data in our reference isotherm is on a smaller range than that in the isotherm that we want to calculate! We are going to be creative again and first model the adsorption behaviour using a `ModelIsotherm`."
"The data in our reference isotherm is on a smaller range than that in the\n",
"isotherm that we want to calculate! We are going to be creative again and first\n",
"model the adsorption behaviour using a `ModelIsotherm`."
]
},
{
Expand Down Expand Up @@ -152,8 +160,9 @@
"- The known area of the reference material. If this is not specified, the BET method is used to calculate the surface area.\n",
"- As in the t-plot function, the limits for the straight line selection.\n",
"\n",
"More info can be found in the [documentation of the\n",
"module](https://pygaps.readthedocs.io/en/latest/reference/characterisation/alphas_plot.html)"
"Read more about the theory in the\n",
"[documentation of the module](../reference/characterisation/alphas_plot.rst) and\n",
"in the [manual](../manual/characterisation.rst)."
]
}
],
Expand Down
55 changes: 42 additions & 13 deletions docs/examples/area_calcs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"pyGAPS attempts to calculate the applicable BET region on its own by using the Rouquerol rules. The function is `area_BET`, where we pass the `verbose` parameter to obtain a printed output of results and plots."
"pyGAPS attempts to calculate the applicable BET region on its own by using the\n",
"Rouquerol rules. The function is `pygaps.characterisation.area_BET`, where we\n",
"set the `verbose` parameter to obtain a printed output of results and plots."
]
},
{
Expand Down Expand Up @@ -90,7 +92,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"It looks that the correlation is reasonably good. A warning is emmited if this is not the case. We can also restrict the pressure range manually to see what difference it would make, by using the `limits` parameter."
"It looks that the correlation is reasonably good. A warning is emitted if this\n",
"is not the case. We can also restrict the pressure range manually to see what\n",
"difference it would make, by using the `limits` parameter."
]
},
{
Expand Down Expand Up @@ -138,7 +142,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let's do the analysis on all of the nitrogen samples. We'll assume the framework makes a reasonably accurate choice for the applicable range. The function returns a dictionary with all the calculated parameters, and we'll print the BET area from there."
"Now let's do the analysis on all of the nitrogen samples. We'll assume the\n",
"framework makes a reasonably accurate choice for the applicable range. The\n",
"function returns a dictionary with all the calculated parameters, and we'll\n",
"print the BET area from there."
]
},
{
Expand Down Expand Up @@ -186,9 +193,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We also have isotherms which were measured with $CO_2$ at room temperature. While there's no guarantee that the BET method is still applicable with this adsorbate and temperature, we can still attempt to perform the calculations.\n",
"We also have isotherms which were measured with $CO_2$ at room temperature.\n",
"While there's no guarantee that the BET method is still applicable with this\n",
"adsorbate and temperature, we can still attempt to perform the calculations.\n",
"\n",
"It just happens that the isotherms were recorded on the same Takeda 5A carbon sample (see $N_2$ results above). Let's see how the $CO_2$ BET surface area looks in comparison."
"It just happens that the isotherms were recorded on the same Takeda 5A carbon\n",
"sample (see $N_2$ results above). Let's see how the $CO_2$ BET surface area\n",
"looks in comparison."
]
},
{
Expand Down Expand Up @@ -239,11 +250,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The surface area obtained with carbon dioxide is around 760 $m^2$. Compared to the nitrogen surface area of 1100 $m^2$, it is much smaller. While the checks implemented did not find anything wrong, this is likely due to interactions between carbon dioxide and the carbon surface leading to the breakdown of the BET theory.\n",
"The surface area obtained with carbon dioxide is around 740 $m^2$. Compared to\n",
"the nitrogen surface area of 1100 $m^2$, it is much smaller. While the checks\n",
"implemented did not find anything wrong, this is likely due to interactions\n",
"between carbon dioxide and the carbon surface leading to the breakdown of the\n",
"BET theory.\n",
"\n",
"While any kind of adsorbate and temperature (below critical) can be used, result interpretation is left at the discretion of the user.\n",
"More info can be found in the [documentation of the\n",
"module](https://pygaps.readthedocs.io/en/latest/reference/characterisation/area_bet.html)."
"While any kind of adsorbate and temperature (below critical) can be used, result\n",
"interpretation is left at the discretion of the user. More info can be found in\n",
"the [documentation of the module](../reference/characterisation/area_bet.rst)."
]
},
{
Expand All @@ -252,7 +267,13 @@
"source": [
"## Langmuir surface area\n",
"\n",
"Another common method of calculating specific surface area relies on fitting the isotherm with a Langmuir model. This model assumes adsorption occurs on active surface/pore sites, in a single layer. We use the `area_langmuir` function, which defaults to a region of 0.1-0.9 p/p0 for the fitting. We pass the `verbose` parameter to display the results automatically."
"Another common method of calculating specific surface area relies on fitting the\n",
"isotherm with a Langmuir model. This model assumes adsorption occurs on active\n",
"surface/pore sites, in a single layer. We use the\n",
"`pygaps.characterisation.area_langmuir` function, which defaults to a region of\n",
"0.1-0.9 p/p0 for the fitting (see\n",
"[documentation](../reference/characterisation/area_lang.rst) for details). We\n",
"pass the `verbose` parameter to display the results automatically."
]
},
{
Expand Down Expand Up @@ -295,7 +316,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The correlation is not very good due to condensation in mesopores of MCM-41, which is not predicted by the Langmuir model. Due to this, the area calculated is not realistic. We can manually select a range in the monolayer adsorption regime for a better fit."
"The correlation is not very good due to condensation in mesopores of MCM-41,\n",
"which is not predicted by the Langmuir model. Due to this, the area calculated\n",
"is not realistic. We can manually select a range in the monolayer adsorption\n",
"regime for a better fit."
]
},
{
Expand Down Expand Up @@ -336,9 +360,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The fit is now better and the calculated area is also realistic. Comparing it to the BET area obtained previously, we see that it is higher by about 150 m2. Since adsoprtion is more likely to occur in monolayers until pore condensation, this method is not really suited for MCM-41. In general the Langmuir surface area is not as widely applicable as the BET one.\n",
"The fit is now better and the calculated area is also realistic. Comparing it to\n",
"the BET area obtained previously, we see that it is higher by about 150 m2.\n",
"Since adsorption is more likely to occur in monolayers until pore condensation,\n",
"this method is not really suited for MCM-41. In general the Langmuir surface\n",
"area is not as widely applicable as the BET one.\n",
"\n",
"Now let's do the analysis on all of the nitrogen samples and compare the obtained surface areas with the BET ones."
"Now let's do the analysis on all of the nitrogen samples and compare the\n",
"obtained surface areas with the BET ones."
]
},
{
Expand Down
34 changes: 23 additions & 11 deletions docs/examples/dr_da_plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
"source": [
"# Dubinin-Radushkevich and Dubinin-Astakov plots\n",
"\n",
"The Dubinin-Radushkevich (DR) and Dubinin-Astakov (DA) plots are often used to determine the pore volume and the characteristic adsorption potential of adsorbent materials, in particular those of carbonaceous materials, such as activated carbons, carbon black or carbon nanotubes. It is also sometimes used for solution adsorption isotherms.\n",
"The Dubinin-Radushkevich (DR) and Dubinin-Astakov (DA) plots are often used to\n",
"determine the pore volume and the characteristic adsorption potential of\n",
"adsorbent materials, in particular those of carbonaceous materials, such as\n",
"activated carbons, carbon black or carbon nanotubes. It is also sometimes used\n",
"for solution adsorption isotherms.\n",
"\n",
"In pyGAPS, both the DR and DA plots are available with the `dr_plot` and `da_plot` functions.\n",
"First we import the example isotherms."
"In pyGAPS, both the DR and DA plots are available with the `dr_plot` and\n",
"`da_plot` functions. First we import the example isotherms."
]
},
{
Expand Down Expand Up @@ -40,7 +44,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Then we'll select the Takeda 5A isotherm to examine. We will perform a DR plot, with increased verbosity to observe the resulting linear fit. The function returns a dictionary with the calculated pore volume and adsorption potential."
"Then we'll select the Takeda 5A isotherm to examine. We will perform a DR plot,\n",
"with increased verbosity to observe the resulting linear fit. The function\n",
"returns a dictionary with the calculated pore volume and adsorption potential."
]
},
{
Expand All @@ -52,7 +58,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Micropore volume is: 0.484 cm3\n",
"Micropore volume is: 0.484 cm3/g\n",
"Effective adsorption potential is : 5.84 kJ/mol\n"
]
},
Expand Down Expand Up @@ -87,7 +93,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Micropore volume is: 0.448 cm3\n",
"Micropore volume is: 0.448 cm3/g\n",
"Effective adsorption potential is : 6 kJ/mol\n"
]
},
Expand All @@ -109,9 +115,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"An extension of the DR model is the Dubinin-Astakov (DA) model. In the DA equation, the exponent can vary, and is usually chosen between 1 (for surfaces) and 3 (for micropores). For an explanation of the theory, check the function reference.\n",
"An extension of the DR model is the Dubinin-Astakov (DA) model. In the DA\n",
"equation, the exponent can vary, and is usually chosen between 1 (for surfaces)\n",
"and 3 (for micropores). For an explanation of the theory, check the function\n",
"reference.\n",
"\n",
"We then use the `da_plot` function and specify the exponent to be 2.3 (larger than the standard DR exponent of 2)"
"We then use the `da_plot` function and specify the exponent to be 2.3 (larger\n",
"than the standard DR exponent of 2)"
]
},
{
Expand All @@ -123,7 +133,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Micropore volume is: 0.422 cm3\n",
"Micropore volume is: 0.422 cm3/g\n",
"Effective adsorption potential is : 6.34 kJ/mol\n"
]
},
Expand All @@ -145,7 +155,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The DA plot can also automatically test which exponent gives the best fit between 1 and 3, if the parameter is left blank. The calculated exponent is returned in the result dictionary."
"The DA plot can also automatically test which exponent gives the best fit\n",
"between 1 and 3, if the parameter is left blank. The calculated exponent is\n",
"returned in the result dictionary."
]
},
{
Expand All @@ -158,7 +170,7 @@
"output_type": "stream",
"text": [
"Exponent is: 3\n",
"Micropore volume is: 0.385 cm3\n",
"Micropore volume is: 0.385 cm3/g\n",
"Effective adsorption potential is : 6.92 kJ/mol\n"
]
},
Expand Down
49 changes: 37 additions & 12 deletions docs/examples/iast.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"source": [
"# IAST examples\n",
"\n",
"In this notebook example IAST calculations will be performed. The IAST method is used to predict the composition of the adsorbed phase in a multicomponent adsorption system, starting from pure component isotherms.\n",
"First, make sure the data is imported by running the import notebook."
"The IAST method is used to predict the composition of the adsorbed phase in a\n",
"multicomponent adsorption system, starting from pure component isotherms. First,\n",
"make sure the data is imported by running the import notebook."
]
},
{
Expand Down Expand Up @@ -44,7 +45,10 @@
"source": [
"## Using models\n",
"\n",
"The IAST calculation is often performed by fitting a model to the isotherm rather than on the isotherms themselves, as spreading pressure can be computed efficiently when using most common models. Let's first fit the Langmuir model to both isotherms."
"The IAST calculation is often performed by fitting a model to the isotherm\n",
"rather than on the isotherms themselves, as spreading pressure can be computed\n",
"efficiently when using most common models. Let's first fit the Langmuir model to\n",
"both isotherms."
]
},
{
Expand Down Expand Up @@ -97,7 +101,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we can perform the IAST calculation with the resulting models. We specify the partial pressures of each component in the gaseous phase to obtain the composition of the adsorbed phase."
"Now we can perform the IAST calculation with the resulting models. We specify\n",
"the partial pressures of each component in the gaseous phase to obtain the\n",
"composition of the adsorbed phase."
]
},
{
Expand Down Expand Up @@ -150,9 +156,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Alternatively, if we are interested in a binary system, we can use the extension functions `iast_binary_svp` and `iast_binary_vle` to obtain how the selectivity changes based on pressure in a constant composition or, respectively, how the gas phase-adsorbed phase changes with gas composition, at constant pressure. \n",
"Alternatively, if we are interested in a binary system, we can use the extension\n",
"functions `iast_binary_svp` and `iast_binary_vle` to obtain how the selectivity\n",
"changes based on pressure in a constant composition or, respectively, how the\n",
"gas phase-adsorbed phase changes with gas composition, at constant pressure.\n",
"\n",
"These functions perform the IAST calculation at every point in the range passed and can plot the results. If interested in the selectivity for one component in an equimolar mixture over a pressure range:"
"These functions perform the IAST calculation at every point in the range passed\n",
"and can plot the results. If interested in the selectivity for one component in\n",
"an equimolar mixture over a pressure range:"
]
},
{
Expand Down Expand Up @@ -208,7 +219,11 @@
],
"source": [
"total_pressure = 2\n",
"result_dict = pgi.iast_binary_vle(isotherms_iast_models, total_pressure, verbose=True)"
"result_dict = pgi.iast_binary_vle(\n",
" isotherms_iast_models,\n",
" total_pressure,\n",
" verbose=True,\n",
")"
]
},
{
Expand All @@ -222,7 +237,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The isotherms themselves can be used directly. However, instead of spreading pressure being calculated from the model, it will be approximated through interpolation and numerical quadrature integration."
"The isotherms themselves can be used directly. However, instead of spreading\n",
"pressure being calculated from the model, it will be approximated through\n",
"interpolation and numerical quadrature integration."
]
},
{
Expand Down Expand Up @@ -268,7 +285,12 @@
"source": [
"gas_fraction = [0.5, 0.5]\n",
"total_pressure = 10\n",
"pgi.iast_point_fraction(isotherms_iast_models, gas_fraction, total_pressure, verbose=True)"
"pgi.iast_point_fraction(\n",
" isotherms_iast_models,\n",
" gas_fraction,\n",
" total_pressure,\n",
" verbose=True,\n",
")"
]
},
{
Expand Down Expand Up @@ -302,7 +324,7 @@
" mole_fraction,\n",
" pressure_range,\n",
" verbose=True,\n",
")\n"
")"
]
},
{
Expand All @@ -323,8 +345,11 @@
}
],
"source": [
"total_pressure = 2\n",
"result_dict = pgi.iast_binary_vle(isotherms_iast, total_pressure, verbose=True)"
"result_dict = pgi.iast_binary_vle(\n",
" isotherms_iast,\n",
" total_pressure=2,\n",
" verbose=True,\n",
")"
]
},
{
Expand Down
9 changes: 7 additions & 2 deletions docs/examples/import.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
"source": [
"# Reading isotherms\n",
"\n",
"The first thing to do is to read previously created isotherms. Example data can be found in the [data](https://github.com/pauliacomi/pyGAPS/tree/master/docs/examples/data) directory, saved in the pyGAPS JSON format, which we will now open. First, we'll do the necessary top-level imports for the session."
"The first thing to do is to read previously created isotherms. Example data can\n",
"be found in the\n",
"[data](https://github.com/pauliacomi/pyGAPS/tree/master/docs/examples/data)\n",
"directory, saved in the pyGAPS JSON format, which we will now open. First, we'll\n",
"do the necessary top-level imports for the session."
]
},
{
Expand All @@ -25,7 +29,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Then we'll import the json files, one-by-one by using the `isotherm_from_json` method which reads an isotherm from a file (or a string). There are three folders:\n",
"Then we'll import the json files, by using the `isotherm_from_json` method which\n",
"reads an isotherm from a file (or a string). There are four folders:\n",
"\n",
"- One containing nitrogen adsorption data at 77 kelvin"
]
Expand Down
Loading

0 comments on commit 7f4b3c7

Please sign in to comment.