Keywords

1 Introduction

Hydrogen cyanide (HCN) is a colorless transparent toxic liquid with a bitter almond flavor. It is widely used in the electroplating industry, mining industry, cabin and warehouse smoked rodent control, manufacturing all kinds of resin monomers such as methyl acrylate resin and other industries. Furthermore HCN can generate a lot of derivatives, which have important uses in the field of pharmaceuticals, pesticides, fuel, light-sensitive chemicals, and engineering materials. Therefore HCN market demand is broad. Nowadays most of the production of HCN comes from the direct production, while the rest comes from the byproduct of acrylonitrile. But direct method HCN conversion rate is usually low (60–70 %). Therefore, the use of advanced computational intelligence techniques to study imminent HCN conversion rate increases. However, the current research literature in this respect at home and abroad is rare. Neural network can establish the object mathematical model without considering the exact process by its strong nonlinear approximation ability, it is widely used in the modeling of complex chemical processes [13]. Particle swarm optimization (PSO), which comes from simulating birds foraging in the process of migration and clustering behavior, is a global random search algorithm based on swarm intelligence. PSO can be used to solve a large number of nonlinear, nondifferentiable and multi-peak complex optimization problems [4, 5]. In this paper, BP neural network is used for establishing the soft sensor model of HCN conversion rate firstly, then taking the maximum HCN conversion rate as objective function, an improved PSO algorithm is presented to optimize the operating parameters. The research results can provide a new way of thinking to improve HCN conversion rate in actual production process.

2 HCN Conversion Rate Soft Sensing Model Based on BP Network

The direct method is also called Andrussow method by using methane, ammonia gas and oxygen as the main raw material. It is an ammonia oxidation with the raw material mixture passing through the wire mesh-like catalyst bed made of platinum iridium alloy in the conditions of atmospheric pressure and 1000 °C above. Literature [6] indicates that three-layer BP neural network can be realized arbitrarily complex nonlinear mapping as long as enough hidden nodes. That is to say it can approximate function with arbitrary precision to achieve a very curve fitting. Therefore we use three-layer BP neural network to establish HCN production process firstly. Comprehensively analyzing of the HCN production process, the nine operating parameters of HCN (the settings of the control system, shown in Table 50.1) is chosen as the input variables of BP neural network and the output is HCN conversion rate. The nodes of hidden containing layer are 5, the transfer function of hidden layer nodes is Tausig function and the transfer function of output layer nodes is Logsig function.

Table 50.1 Operation parameters of HCN

The BP neural network training samples come from 3411 groups of HCN real-time production data in Chongqing Unisplendour Chemical Plant, in which 3241 groups are selected randomly as network training and the rest of 170 groups are selected as predictive test. Firstly HCN production data are preprocessed, including gross error elimination, \( 3\sigma \) method and five-spot triple smoothing algorithm. The preprocessed data are shown as Table 50.2, where \( \alpha \) denotes HCN conversion rate.

Table 50.2 Actual production data of HCN

Figure 50.1 shows the predicted HCN conversion rate by trained BP neural network and Fig. 50.2 shows the error between prediction output and desired output. The prediction performance indicators are as follows: mean absolute deviation (MAD) is 1.1248, mean square error (MSE) is 2.4826, mean forecast error (MFE) is 0.0327 and mean absolute percentage error (MAPE) is 1.5938.

Fig. 50.1
figure 1

Prediction output

Fig. 50.2
figure 2

Prediction error

3 IPSO Algorithm

Particle swarm optimization (PSO) algorithm is a new evolution of computing technology based on social group behavior. The basic idea of PSO algorithm is derived from study on the behavior of birds prey. In PSO, each iteration of the particle updates itself by tracking personal optimal position and group optimal position until now. Therefore, this algorithm is an efficient parallel search algorithm, which can be used to solve a large number of nonlinear, nondifferentiable, and multi-peak complex optimization problems. The basic PSO algorithm can be described as follows:

Assume m particles compose a group in D-dimensional target search space, where the ith particle is expressed as a D-dimensional vector \( x_{i} = (x_{i1} ,x_{i2} , \cdots x_{iD} ), \) that is the potential solution. The best previous position of any particle is recorded and represented as pbest. The best particle among all particles is called as gbest. The flight velocity denoted by \( v_{i} = (v_{i1} ,v_{i2} , \cdots v_{iD} ) \) is also a D-dimensional vector. The position and velocity of particles are updated according to the following equations.

$$ v_{id} (t + 1) = \omega v_{id} (t) + c_{1} r_{1} \left[ {pbest_{id} (t) - x_{id} (t)} \right] + c_{2} r_{2} \left[ {gbest_{d} (t) - x_{id} (t)} \right] $$
(50.1)
$$ x_{id} (t + 1) = x_{id} (t) + v_{id} (t + 1) $$
(50.2)

where \( i = 1,2, \cdots ,m,d = 1,2, \cdots ,D \), ω is inertia weight which decides the impact of particle present speed to next generation. \( c_{1} \) and \( c_{2} \) are acceleration coefficients with positive values. The relative sizes of \( c_{1} \) and \( c_{2} \) reflect the relative importance of \( p_{i} \) and \( p_{g} \) in evolution. \( r_{1} \) and \( r_{2} \) are random numbers between 0 and 1. \( v_{id} \in \left[ { - v_{d}^{\hbox{min} } ,v_{d}^{\hbox{max} } } \right] \), \( x_{id} \in \left[ { - x_{d}^{\hbox{min} } ,x_{d}^{\hbox{max} } } \right] \), \( v_{{_{d} }}^{\hbox{min} } \), \( v_{{_{d} }}^{\hbox{max} } \), \( x_{d}^{\hbox{min} } \) and \( x_{d}^{\hbox{max} } \) represent actual bounds.

Suitable selection of inertia weight provides a balance between global and local explorations, thus requiring less iteration on average to find a sufficiently optimal solution. As originally developed, often decreases linearly from 0.9 to 0.4 during a run. The inertia weight is set according to the following equation [7].

$$ \omega = \omega_{start} - (\omega_{start} - \omega_{end} )*k/G_{\hbox{max} } $$
(50.3)

where \( \omega_{start} \) is initial inertia weight, \( \omega_{end} \) is inertia weight iterated to maximum number, \( k \) is the number of iterations, \( G_{\hbox{max} } \) is the maximum number of iterations.

As we known, each particle only uses individual optimum and group optimum information in basic PSO algorithm. Considering the sharing of information in group is the result of an evolutionary, the idea of group average position is presented to avoid group into a local optimum and accelerate the convergence.

Supposing that a particle swarm is composed of m particles, then the positions of m particles can be denoted as \( \left[ {P_{1} \;\;P_{2} \; \cdots P_{m} } \right] \), and the average position of \( m \) particles is

$$ Pmean = \sum\limits_{i = 1}^{m} {\frac{{P_{i} }}{m}} $$
(50.4)

Therefore the velocity update equation of IPSO algorithm is

$$ v_{id} (t + 1) = \omega v_{id} (t) + c_{1} r_{1} \left[ {pbest_{id} (t) - x_{id} (t)} \right] + c_{2} r_{2} \left[ {gbest_{d} (t) - x_{id} (t)} \right] + c_{3} r_{3} \left[ {pmean_{d} (t) - x_{id} (t)} \right] $$
(50.5)

where \( c_{3} \) is a positive constant, \( r_{3} \) is a uniform random number between 0 and 1, \( \omega \) is shown as Eq. (50.3). The position update equation of IPSO algorithm is equal to basic PSO algorithm as Eq. (50.2).

It can be seen from Eq. (50.5) that each particle in IPSO draws lessons form the experience of other particles and uses more information to decide its own behavior. In other words, each particle is on longer search between group optimum and individual optimum, but in group optimum, group average position and individual optimum. IPSO algorithm still retains particle swarm global best position, and furthermore, it can speed up the convergence rate, while group average position is used for avoiding the group into a local optimum.

4 Operating Parameters Optimization of HCN Conversion Rate

Choosing the maximum HCN conversion rate as fitness function, GA and IPSO are used for optimizing the operating parameters respectively and the results are shown in Table 50.2; Figs. 50.3 and 50.4. In IPSO, evolutionary generations are 200, population numbers are 80, acceleration coefficients \( c_{1} = c_{2} = 1.5 \), \( c_{3} = 1.2 \), inertia weight \( \omega = 0.9 - 0.5*k/70 \). In GA, crossover probability is 0.4, mutation probability is 0.2, evolutionary generations and population numbers are the same as IPSO. The actual constraint ranges of operating parameters are also shown in Table 50.3.

Fig. 50.3
figure 3

Fitness curve of GA

Fig. 50.4
figure 4

Fitness curve of IPSO

Table 50.3 Constraint ranges and optimization results of HCN operating parameters

The simulation results show that the optimization performance of IPSO is better than GA. IPSO has a faster convergence rate and stronger extremum optimization ability. In Figs. 50.3 and 50.4, GA evolves to 188 generation to converge to 79.1282, while IPSO only evolves to 141 generation to converge to 82.4150. The optimized operating parameters are shown in Table 50.2.

5 Conclusion

According to the fact that direct method HCN conversion rate is low in Chongqing Unisplendour Chemical Plant, in this paper, firstly the soft sending model of HCN conversion rate is established by BP neural network, and then the operating parameters of HCN production process are optimized by GA and IPSO respectively to achieve extremum optimization. IPSO takes into account the dynamic inertia weight and the particle average position to avoid falling into local optimum and accelerate the convergence. The simulation results show that the optimization performance of IPSO is better than GA. Furthermore, the optimized operating parameters have been used in practical production to improve HCN conversion rate indeed, therefore this paper has a certain academic value and engineering significance.