Algorithm for the interpretation of mass spectra in the study of thermochemical conversion of lignocellulosic raw materials using complex combined thermal analysis

. This article proposes a method for processing data obtained using the TA-MS complex. To search for calibration coefficients, the method includes solving a quadratic programming problem. To test the method of searching for calibration coefficients, a simulation was done and the inverse problem was solved, and it was found out that the problem was ill-conditioned.

1 Formulation of the problem 1

.1 Introduction
Understanding the mechanisms of conversion of lignocellulosic fuels is, at the moment, qualitative [1][2]. The processes of conversion of such substances are studied in devices of thermal analysis, synchronized with the unit of analysis of the released products of this process. In this work, the results were obtained on a thermal analysis instrument combined with a mass spectrometer.
In modern scientific research, thermal analysis is of interest as a tool for studying various materials and processes in various gas environments, in vacuum and under pressure, with automatic registration of changes in the physicochemical properties of substances and/or products of its reaction [3]. Combinations of thermal analysis and mass spectrometry are widely used to study the gas phase resulting from thermal effects on various substances and materials, such as sewage sludge, rubbers, plastics, thin films, and lignocellulosic fuels. A significant amount of work using this method is aimed at studying the dependencies of the yield of combustion products of various fuels on conditions such as heating rate, gas environment, the presence of chemical reagents, etc. [4][5][6]. Figure 1 shows a schematic depiction of a thermal analysis instrument combined with a mass spectrometer (TA-MS). In the TA-MS system, gases generated as a result of thermal decomposition of various substances are transferred by a stream of inert carrier gas (argon, nitrogen, helium) or oxidant (oxygen mixed with inert gases) to a mass spectrometer through a temperaturecontrolled at 200 ° C quartz capillary. It should be noted that only part of the mixture of the recorded substances and the carrier gas enters the mass spectrometer by the vacuum, and the excess is carried out into the atmosphere. Such a system allows to detect the released gas products and to monitor their output in real time during the whole process. However, the main difficulty is the separation of substances having the same mass numbers, for example, the mass number 28 corresponds to both carbon monoxide and nitrogen. In addition, in the process of decomposition of the sample under study, several gaseous compounds are simultaneously formed, which complicates the interpretation of the mass spectra. In this regard, by the example of thermochemical conversion processes of lignocellulosic fuels, an algorithm is proposed for analyzing mass spectra in order to obtain information on the quantitative composition of the gaseous mixture.

Quartz capillary
Quadrupole mass spectrometer The sample in ac rucible on weigher The gas part goes into the atmosphere

The problem of calibration coefficients
An important stage of any quantitative study is the calibration process. Calibration is performed by introducing into the carrier gas a known amount of the gas to be detected, which is fed to the TA-mass analyzer system. Next, the ratio between the amount of gas and the peak area on the base mass number is calculated. The base number of a given substance is the mass number at which the intensity (peak area) is maximum, as a rule, it is a molecular ion. For example, for carbon dioxide, a molecular ion corresponds to a mass number (m/z) 44 (see Figure 2).

Fig. 2.
The calibration spectrum and the NIST spectrum for CO2.
At the calibration stage, a preliminary separation of the peaks is also made for each mass number.
It is known that in the theory of mass spectral analysis, the use of coefficients obtained during calibration does not lead to unambiguous results [5].
The difference in calibration coefficients can be explained by the fact that working conditions significantly affect the mass spectrometric signals: the partial pressure of gases, the type of gaseous medium, temperature and density of the gas. Perhaps the values of the coefficients are influenced by the way the substance enters the carrier gas: during calibration, the substance to be determined is introduced by entering with a calibration gas syringe, and in the experiment by decomposing the substance. Also, the calibration is highly dependent on the operating conditions of the quadrupole mass spectrometer [5]. Due to the fact that the exact duplication of all the above parameters from calibration to experiment is difficult, the calibration factors should be determined from the results of the experiment itself.
There are a number of papers, for example [6][7] , in which quantitative processing of experimental results is carried out. However, in such works, the object of study is substances that decompose with the formation of only one product at a temperature site, which allows us to find the calibration factor for the known change in sample mass and the integral value S of this product at this site. Calcium oxalate is especially convenient in this regard, which decomposes in three stages with the formation of water, carbon monoxide and carbon dioxide in the exact temperature range for each product [6].
In [7], a study of the thermal decomposition of (NH4)10[H2W12O42]•2.9H2O was used to quantify the released water and ammonia, and from the mass spectrometric data the water and ammonia emission curves were constructed.
Another example of the simplest quantitative analysis is the decomposition of sodium bicarbonate. Using the known reaction 2NaHCO3 = Na2CO3 + H2O + CO2 and using a definite integral on the mass numbers m/z=18 (water) and m/z=44 (carbon dioxide), find calibration coefficient.
Thus, in the simplest case, it is possible to quantitatively interpret the mass spectra when there are areas in which only one substance is released.
In the TA-MS system, it is assumed that the amount of a substance and a difinite integral of its maximum peak are related by the relation (1): where k is a calibration coefficient, mole•A -1 •s -1 ; S is a difinite integral from the signal of the ion current, A·с; n is amount of substance, mole. Method TA-MS gives following data: 2 The methodic experimental data processing

The investigation method
Thermal conversion studies of lignocellulosic fuels were performed using an integrated complex simultaneous thermal analysis (STA449F1) coupled with a quadrupole mass spectrometer (QMS403C), produced by NETZSCH. Using this complex, data were obtained on the decomposition of cellulose in an inert atmosphere (argon flow, 90 ml/min) at heating rates of 1; 5; 30 K/min. Registration of mass numbers was carried out in the range from 1 to 96. The power of the electron strike is 70 eV. For example, Figure 3 a) presents the mass-spectral data of cellulose decomposition in an inert atmosphere at a heating rate of 30 K/min. The ion signal of carrier gas (m/z=20; 36; 38; 40, this gas is argon) were deleted. Figure 3 b) presents the thermogravimetric curve of the cellulose sample. The temperature is connected with time linearly (2): where T0 is initial temperature, K; β is heat rate, K/min. As seen in the Figure 3 a), the most intensities are on mass number 18 (water) and 44 (carbon dioxide). The remaining mass numbers probably indicate hydrocarbons (mainly methane) and aldehydes.  The algorithm was ran by Matlab. In following parts of this article, there are the description of the algorithm blocks.

The growth of the signal ion current carrier gas
At the measurement stage, at the time of intense gas evolution from the sample during the decomposition of materials such as wood and cellulose, the signal increases at mass numbers m/z=20; 36; 38; 40 corresponding to the carrier gas, namely, argon, which, possibly, leads to an increase in the mass spectrometer signal from the measured signals from other mass numbers. During oxidative pyrolysis, a jump is also observed on the mass numbers m/z=16; 32; 33; 34, corresponding to oxygen, and on mass numbers m/z=14; 28, 29, corresponding to nitrogen. Thus, the signal jump on these mass numbers corresponds to the components of the carrier gas.
It is worth noting that this effect is not observed during the decomposition of sodium bicarbonate, therefore, there is some limit at which this effect occurs. The reasons for this effect are not fully understood. It is possible that the increase in the signal is due to the increase in pressure in the thermal analysis chamber.
In this paper, we propose to take into account the signal jump on the mass number m/z=40, as the largest among the other "jumping" mass numbers, as follows.
To search for argon current in an unperturbed system, the initial portion in which there is no intensive release of gaseous substances was approximated by the curve (3): where a1, b1, a2 и b2 is approximation constants. On After finding a1, b1, a2 и b2, taking into account the jump, the argon signal 0 Ar I was calculated already for the entire experiment time by the ratio (3).
Next, a correction factor Z was introduced, which was determined at each time point according to the expression (4): where Ar I  is obtaind by experiment argon ion current, The mass-spectrometer signals 0 i I were corrected by (5): where i I  is corrected signal m/z, A; 0 i I is signal from experiment, A.

Peak selection
The first and standard stage of processing the experimental results is the selection of peaks on each mass number in the mass spectral data and, if necessary, 3 their approximation. To do this, follow the following algorithm: 1) Visual definition of the beginning and end of the peak in time ; 2) Determining the background range for the baseline; 3) The approximation of values in the selected background range by a suitable polynomial (on Figure 6 а) is shown by third degree polynomial); 4) Building a baseline from the found polynomial; 5) In the peak area, the subtraction of the baseline from the values allocated at step 1; 6) If necessary, approximation of the selected peak obtained at the 5 th step.

The matrix of relative intensity of the gas component mixture
The mass ratio in the mass spectrum has a high reproducibility and is determined by the strength of the electron impact, which is usually equal to 70 eV, therefore there are libraries of mass spectra of various compounds that identify individual compounds, for example, the NIST mass spectra library. However, the mass spectral signal is influenced by the parameters of the instrument itself, and because of this, it is recommended in [5] to refer to the library supplied by the manufacturer of the mass spectrometer, since the values for different devices are quite different. Mass spectrometry differs from other methods in that in it the charged molecules (ions) are separated by their masses. The analyte is ionized, while decaying into ion fragments, then these ions are accelerated, pass through a mass analyzer, in which the ions are separated by the ratio m/z, and recorded by the detectors. All this happens in a deep vacuum. Mass spectrometers differ in the type of mass analyzer. The quadrupole mass spectrometer is most widely used. The quadrupole mass filter consists of four parallel cylindrical rods. An electromagnetic field is created that interacts with the ion beam. The quadrupole is tuned so that when a mixture of ions with different m/z ratios runs parallel to the rods, the ions with the m/z ratio of interest to us will deflect at a certain angle, pass through the entire central axis of the rods and register with detectors.
As mentioned above, the mass spectral signals depend on various conditions, so the spectra obtained during calibration may differ from the NIST spectra. Figure 2 shows the mass spectrum for carbon dioxide CO2.
From Figure 2, it can be seen that the relative intensities of NIST and those obtained during calibration differ. Thus, accurate quantitative interpretation of mass spectra makes the ambiguity of the calibration coefficients and the incomplete base of the calibration mass spectra difficult, and therefore the use of the NIST database for the substances under consideration is limited.
Interpretation of mass spectra during thermochemical conversion of solid fuel is significantly hampered by the fact that the mass numbers of a number of components of the gas mixture and their fragments coincide. For example, the mass number 28 characterizes both CO and N2. In this regard, researchers often determine only the qualitative composition of the gas mixture during the oxidation and pyrolysis of biomass.
To separate the mass spectra should make a list of products formed during the decomposition of a substance [8].
In this study, based on the elemental composition of cellulose (C6H10O5)n , a program was written for the selection of substances from a database with a molecular mass less than 97 (since measurements were carried out up to m/z=96) and containing only carbon, oxygen and hydrogen. Then an expert evaluation of the list was carried out, which consisted in rejection of substances that could not form according to the literature [1][2][3][4] : aromatic compounds, hydrocarbons with C3 and above, various radicals, etc. As a result, the following list of substances was obtained : H2 hydrogen; H2O water; CO2 carbon dioxide; CO carbon monoxide; C2H2 acetylene; C2H4 ethylene; C2H5OH ethanol; C2H6 ethane; CH3COCH3 acetone; CH3CHO acetaldehyde; CH3COOH acetic acid; CH3OCH3 diethyl ether; CH4 methane; CH3OH methanol; HCOH formaldehyde; HCOOH formic acid; O2 oxygen; C6H10O5 levoglucosan; C2H4O2 hydroxyacetaldehyde; C7H8 toluene; C5H4O2 furfural.
Then, based on this list of substances and according to the NIST database, a table of relative intensities was compiled, which is a numerical matrix gi,j, where i is the mass number number m/z, j is the component number of the gas mixture entering the mass spectrometer from the TA chamber.
In this work, the following criterion for the rejection of substances was introduced: if the relative intensity of the spectrum of the intended component of the gas mixture at any m/z is greater than a predetermined value (for example, 0.4) and the signal at that m/z is not recorded by the mass spectrometer, then or this component is not in the mixture, or its concentration is very small. In the second case, it is assumed that on other m/z with higher relative intensities for this component its current is blocked by currents from other components. The value of the ion current generated by the electron impact of the secondary fragments can be very low, so there is a problem of identifying the component when its base number overlaps with other components, especially when the concentration of the component is low [5].

Separation of mass spectra
The obtained i I (on i th mass number) is the sum of the ion currents of the fragments from each component of the gas mixture entering the mass spectrometer. In [5] values i I are presented as the product of the matrix of relative intensities of the components of the gas mixture ij f at their partial pressure j P (6): The total measured ion current at any i th mass number is the sum of the currents of the mass fragments from each component j at each time moment t (7): where , B jt I is ion current signal of j th substance on its base mass number. So, the total ion current on i th mass number is determined by the expression (10): Expression (10) can be presented as overdetermined system of equations (11) relatively (11) When solving this system of equations, the criterion for the rejection of substances, described above in 2.5, was applied at each time instant, and thus the individual currents of substances were obtained. After solving t systems of equations by the least squares method and taking 0 B j I  , we find the integral curves (12): On the other hand, based on the expression (13): Th finding calibration coefficients j k needs to minimize the expression (17): representing a quadratic programming (QP) problem, the search for a solution of which is performed in the positive domain.

Finding calibration coefficients by the quadratic programming method
Quadratic programming is a special class of non-linear programming problems in which the objective function is quadratic and the constraint functions are linear [8].
For a quadratic program with an arbitrary symmetric matrix H, there is currently no satisfactory solution method, therefore, to consider a convex or concave objective function, the matrix H must be positively or negatively semi-defined [8].
To determine the type of our problem, we find the Hessian matrix of the objective function   As can be seen from expression (21) , the Hesse matrix depends only on the integral values of the mass spectrum, but does not depend on the derivatograph signal, from which it follows that the task in this case is specific.
If the quadratic goal function is not convex (respectively, not concave), then the results obtained during the solution cannot be considered as a program solution. At best, these are local extremes or saddle points. [9]. In order to evaluate the definiteness of a matrix, it is necessary to find its own values.
The conditional number of the Hesse matrix is also important. Poor conditioning means that small changes in the input data lead to much larger changes in the solution regardless of the method used to calculate the solution. [9].

Additional condition for quadratic programming problem
To describe the conversion process using a one-step generalized reaction of the form (22)

Simulation of the decomposition of lignocellulosic raw materials
Cases of ill-conditionality occur when solving inverse problems [9]. For example, let's model the decomposition of some substance containing carbon, oxygen and hydrogen, and solve the inverse problem of finding the calibration coefficients. To do this, set a list Figure 7 shows the simulated thermogravimetric yield curves for each decomposition product. With the same dynamics of the release of substances, that is, when setting the same value α j for each component, the Hessian matrix is linear and its signdefiniteness is not established, which means the solution is not unique. This simulated problem is exactly solved by the method of least squares, however, as mentioned above, the least squares method is not suitable for real experimental data.

Conclusion
The ambiguity of the calibration coefficients makes it difficult to decipher the signal of the mass spectrometer and build a model of pyrolysis of the studied substances. The solution can be found in carrying out quantitative analysis from the results of the experiment itself.
The algorithm for processing experimental data and searching for calibration coefficients was written in Matlab. In the course of modeling, the specificity of the problem was revealed, which consists in the necessity of the existence of a minimum of a quadratic function and a large number of conditionality of the Hessian matrix of this function. Thus, the slightest change in the source data will lead to significant changes in the calibration coefficients. This may be due to rounding errors in machine calculations, since there are no such errors in the theoretical analysis. Unstable algorithms and illconditioned problems occur in almost all areas of computational mathematics. [9].
There was and still is the problem of correct separation of mass spectral data due to the fact that libraries of mass spectra of substances vary from one instrument to another. As was established during modeling, the solution may not be found with the same yield dynamics of the decomposition products. Indeed, with the same product yield dynamics, the system of equations (16) becomes linearly dependent, and after reducing this system to the quadratic programming problem, the matrix H becomes degenerate.