I. INTRODUCTION
With the industrial production, centralized heating of boilers and the popularization of transportation tools, a large number of soot and toxic and harmful gases will be discharged. Hazardous substances accumulate gradually in the atmosphere and reach a certain concentration, which will make the normal composition of air change, thus endangering the health of human beings and various animals and plants. Various problems caused by air pollution have attracted the attention of environmental protection departments. In order to achieve accurate and real-time monitoring of environmental quality, ecological environment and pollution sources, and provide accurate basis for supervision and management of environmental protection departments at all levels and environmental decision-making of the government, a large number of modern environmental monitoring instruments are urgently needed.
At present, there are three main methods for gas detection of portable spectrometers in domestic and foreign markets: differential algorithm, electrochemical analysis and infrared spectroscopy. Differential absorption algorithm can accurately calculate the concentration of most gases, but it will lose the broadband continuous absorption information in the characteristic absorption of gases, leading to some gas concentration measurement can not come out. For example, the absorption spectrum of nitrogen dioxide molecule in the ultraviolet band is mostly gradual continuous absorption, so differential absorption algorithm may think that the absorption information of nitrogen dioxide is filtered out by scattering, resulting in the detection of nitrogen dioxide. If the absorption curves of nitric oxide and nitrogen dioxide have the same absorption peaks, the fitting absorption curves are superimposed at the measuring points, so it is still impossible to distinguish the two gases. The electrochemical analysis method has the advantages of simple structure and easy operation. It mainly depends on gas sensors, a gas sensor can only detect a corresponding gas, and the sensitivity of gas sensors is high, but after a period of time, the sensitivity of sensors to gas will decline, it is necessary to replace gas sensors in time, and gas sensors are expensive, which increases the use cost for users. The main principle of gas sensor is to use the oxidation or reduction reaction of gas to generate current, but if there are both oxidizing gas and reducing gas, the measurement results will be inaccurate. Infrared spectroscopy overcomes the shortcomings of electrochemical analysis, but can only measure the approximate concentration of nitrogen oxides, can not accurately measure the specific concentration of NO and NO2, and infrared spectroscopy for environmental humidity, temperature and other external conditions require higher technology is more complex.
Based on defects and deficiencies of the above gas detection methods, an iterative evolution gas solution algorithm is proposed in this paper. According to the good absorption of ultraviolet light by gas at the wavelength of 190-290 nm, the number of absorbed photons can be obtained by measuring the ultraviolet light absorbed by gas. The actual concentration of gas can be obtained from the number of photons by using the iterative gas calculation algorithm.
II. THE PINCIPLE AND COMPUTATIONAL PROCEDURE OF ITERATIVE ALGORITHMS
A. Algorithm Principle
Mixed gases have characteristic absorption peaks in the range of ultraviolet wavelength 190-290 nm. Gas absorbance has multiple superposition. Assuming that some elementary gas does not absorb other gases on its best characteristic absorption peak, the corresponding table of absorbance and concentration of this single substance gas is searched to obtain the initial concentration of the gas, and then switch to another characteristic absorption peak. The photon number of the gas is subtracted from the total photon number measured, and the initial concentration of another gas is obtained. By analogy, the initial concentration of each gas is obtained one by one. Then, the characteristic absorption peak of the first gas is returned to, and the absorption photon number of other gases is subtracted from the total photon number absorbed, and the iterative concentration of the first gas is obtained again. By analogy, the initial concentration of each elemental gas is obtained again. By repeating the iteration until the difference of gas concentration between two adjacent times is less than a certain value, it is considered that the concentration of the elemental gas is obtained.
B. Algorithm Steps
1) The initial concentration c1 of the first elementary gas in the mixed gas is solved. According to the characteristic absorption peak of the gas at wavelength λ1, the number of photons B S λ1 of absorbed by the gas is read. Solving the value of (Rλ is the number of incident photons; Sλ is the number of photons passing through the medium.; Dλ is the number of photons in dark spectrum (Also known as dark spectral noise); λ is the wavelength of a certain ultraviolet wave, K is a constant, c is the concentration of elemental gas), The initial concentration c1 of the elemental gas was obtained by inquiring the comparison table of absorbance and gas concentration..
2) The initial concentration c2 of the second primary gas in the mixed gas is solved. too, Select the characteristic absorption peak λ2 of the elemental gas and read the absorption photon number S λ2 of the elemental gas. Assuming that there are only two gases in this band, According to the formula
the absorbance of the second gas is calculated, and the concentration of the second gas is calculated by querying the absorbance and concentration table again, as the initial concentration c2 of the second gas.
3) Solve the concentration of other elemental gases in mixed gases. Methods 1 and 2. Selecting the characteristic peak absorption wavelength of other elemental gases and reading the number of absorbed photons at that wavelength. The absorbance was calculated by formula
(A is absorbance), and the initial concentration of gas was obtained by looking up the table.
4) Iterative Recursion of the Concentration of the First Element Gas. The concentration of all elemental gases obtained at present is substituted into the formula
and the corresponding S λ1 of wavelength λ1 is read again. The iterative concentration c1 of the first elemental gas is obtained by checking the corresponding table of concentration absorbance.
5) Repeat 2) and 3) to find the iteration concentration c m1 of the elemental gas M.
6) Calculate the error of the calculation results of the same elemental gas in the adjacent two times. The first-order iteration error of each elemental gas is calculated.
7) Repeat 4, 5 and 6 until the error of two iterations of the same gas concentration is less than 3%.
The last calculated gas concentration is regarded as the final concentration of various elemental gases.
III. ALGORITHM VERIFICATION
Fig. 1 is the absorption spectra of NO, SO2 NH3 and NO2 mixed gases. Among them, N2 is a zero gas whose spectral line is called zero gas line. Zero gas is not absorbed in ultraviolet light of 190-290 nm. Because there is Rayleigh scattering in the gas to be detected, the influence of scattering can be eliminated by using the zero-gas line spectrum as the reference spectrum.

Figure 1.
Mixed gas UV spectral absorption curve
From the observation in Fig. 1, we can see that NO and NH3 can find non-interference absorption wavelengths. These two wavelengths are just the absorption peaks of NO and NH3, and there is no NO absorption at the NO absorption peak, and there is no NH3 absorption at the NO absorption peak. So it is easy to distinguish the two gases if we only distinguish them. The problem now is that SO2 and NO2 both absorb at the absorption peaks of these two gases. At the wavelength of 220 nm, the maximum absorption peaks of NO and NO2 are close, and SO2 absorbs a lot of ultraviolet light in this section. So if we can know the concentration of SO2 and NO2 beforehand, we can use the superposition of absorbance to subtract the absorbance of NO and NH3 from the total absorbance of SO2 and NO2. We can get the absorbance of NO and NH3 by looking up tables. Therefore, in order to obtain the specific concentration of various elemental gases in mixed gases, the concentration of SO2 and NO2 must be required first, and then the concentration of NO and NH3 can be calculated. In this way, the concentration of four kinds of elemental gases in the mixture can be calculated.
A. Calculating the Concentrations of SO2 and NO2
NO2 and SO2 interfere with each other in the whole working band. Now it is assumed that there are two kinds of elemental gases in the mixture, NO2 and SO2, respectively. It is now known that the absorption spectra of mixed gases at 231.33 nm and 273.33 nm, and the absorbance of gases NO2 and SO2 at 231.33 nm and 273.33 nm (231.33 nm and 273.33 nm, respectively, are the maximum absorbance of gases NO2 and SO2 at this point). Now calculate the respective concentrations of NO2 and SO2.

Figure 2.
Absorption spectra of SO2 and NO2
TABLE I.
SPECTRAL TABLES FOR SO2 AND NO2 AT WAVELENGTH 273.33NM AND WAVELENGTH 231.33NM
| Wavelength | 231.33 | 273.33 | |
| NO2 absorbance | 0.03003444 | 0.00456189 | |
| SO2 absorbance | 0.00482312 | 0.07984884 |
| 271.98nm | 225.94nm | dark noise | |
|---|---|---|---|
| zero gas | 56434 | 43973 | 2900 |
| SO2 100ppm | 52851 | 42754 | 2900 |
| zero gas | 56434 | 43973 | 2900 |
| NO2 100ppm | 56386 | 40749 | 2900 |
| 271.98nm | 225.94nm | dark noise | |
|---|---|---|---|
| zero gas | 56434 | 43973 | 2900 |
| mixed gas | 52050 | 39588 | 2900 |








