International Journal of Advanced Network, Monitoring and Controls Volume 04, No.01, 2019 83 The Researchof a New Iteration of the Circular Algorithm Xu Shuping School of Computer Science and Engineering Xi’an Technological University Xi’an, 710021, China e-mail: 563937848@qq.com Huang Menyao School of Computer Science and Engineering Xi’an Technological University Xi’an, 710021, China Chen Li School of Computer Science and Engineering Xi’an Technological University Xi’an, 710021, China Xu Pei School of Computer Science and Engineering Xi’an Technological University Xi’an, 710021, China Abstract—It is a problem of spectra analysis of flue gas that how to separate and calculate the concentration of different kinds of gas from continuous mixed gas absorption spectrum signal. So based on experimental data, a new iteration of the circular algorithm is put forward on the basis of Lambert-Beer's law. The algorithm uses different UV-light wavelengths at 190nm-290nm for different characteristics of UV light with different absorption peaks. The iteration is repeated until the concentration difference between adjacent two gases is less than a certain value. It is considered that the elemental gas The exact concentration, and through the programming to achieve the results. it has strong anti-jamming capability and is suitable for practical application of engineering. Keywords—Circular Iteration; Characteristic Absorption Peak; Iterative Algorithm; Gas Concentration 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 DOI: 10.21307/ijanmc-2019-039 International Journal of Advanced Network, Monitoring and Controls Volume 04, No.01, 2019 84 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 1c 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 1S absorbed by the gas is read.Solving the value of   DS DR   1 1 ( 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 1c of the elemental gas was obtained by inquiring the comparison table of absorbance and gas concentration.. 2) The initial concentration 2c 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 2S of the elemental gas.Assuming that there are only two gases in this band, According to the formula        DS DR DS DR DS DR        2 2 1 1 *   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 2c 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            DS DR DS DR DS DR DS DR DS DR A n n             *...*** 3 3 2 2 1 1   ( 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            DS DR DS DR DS DR DS DR DS DR n n               ... 3 3 2 2 1 1   and the corresponding 1S of wavelength 1 is read again. The iterative concentration 1c 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 1mc of the elemental gas M. International Journal of Advanced Network, Monitoring and Controls Volume 04, No.01, 2019 85 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.  101 mmm cc    7) Repeat 4, 5 and 6 until the error of two iterations of the same gas concentration is less than 3%.  Gn    The last calculated gas concentration is regarded as the final concentration of various elemental gases. III. ALGORITHM VERIFICATION Figure 1. Mixed gas UV spectral absorption curve Fig.1 is the absorption spectra of NO , 2SO 3NH and 2NO mixed gases. Among them, 2N 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. From the observation in Fig.1, we can see that NO and 3NH can find non-interference absorption wavelengths. These two wavelengths are just the absorption peaks of NO and 3NH , and there is no NO absorption at the 3NH absorption peak, and there is no 3NH 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 2SO and 2NO both absorb at the absorption peaks of these two gases. At the wavelength of 220 nm, the maximum absorption peaks of NO and 2NO are close, and 2SO absorbs a lot of ultraviolet light in this section.So if we can know the concentration of 2SO and 2NO beforehand, we can use the superposition of absorbance to subtract the absorbance of NO and 3NH from the total absorbance of 2SO and 2NO . We can get the absorbance of NO and 3NH by looking up tables.Therefore, in order to obtain the specific concentration of various elemental gases in mixed gases, the concentration of 2SO and 2NO must be required first, and then the concentration of NO and 3NH 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 2SO and 2NO 2NO and 2SO interfere with each other in the whole working band. Now it is assumed that there are two kinds of elemental gases in the mixture, 2NO and 2SO , 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 2NO and 2SO at 231.33 nm and 273.33 nm (231.33 nm and 273.33 nm, respectively, are the maximum absorbance of gases 2NO and 2SO 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 International Journal of Advanced Network, Monitoring and Controls Volume 04, No.01, 2019 86 Figure 3. NO2 and SO2 gas concentration iterative algorithm flow chart Fig. 3 is the flow chart of the iterative algorithm for the concentration of 2NO and 2SO mixed gases. After several iterations, the real concentrations of these two gases can be calculated from the mixture. 1 2 3 4 5 6 70 10 20 30 40 50 60 Figure 4. SO2 concentration and the number of iterations curve 1 2 3 4 5 6 70 239 240 241 242 243 244 245 246 247 248 Figure 5. NO2 concentration and the number of iterations curve After two iterations, the numerical value of the algorithm tends to be stable, and the precise gas concentrations of 2NO and 2SO are basically obtained. B. Calculating the Gas Concentrations of NO and 3NH There is no interference between NO and 3NH at their maximum absorption peaks, so the total absorbance and the concentration of 2NO and 2SO can be calculated according to the superposition of ultraviolet light. Assuming that the concentrations of 2NO and 2SO in mixed gases are 1c and 2c , respectively, and the concentrations of NO and 3NH are 3c and 4c , the multivariate superposition of absorbance at wavelength 225.88 nm can be obtained as follows:  321 AAAA    1A is the absorbance of 2NO at 225.8 nm in 1c concentration, 2A is the absorbance of 2SO at 225.8 nm in 2c concentration, A is the total absorbance of mixed gas at 225.88 nm and 3A is the total absorbance of NO at 225.88 nm.  0 3 1 2 1 2 lg( ) I I A A A A A A        0I is the spectral intensity at 225.88 nm through zero gas, I is the transmission intensity at 225.88 nm through the mixture gas to be measured, the intensity can be obtained directly by spectrometer, 2A and 3A are calculated by the concentration of 2SO and 2NO . In this way, the absorbance 3A of NO at 225.88 nm can be obtained, and then the concentration of NO can be calculated according to the corresponding table between the concentration of NO at 225.88 nm and the absorbance. The absorbance International Journal of Advanced Network, Monitoring and Controls Volume 04, No.01, 2019 87 4A of 3NH can be obtained by the same method at 208.23 nm, and the concentration of 3NH can be calculated according to the corresponding relationship between 3NH concentration and absorbance at 208.23 nm. C. Composition of Platform Experiment System Ultraviolet flue gas analyzer consists of three parts: flue gas data acquisition module, data processing module and data display module. Figure 6. Experimental system composition diagram The data acquisition module is composed of ultraviolet light source and marine optical Maya2000 Pro ultraviolet spectrometer. Ultraviolet light source outputs stable ultraviolet light. Ultraviolet light passes through the optical fiber through the detected gas. After the gas is fully absorbed, the remaining ultraviolet light is transmitted into the ultraviolet spectrometer by the optical fiber. After the optical processing and photoelectric conversion of the gas by the spectrometer, the gas information becomes an electrical signal, waiting for the data processing module to read. In this system, the ultraviolet spectrometer is actually a flue gas acquisition sensor. Data processing module is composed of embedded development board. The embedded development board reads the gas information from the ultraviolet spectrometer, calculates the actual concentration of the elemental gas through the iterative algorithm, and visualizes it through the data display module. This is the composition and working principle of the experimental system. D. Absorption Spectroscopy of Elemental Gas and Zero Gas 2N is introduced into the system, and its absorption spectrum is measured when the gas concentration is stable. After that, the number of photons absorbed by 2NO , NO , 2SO and 3NH gases was measured in turn, and the curve was drawn by using the number and wavelength of photons. Figure 7. Four gas photon spectrum line graph E. Data Verification The following data are obtained when a mixture of 2SO and NO is injected into the experimental system. TABLE II. 200 PPM SO2 AND NO GAS SPECTRAL DATA 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 Table 2 shows the number of absorbed photons and dark noise photons at 271.98 and 225.94 nm measured by ultraviolet spectrometer in a mixture of 2SO and 2NO at 100 ppm, respectively. TABLE III. SPECTRAL DATA FOR MIXED GAS 271.98nm 225.94nm dark noise zero gas 56434 43973 2900 mixed gas 52050 39588 2900 Table 3 shows the number of absorbable photons at 271.98 nm and 225.94 nm for zero and mixed gases, as well as the number of dark spectral noise photons measured by spectrometer. In practical calculation, the number of photons measured should be subtracted from the number of photons of dark spectral noise to obtain the actual number of photons of zero gas and mixed gas. Based on the above data, the photon number absorption curves of elemental gases at their maximum absorption peaks are fitted. International Journal of Advanced Network, Monitoring and Controls Volume 04, No.01, 2019 88 100 200 300 400 500 600 7000 20000 40000 60000 80000 100000 120000 160000 140000 Figure 8. Fitting curve of SO2 at 271.98 nm 100 200 300 400 500 6000 20000 40000 60000 80000 100000 120000 160000 140000 Figure 9. Fitting curve of NO at 225.94 nm 100 200 300 400 500 600 7000 2000 4000 6000 8000 10000 12000 16000 14000 Figure 10. Fitting curve of NO at 271.98 nm 50 100 150 200 250 300 3500 100000 200000 300000 400000 500000 600000 800000 700000 Figure 11. Fitting curve of NH3 at 271.98 nm Figure 8-11 is a curve drawn by a single gas at the maximum absorption wavelength of ultraviolet light. Analysis table of experimental results TABLE IV. ANALYSIS OF RESULTS gas species standard value (ppm) measured value (ppm) difference value maximum difference error SO2 102 104 2 -4 0.8% 200 196 -4 499 501 2 NO 104 108 4 -7 1.4% 200 206 6 500 493 -7 NO2 116 112 -4 -9.7 1.94% 201.5 195 -6.5 501.7 493 -9.7 NH3 50 53 3 3 1.5% 200 199 -1 conclusion Accuracy error is less than 3%, which meets the design standard. In Table 4, the standard value is the concentration of the standard elemental gas put in the test, and the measured value is the concentration of the elemental gas calculated from the mixed gas using an iterative algorithm. From the experimental results, it can be seen that the maximum error of the measured value is less than the standard value, and the maximum error of the accuracy is 1.94%, which is much less than the original design standard of 3%, which is within the normal standard. IV. SOFTWARE IMPLEMENTATION The software algorithm is written in JavaScript, including the analysis and implementation process of the iterative algorithm gas. The main code is as follows: /* *Iterative calculation of gas concentration */ function GetGasC() { //1. Obtain absorbance from NO2 var NO2A_1 = GetAByWa(gasWavebanc['NO2']); //2. Find the concentration of this point var NO2C_1, NO2A_2, SO2A_2, SO2C_2, SO2A_1, ONA_3, NH3A_4, ONC_3, NH3C_4; for(var i = 0; i < 2; i++) { NO2C_1=GetCByA_Data(NO2_data_231, NO2A_1); //3.Calculate the absorbance of NO2 at 273.33. //NO2A_2; NO2A_2= getAByC_Data(NO2_data_273, NO2C_1); International Journal of Advanced Network, Monitoring and Controls Volume 04, No.01, 2019 89 //4. Obtain the total absorbance of SO2 in the optimum band and subtract the absorbance of NO2 here. SO2A_2=GetAByWa(gasWavebanc["SO2"]) -NO2A_2; //5. Looking up Table to Find DeSO2C_1 SO2C_2 = GetCByA_Data(SO2_data_273, SO2A_2); //6. The absorbance of SO2 at 231.33 was obtained by //looking up the table. SO2A_1 = getAByC_Data(SO2_data_231, SO2C_2); //7. NO2A_1 is the total absorbance minus the //absorbance of SO2A_1 at 231.33. NO2A_1 = NO2A_1 - SO2A_1; } currentGasC_NO2 = NO2C_1; currentGasC_SO2 = SO2C_2; //The absorbance of NO at the optimum band is the //total absorbance S-SO2 absorbance minus the //absorbance of NO2. ONA_3 = GetAByWa(gasWavebanc["NO"]) - getAByC_Data(NO2_data_225, NO2C_1) - getAByC_Data(SO2_data_225, SO2C_2); //Concentration of NO obtained currentGasC_NO = GetCByA_Data(NO_data_225, ONA_3); NH3A_4 = GetAByWa(gasWavebanc["NH3"]) - getAByC_Data(NO2_data_208, NO2C_1) - getAByC_Data(SO2_data_208, SO2C_2); currentGasC_NH3 = GetCByA_Data(NH3_data_208, NH3A_4); $("#NO2_C").html("No2 " + currentGasC_NO2); $("#SO2_C").html("So2 " + currentGasC_SO2); $("#NO_C").html("NO " + currentGasC_NO); $("#NH3_C").html("NH3 " + currentGasC_NH3); } V. CONCLUSION Aiming at the detection requirement of main harmful components in air pollution, a fast iteration algorithm of mixed flue gas is designed by using the continuous frequency division method of ultraviolet grating in the experimental system, and the effectiveness of the algorithm is verified. Ultraviolet spectrometer is used as a sensor. The embedded development board reads and calculates the gas concentration. The analysis and calculation of the algorithm are realized by programming. The results show that the iterative algorithm can accurately measure the concentration of flue gas and keep the error within 3%. It can meet the design requirements and solve many kinds of gases at the same time. It is suitable for practical engineering applications. ACKNOWLEDGMENT Thank you, Shaanxi Education Department. This work was supported in part by a grant from Shaanxi Provincial Department of Education Project (15JF019). The authors wish to thank the cooperators. This research is partially funded by the Project funds in shanxi province department of education (15JF019), a the Project funds in engineering laboratory project (GSYSJ2018011) and the project funds in innovation and entrepreneurship training for college students (1070214033) ABOUT THE AUTHOR Xu Shuping (1974-), Female, Professor, School of Computer Science and Engineering, Xi'an Technological University, majoring in embedded and computer control. Email: 563937848@qq.com, Mobile: 13772148209. REFERENCES [1] Chen Zhi-gang. Discussion on Experimental Application of Lambert-Beer Law[J]. Acta Metrologica Sinica. 2015(1) [2] Pop,Paul. Embedded systems design:Optimization challenges.Lecture Notes in ComputerScience, 2014,35(24):16-20 [3] Shi Bao-song Sun Shou-hong Zhang Wei. Application of CCD in the portable spectrometer[J]. Electronic Measurement Technology. 2016(11) [4] Limited ARM Development Guide 2000-2001.ARM DOI.2013.06. [5] Tang Qu. “Research and design of ultraviolet flue gas analyzer [J]”. Nanjing University of Technology. 2013 [6] Jiang Xuqian. “Design of portable ultraviolet flue gas analyzer [J]”. Nanjing University of Technology. 2012 [7] Chen Bin. “Design of ultraviolet flue gas analyzer [J]”.Nanjing University of Technology. 2016 [8] Juwu ,Wu Yihui. Micro-miniaturization of spectrometer [J]. Journal of Instrumentation, 2013. 22 (4): 131-133 [9] Yu Zhiqiang, Wenzhi Yu, Xie Yingke, Zhou Suyi. The control system of multi-parameter water quality tester based on raspberry pie [J]. Instrumentation technology and Sensors, 2015 (06): 20-23. [10] Han Xiao, Wenzhi Yu, Xie Yingke, Wei Kanglin, Zhou Xiaofeng. Software design of control and signal processing system for multi-parameter water quality tester [J]. Instrumentation technology and Sensors, 2014 (08): 20-22