Document Actions

CarbX

Open-source software from the Smarsly's group: Tools for the microstructure analysis of non-graphitic carbons

 

Purpose of the programme

 

Non-graphitic carbons (NGCs) are an important material for several applications, e.g. molecular sieves, catalyst materials and most prominent electrode materials or conductive additives in batteries. NGCs consist of graphene stacks typically possessing nanometer dimensions and substantial structural disorder leading to broad and overlapping maxima in wide-angle X-ray scattering (WAXS) data. The main structural dimensions of these stacks are generally described by the parameters La and Lc, which describe the average lateral extension and the stack height, respectively. Further important and relevant parameters are the C-C bond length, the average distance between the layers, and also parameters describing the substantial degree of disorder in the stacking and the layers themselves. The structure and some microstructural parameters are depicted in Fig. 1:

 

Figure 1: Basic structure of NGCs.
NGCs consist of stacks of turbostratic
arranged graphene layers.
Adapted from [2].

 

For all applications a quantitative determination of the microstructure based on experimentally accessible structural parameters is crucial both for the tuning of production processes and linking material properties to the microstructure. The latter comprises macroscopic properties like hardness, chemical stability or thermal and electrical conductivity and hence defines the final application. Obtaining these parameters is possible by evaluating the WAXS data of NGCs using an approach published 2002 by Ruland & Smarsly[1]. The purpose of CarbX is to provide a convenient computer programme employing this approach for the microstructural analysis of NGCs. CarbX provides a graphical user interface (GUI) allowing even for users inexperienced in programming easy manual fitting of NGC WANS data. In addition, several convenience features (see below), the possibility to link CarbX to Wolfram Mathematica ® and the distribution as open-source software, make CarbX a unique solution for microstructural NGC analysis.

 

 

CarbX' features and GUI

 

CarbX’ features include not conclusively:

  • Complex mathematical calculations hidden behind an “easy to use” GUI.
  • Determination of up to 14 microstructural parameters, e.g.
    • La (average graphene layer extent) and Lc (average stack height).
    • a3 (average interlayer spacing) and several disorder parameters.
  • Consideration of several correction terms and support for different X-ray wavelengths.
  • Thinning factor for both faster calculation of fit curve and faster automatic fitting.
  • Separate window to display the deviation between data and fit (customizable).
  • Several export possibilities (XY-data, graphs, result list) for data, fit and deviation.
  • Support for templates and automatic fitting via Mathematica (customizable).
  • Data display completely customizable and programme available in German and English.

The GUI of CarbX consist of a main window (Fig. 2), two supporting windows (Figs. 3 and 4) and several dialogues.

 

Figure 2: Screenshot of the main window of the GUI. It is divided into five sections,
marked by Roman numerals. Section I is the menu bar, section II contains buttons
for several purposes, section III the sliders to adjust the parameters,
section IV the plot area and some options for the plot itself,
section V the options for the fit curve and data correction
as well as the wavelength selection.

 

Figure 3: Screenshot of the supporting window to display the
deviation. between fit and measurement data. Besides the
main plot area, this window contains some options
for the plot, two buttons to export the deviation data
and a button to close the window.

 

Figure 4: Screenshot of the supporting window to determine
an autofit sequence and excecute automatic fitting. This
window contains elements for managing an arbitrary number
of autofit sequences, determining the autofit steps for
the chosen sequence, manipulating the (start)values for
each step, excecuting the choosen sequence, previewing
and taking over the results of the automatic fitting.

 

 

Mathematical background

 

In CarbX the theoretical observable intensity is defined as proportional to the sum of coherent scattering Icoh and incoherent scattering Iincoh.

$$I_\mathrm {theoretical} \propto \left(I_\mathrm {coh} + I_\mathrm {incoh}\right)$$

The coherent scattering intensity results from interlayer scattering, intralayer scattering, scattering from unorganised carbon and scattering from unorganised nitrogen and oxygen impurities. Considering of the anisotropy of the atomic form factor of carbon perpendicular to the graphene sheets by the empirical parameter Δan the coherent scattering is given by:

$$\begin{split} I_\mathrm {coh} = \left( 1-c_\mathrm {un} \right) \left( f_\mathrm {C,perp}^2 \cdot I_\mathrm {inter} + f_\mathrm {C,para}^2 \cdot I_\mathrm {intra} \right) \\ + c_\mathrm {un} \cdot f_\mathrm {C,para}^2 + c_\mathrm N \cdot f_\mathrm {N}^2 + c_\mathrm O \cdot f_\mathrm {O}^2\end{split}$$

The incoherent scattering intensity results from Compton scattering and is calculated by interpolating tabulated values. In addition, specific correction factors are considered for primary and optional for secondary monochromatization.
Furthermore, to describe the theoretical scattering intensity correctly, polarization, absorption, background correction by a normalization constant, tuning the slope of the scattering curve and a possibly used automatic collimator have to be taken into account. Thus, in CarbX, the theoretical scattering intensity is defined as

$$I_\mathrm {theoretical}=(1/AutoColl) \cdot gFact \cdot k \cdot A \cdot P \cdot (I_\mathrm {coh} + I_\mathrm {incoh} \cdot Q)$$

with AutoColl as a factor for correction of a possibly used automatic collimator, gFact as a factor to tune the slope of the fit curve, k as a normalization constant, A as the absorption factor, P as the polarization factor, Icoh as the coherent scattering, Iincoh as the incoherent Compton scattering and Q is the attenuation function for Compton scattering due to secondary monochromatization (the factors for primary monochromatization are automatically applied for the calculation of Iincoh.

 

 

Installation and basic usage of CarbX

 

CarbX can be used on any machine that is capable of running of and has Windows XP, Windows 7 or Windows 10 as operating system. Support for Windows 8 has not been tested. As some calculation steps can require a significant amount of time on “slower” machines and a certain amount of RAM required depending on the data file size at least a dual-core CPU with not less than 2 GHz and 2 GB of RAM are recommended.

 

In order to use CarbX, the ZIP-archive of the programme has to downloaded and extracted in an arbitrary folder. Executing the EXE-file in the desired language launches the programme. The basic steps for usage are:

  • Setting the programme options and restarting the programme
  • Load (possibly corrected/reduced) measurement data
    • If activated, choose a template
  • Display the fit and set fit curve options
  • Perform manual fitting using the sliders
  • Perform automatic fitting if Mathematica is available
  • Check deviation between fit and data
  • Export the results as image and/or parameter list

 

 

Compiling CarbX from Source

 

To compile CarbX it is required to provide the following libraries and some routines from Numerical Recipes in C: The Qt application framework, the Qt Widgets for Technical Applications (Qwt) Library and the Wolfram Symbolic Transfer Protocol (WSTP). The files from these libraries and the source code from Numerical Recipes (NR) required for compilation are not included in the source code package, except four public domain files from the Numerical Recipes. The Qt Application Framework and the Qwt can be obtained as open-source software (see licence information). The Qwt package must be compiled with the Qt version used for compiling CarbX. In order to use Qwt within the Qt Creator, this programme has to be compiled with the same Qt version used for compiling Qwt. The Qt Creator version included in Qt usually does not support Qwt. The Qt binary language files with filenames starting with “qt” and ending with “_de.qm” for German must be copied from the folder containing Qt’s translation files to the folder “./release/translation” with the “.” marking the project folder. The NR source files “bsstep.c”, “factln.c”, “gammln.c”, “hypdrv.c”, “hypgeo.c”, “hypser.c”, “mmid.c”, “odeint.c”, “pzextr.c”, “spline.c”, “splint.c” and the NR header file “nr.h” (only with the necessary declarations for the aforementioned source files) have to be obtained as proprietary licenced software from NR. A single user may type in the routines from the freely available (but copy protected) digital edition of “Numerical Recipes in C, 2nd edition) (see “http://www.nrbook.com/a/bookcpdf.php”). In this case, however, distribution of the compiled programme is not allowed; to do so a paid licence must be purchased. From the WSTP library the Dynamic Link Library (DLL) “wstp32i4.dll” and the header file “wstp.h” are required. These files are included in any Wolfram Mathematica Distribution. The DLL is to be found in the directory “./SystemFiles/Links/WSTP/DeveloperKit/Windows/SystemAdditions”, the header file in the directory “./SystemFiles/Links/WSTP/DeveloperKit/Windows/CompilerAdditions”. In both paths, the “.” marks Mathematica’s installation directory. While all other files are mandatory, compilation of CarbX without the WSTP files is possible. In this case, the Qt project file as well as the “autofitsettings.h” and “autofitsettings.cpp” must be modified at positions marked by comments. In addition, the files “autofitmathematica.h” and “autofitmathematica.cpp” must be removed from the project folder. In any case, finally the project “CarbX” has to be configured for the specific build environment to be used for compiling.

 

 

Contact Details & License Information

 

CarbX has been thoroughly tested and works fine if the system requirements are fulfilled. It is provided as-it-is as open-source software. Bug reports and suggestions are appreciated (). If you want to be informed about new releases, please send an e-mail, too. In this case, you will be added to our "CarbX news" mailing list.

 

THIS SOFTWARE IS PROVIDED “AS IS”' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 

CarbX, except for the proprietary licensed third party source code in human and/or machine-readable form, is free software. The third-party source code is not included in human and/or machine-readable form in CarbX’ source code archive, but in binary form incorporated in CarbX executable files. We are allowed to distribute such compiled binaries by permission of Numerical Recipes and Wolfram Research, Inc. The CarbX executable files as well as any files required to run CarbX are available at no cost in the CarbX’ executables archive. Redistribution of this archive is allowed only by providing a link to this web document; any other form is not permitted, especially not providing a direct link to the archive file or distributing single files from the archive. If you choose to build CarbX from the provided CarbX’ source code files while obtaining the required libraries, files and third party source code as well as the required licences on your own, you can redistribute and/or modify the remaining parts of CarbX (i. e. the parts developed by Torben Pfaff) under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This programme is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this programme. If not, see http://www.gnu.org/licenses/.

 

Third-party components:

 

CarbX uses the Qt Application framework (Qt library) available under the GNU Lesser General Public License v. 3 (“LGPL”). The license is included in both the programme and source code archive of the programme and can be obtained from https://www.gnu.org/licenses/. The Qt library itself has not been modified. The source code of the Qt library can be obtained from https://www.qt.io/download-open-source.

 

CarbX is based in part on the work of the Qwt project (http://qwt.sf.net). The Qt Widgets for Technical Applications (Qwt library) is available under the Qwt License, Version 1.0. The Qwt library has not been modified except for the required changes of the build configuration. The license can be obtained from http://qwt.sourceforge.net/qwtlicense.html.

 

CarbX uses parts of the Numerical Recipes, available under a commercial license. The machine-readable code of CarbX must therefore not be distributed. However, some public domain Numerical Recipes code is included in CarbX’ source code archive.

 

The file “wstp32i4.dll”, included in the programme ZIP archive, is part of WSTP, Copyright (c) 2017 Wolfram Research, Inc. and is distributed by Torben Pfaff with permission of the author of WSTP. Any unauthorized use or distribution is strictly prohibited.

 

 

Downloads

 

CarbX’ programme files and CarbX’ source code files are available as ZIP archives:

 

An article about CarbX has been published in the Journal of Applied Crystallography:
Pfaff, T. et al. (2018). J. Appl. Cryst. 51, 219-229.

 

 

References

 

[1] Ruland, Wilhelm & Smarsly, Bernd (2002). J. Appl. Cryst. 35, 624–633.
[2] Adelhelm, P. et al. (2012). Sci. Technol. Adv. Mater. 13, 015010.