Jian Long,Kai Deng,Renchu He,
1 Key Laboratory of Smart Manufacturing in Energy Chemical Process, Ministry of Education, East China University of Science and Technology, Shanghai, China
2 Engineering Research Center of Process System Engineering, Ministry of Education, East China University of Science and Technology, Shanghai 200237, China
Keywords:Blend Optimization algorithm Neural networks Particle swarm optimization Mixed integer programming
ABSTRACT Gasoline blending scheduling optimization can bring significant economic and efficient benefits to refineries.However,the optimization model is complex and difficult to build,which is a typical mixed integer nonlinear programming (MINLP) problem.Considering the large scale of the MINLP model,in order to improve the efficiency of the solution,the mixed integer linear programming -nonlinear programming (MILP-NLP) strategy is used to solve the problem.This paper uses the linear blending rules plus the blending effect correction to build the gasoline blending model,and a relaxed MILP model is constructed on this basis.The particle swarm optimization algorithm with niche technology (NPSO) is proposed to optimize the solution,and the high-precision soft-sensor method is used to calculate the deviation of gasoline attributes,the blending effect is dynamically corrected to ensure the accuracy of the blending effect and optimization results,thus forming a prediction-verification-reprediction closed-loop scheduling optimization strategy suitable for engineering applications.The optimization result of the MILP model provides a good initial point.By fixing the integer variables to the MILPoptimal value,the approximate MINLP optimal solution can be obtained through a NLP solution.The above solution strategy has been successfully applied to the actual gasoline production case of a refinery(3.5 million tons per year),and the results show that the strategy is effective and feasible.The optimization results based on the closed-loop scheduling optimization strategy have higher reliability.Compared with the standard particle swarm optimization algorithm,NPSO algorithm improves the optimization ability and efficiency to a certain extent,effectively reduces the blending cost while ensuring the convergence speed.
Gasoline is one of the most important products of a typical refinery,accounting for more than 60% of the total revenue [1,2].The blending process of gasoline is to make comprehensive use of various components of oil produced in the refining process and mix them in a certain proportion to produce blended gasoline that meets the national standards.On the premise of meeting the national standards,gasoline blending scheduling problem is to reduce the times of oil movement and blending and pouring as much as possible,improve the utilization efficiency of storage tanks,and make rational and effective utilization of component oil resources,from the perspective of the existing resources of refineries,taking into account the factors such as blending capacity,operating rules,capacity limitations of component tanks and product tanks,product market demand and product specification of the refinery,optimize the inventory of component oil and product oil [3],and maximize the economic benefits of the refinery while meeting the upper demand plan[4,5].However,in the actual gasoline blending process,some attributes show significant nonlinear characteristics [6],such as gasoline octane number.There are also many complex constraints in the actual scheduling process of refineries,and uncertainty factors such as component oil resources and product orders make the actual gasoline blending scheduling problem more complicated[7,8].Therefore,it is particularly important to establish an effective gasoline blending scheduling optimization model and use scientific and effective intelligent optimization algorithm to solve the problem,so as to improve the solution efficiency as much as possible to guide the actual production of the refinery.
The research on the optimization problems of blending and scheduling can bring huge increase in economic benefits.In Honeywell’s blending solution [9],the blending scheduling process is divided into blending planning module and blending property module for automatic control respectively,achieving significant economic benefits.Aspen has also developed a blending solution that includes Aspen MBO and Aspen Blend.The former can optimize the blending formula at the scheduling level,and the latter can update the formula generated in the process of oil blending scheduling optimization online to ensure that the product quality attributes meet the standard [10].
In recent years,a number of achievements have been made in the research of oil blending scheduling,among which the mathematical programming method has been widely used.The shortterm scheduling problem can be expressed as a mixed integer linear programming(MILP)model which depends on the continuoustime formula[11].Schneider Aet al.[12]developed MILP model for the operation of the blended product tanks in the refinery,aiming at minimizing the scheduling of movement in the tanks,and gave an optimization algorithm.Gaoet al.[13] layered the scheduling optimization problem based on decision tree,combined the decision layer with the optimization layer to accelerate the solving time of MILP model,and avoided the huge amount of computation caused by scheduling dynamics as much as possible.Cerdaet al.[14] proposed the continuous-time MILP model to solve the minimum operating cost,which includes most of the operational constraints in practice.Then,combined with nonlinear blending correlation and nonlinear constraints,it further expanded to the treatment of nonlinear problems,formed a continuous time mixed integer nonlinear programming(MINLP)model,proposed an effective mixed integer linear programming -nonlinear programming(MILP-NLP) strategy to obtain an approximate optimal solution by approximate conversion of linear blending and nonlinear blending,which has a good performance in predicting key blending properties and accurately tracking product tank inventory [15].
The introduction of nonlinear factors in the model construction can more accurately describe the characteristics of the blending process and improve the performance of the model,but the optimization solution of the model will also become more challenging.The following researches provide different ideas for solving complex nonlinear models.Castillo and Mahalec [16] developed a reduced-size continuous-time MINLP model for gasoline blending scheduling,which takes nonlinear factors into account when calculating gasoline octane number,and conducted experiments based on large-scale blending problems.In his follow-up work,a new global optimization algorithm was proposed to solve the MINLP problem [17],that was,the value range of variables in the model was reduced by piecewise McCormick relaxation(PMCR),the estimation of the global optimal solution and the convergence speed of the model were improved.Loteroet al.[18]decomposed the MINLP model at two levels,and improved the MILP relaxation by using redundant constraints on the basis of discrete-time MINLP model,thus improving the solving speed of the algorithm.By using a preprocessing algorithm,Chen and Maravelias [19] minimized the cost of the medium-scale multiperiod blend scheduling problem(MBSP),which shortened the solution time of the MINLP model and models based on linear approximation.Li and Korimi [20]has developed a novel continuous-time formulation from the perspective of gasoline product orders to complete the integrated scheduling of gasoline blending and order delivery operations,minimized quality giveaways,reduced inventory costs,and avoided solving the problem of MINLP model.
Although the method of mathematical programming can be widely used in solving the problem of blending scheduling optimization,the commonly traditional optimization algorithms include Lagrangian relaxation method,branch and bound method,gradient descent method and so on [21-23].However,due to the high complexity of industrial gasoline blending scheduling problem,there are huge and diverse constraints,the scale of the model will continue to expand,and the dimension will increase relatively,sometimes,problems such as exponential explosion may occur.With the development of artificial intelligence,some intelligent algorithms also have many applications in gasoline blending scheduling optimization problems,such as ensemble random weights neural network[24],least square neural network and particle swarm optimization[25],etc.The graphical genetic algorithm(GGA) based on discrete-time and continuous-time [26,27] has good application in scheduling of gasoline blending and distribution (SGBD).Debashish developed a reactive crude oil scheduling method based on structured adapted genetic algorithm for marine-access refinery,which effectively dealt with the impact of uncertainties in offshore crude oil scheduling [28].Hollet al.[29]transformed the scheduling problem into a discrete dynamic resource allocation problem,and proposed an optimization algorithm based on niching genetic simulated annealing algorithm(NSGA)to effectively solve the pareto optimal solution of the problem.Although the intelligent algorithms make up for the shortcomings of traditional optimization algorithms in some respects,there may be a problem that it is easy to fall into local optimization in the later stage of search.Furthermore,the verification and evaluation of the optimization result should also be considered,so as to form a complete scheduling optimization method.
To solve the above problems,firstly,the nonlinear characteristics of some gasoline blending attributes and the actual constraints in the blending scheduling process are considered in this paper,and the MINLP model is constructed and solved by MILP-NLP two-layer strategy.The particle swarm optimization algorithm(PSO)and niche technology based on sharing mechanism are combined to optimize the relaxed MILP model in the inner iteration task,which can maintain or increase the diversity of the population,enhance the optimization ability of the algorithm to a certain extent,avoid the‘‘premature”phenomenon,and improve the solving efficiency.A closed-loop optimization strategy of prediction-v erification-reprediction is formed by dynamic corrected of the blending model combined with the high-precision prediction models of blended gasoline properties,which improves the reliability of the optimization results.In the outer-lever iteration,integer variables in the MINLP model are fixed to the MILP-optimal values,and the final optimization result is obtained by solving a simplified NLP problem,which is an approximate optimal solution.Finally,an actual gasoline production case in a refinery has proven the optimization effect of the proposed method.The main contributions of this paper are as follows.
(1) The MINLP model of gasoline blending scheduling is constructed based on the nonlinear blending model and process constraints.MILP-NLP strategy is used to optimize the solution.
(2)The particle swarm optimization algorithm with niche technology (NPSO) algorithm is proposed to solve the MILP model,which improves the solving efficiency and enhances the optimization ability of the algorithm to a certain extent.
(3) Based on the high-precision prediction model and the dynamic corrected blending model,a novel prediction-verifica tion-reprediction closed-loop scheduling optimization strategy is proposed.
(4) The effectiveness of the proposed method is verified by an industrial refinery(3.5 million tons per year)production case with significant reduction in blending costs.
Gasoline blending refers to the comprehensive utilization of various component oils produced in the process of petroleum refining,and mixing them according to the blending formula to produce blended gasoline that meets the national standard.Gasoline blending not only has an important impact on the quality of gasoline products,but also directly affects the economic benefits of enterprises.
There are two main types of oil blending processes:tank blending and pipe blending.Tank blending is to mix various blending components and additives into the blending tank according to the preset ratio,and then mix them evenly by means of electric stirring and pouring.Pipe blending is controlled by automatic instruments to control the flow rate of each reference component.The components and additives are sent to the blending pipe and blenders in proportion according to the preset to make them fully mixed.One of the advantages of pipe blending is that it can conveniently and accurately complete the preset scheduling tasks based on the automatic instrument and control systems,which is also convenient for operators to implement the production scheduling of oil products [30].The gasoline blending scheduling process in practical industrial applications is usually combined with its optimization system,and the specific form is shown in Fig.1.
Fig.1.Schematic diagram of the industrial gasoline blending process.
The main objective of gasoline blending scheduling is to provide initial blending formula and specific batch scheduling scheme.Different component oils and additives are fully mixed under the guidance of the optimal formula to obtain blended gasoline that meets the national standard.According to the optimal scheduling scheme,it can not only complete the order demand of different batches,but also make full use of the existing resources of the refinery to optimize the inventory of component oils and product oils,so as to achieve the maximum economic benefits.
Although the process of tank blending is easy to realize and operate,there are some problems: (1) the blending formula has low precision,and the blending scheduling process depends on trial and error method and the experience of on-site blending operators;(2)In the process of operation,the pouring and storage tank operation between each component oil takes a long time,requires more storage tanks,and the blending process needs to be completed in batches.The continuity of gasoline production process can be enhanced by using pipe blending method:(1) each component oil can be fully utilized and the success rate of blending is high;(2) It saves the blending time,reduces a lot of manpower and material resources,and reduces the loss of resources;(3) Suitable for mass production,the blending cost is significantly reduced,and the economic benefits of enterprises are directly improved.
In the process of gasoline blending scheduling,factors such as nonlinear characteristics of blended attributes,uncertainty of component oil attributes,and blending constraints of component tanks and product tanks all increase the complexity of the problem.When the blended product oil fails to meet national standards,it needs to be reblended,resulting in resource waste and loss of economic benefits [31].There are few blending attributes or properties,usually containing only octane number and sulfur content,resulting in the accuracy of the final scheduling optimization results is not high enough.
In this paper,a MINLP model of gasoline blending scheduling was established by considering the nonlinear characteristics of some attributes in gasoline blending and combining with the actual constraints in the scheduling process.A relaxed MILP model was constructed based on the linear blending rules.The NPSO algorithm was used to solve the MILP model,the high-precision neural network prediction model of gasoline properties was used to verify the optimization results,and the blending model was dynamically corrected to form a complete closed-loop scheduling optimization method.Finally,in the outer-lever task,the integer variables in the MINLP model were fixed to the MILP-optimal value,and the approximate optimal solution of the MINLP model was obtained by solving the NLP problem,which reduces the complexity of the solution process and improves the solving efficiency.The technical scheme is shown in Fig.2.
Fig.2.Diagram of closed-loop scheduling technical scheme.
Gasoline blending scheduling optimization can be divided into formula optimization and blending scheduling optimization.The purpose of formula optimization is to provide optimized initial blending formula.And the purpose of blending scheduling optimization is to give specific scheduling plan,that is,when blending,which product tank to use,which product to blend,etc.According to the previous research,the oil blending scheduling problem can be described as a mixed integer programming problem,and the relevant models are established according to the actual optimization objectives and constraints.In the process of gasoline blending,some properties of blended gasoline can be obtained by linear addition,while others show nonlinear characteristics.In order to describe the process of gasoline blending as accurately as possible and obtain accurate property value of blended oil,it is important to construct a nonlinear model of blended gasoline properties,some important research works have been published[32].For the specific process of blending scheduling,the appropriate objective function and constraint conditions should be selected from the order demand,product production,blending and storage,product index and other levels according to the actual situation of the refinery.Finally,the MINLP model of gasoline blending scheduling optimization should be established,which can be efficiently solved with appropriate methods to obtain the optimal solution or feasible solution applicable to the actual production process.It has important research and application significance to provide scientific guidance for the industrial production of refineries.
In the process of gasoline blending production in refinery,the blended oil properties after blending will be predicted according to the ratio and properties of each component oil.The purpose is to compare the predicted properties of the product oil with the quality index required by the government,so as to verify the effectiveness and feasibility of the initial blending formula and further optimize the blending formula.Refined gasoline has many property requirements,such as research octane number (RON),sulfur content (SUL),benzene content (BEN),olefin content (OLF) and so on.For different brands of gasoline,there are different threshold requirements for relevant property indicators.For the nonlinear blending property,take the RON of gasoline as an example,which can be obtained by the following calculation method [33].In Eq.(1),RONiis the RON ofith component,diis the RON compensation value ofith component,his the parameter to be evaluated,siis the sensitivity ofith component.RONi,finalis the RON value after quantization compensation for theith component oil.In Eq.(2),assuming an ideal blend,RONjis the RON of thejth blended gasoline,andrcjiis the formula of ofith component.
In Eq.(3),R,DandSrepresent corresponding vectors respectively,and the fitted data of blended gasoline octane number in groupldatais obtained.The RON of the blended oil shall meet the index requirements of the corresponding product.Other gasoline properties,including SUL,BEN,OLF,etc.,can be obtained through linear calculation.For example,the commonly used blending effect model refers to the addition of blending effect compensation on the basis of the linear blending rule.Properties of blended oil can be obtained by linear addition of properties of compensated components as shown in Eqs.(4) and (5) [34].
where,Cp(Pvk,i)is the property value after compensation.Pvk,iandBvk,iare the measured value and blended effect value of thekth property of theith component respectively.The property prediction of blended gasoline was obtained by the weighted sum of compensated property values,as shown in Eq.(5),whererciis the recipe of theith component andPmix_kis the prediction ofkth property of blended gasoline.
As mentioned above,the MINLP model of gasoline blending scheduling should be constructed on the actual situation of the refinery.Time must be considered in the modeling,such as splitting the whole scheduling cycle in days.The optimization objective function can be selected according to oil inventory,economic benefits,blending cost,etc.,taking the minimum blending cost as an example,the specific form is as follows:
where,jrepresents product;nstands for product tank;tstands for time period;irepresent the component;J,N,TandIrepresent the set ofj,n,tandirespectively.Stnjrepresents the amount of blended productjin product tanknon dayt;rcjirepresents the formula of componenticorresponding to productj;Firepresents the unit cost of componenti.
The full utilization of component oils is considered to reduce the excess product quality and improve the success rate of onetime blending to complete the formula optimization.According to the market demand,the existing resources of the refinery should be rationally utilized to produce more products with better quality under the premise of meeting the quality standards,formulate the optimal production scheduling scheme,guide theon-siteblending production,and complete the optimization of production scheduling;And from the actual situation and limitation of field blending operation to complete inventory optimization.Based on this,constraints and model variables can be set as follows:
(1) Blending operation constraints:
where,wtnjis a binary 0-1 variable,indicating whether there is a product blending operation in product tanknon dayt.A value of 1 means there is a product blending operation,and a value of 0 means no blending.
(2)Blending capability constraints:Due to the limitation of the maximum flow velocity of the blending device,the maximum daily blending volumeTmaxis also limited:
(3) Order constraints: The amount of blended product from each batch should meet the corresponding product order demand:
Here,Orijis the order quantity of productjon dayt.
(4) Material balance constraints on component oil inventory:
where,Comktiis the inventory of component oiliat the end of dayt,Ctiis the planned production of component oilion dayt.
(5) Material balance constraints of product tank:
Here,Poktjis the inventory of productjat the end of dayt.
(6) Component oil inventory constraints:
Comktiis the inventory of component oiliat the end of dayt,Comliis the lower inventory limit of componenti,and Comhiis the upper inventory limit of componenti.
(7) Product tank capacity constraints:
Here,Tlnis the lower tank capacity limit of product tanknandThnis the upper tank capacity limit of product tankn.
(8) Product tank storage constraints: When the blending product is loaded into the product tank,it should be satisfied whether the product tank can store the product of the brand.In addition,during the blending operation on the same day,only one product can be stored in the same product tank.
Above,utnjrepresents whether the binary constraint variable of productjis installed in product tanknon the dayt.If so,the value is 1;otherwise,it is 0.xtnjrepresents the binary constraint variable of whether product tankncan store productj.If the value is 1,it can be stored;otherwise,it cannot be stored.
(9)Product tank blending constraints:If a product tank is operated on dayt,the type of product stored in the tank is the same as the type of product produced on that day or the day before.
(10) Blending ratio constraints: For some parametrical component oils,the formula can be limited separately,such as methyl tert-butyl ether (MTBE) not more than 15%.In Eq.(20),rcjMTBErepresent the blending formula of MTBE in productj:
Combined with the actual knowledge experience in the process of gasoline blending,the total formula of each component oil with parameters is 100%.Some blending ratios close to special limits shall be treated:for example,when the ratio of the oil of the components involved is less than a certain limit,suppose 0.02,the valve of the blending device cannot accurately complete the flow control or is directly closed,and the corresponding blending ratio is zero.
For the case of a small amount of mixed purchased component oil in the blending process,the model can also be simplified according to the actual blending experience:
where,rcjipis the formula of blended purchased component oil,and the relevant boundary settings can be adjusted according to actual cases.
(11) Product specification constraints:
The blended product shall meet the national standards.Ptytnkrepresents thekth property value of the product stored in product tanknon dayt,Psjkand represents thekth property standard of productj.Since the RON requirement is not lower than the national standard,it shall be considered separately when calculating the property constraints.
The nonlinear gasoline blending model can obtain more accurate property data of gasoline blending.And the blending scheduling model combined with the calculation process of nonlinear blending properties has a high computational complexity.The solution of its optimization model requires huge computational cost,and whether the optimal solution of MINLP model can be obtained is a problem worth discussing.Therefore,from the perspective of model solution and actual blending process,it is feasible to construct a linear relaxation model of blended gasoline properties to help improve the efficiency of model solving.For example,the blending effect model mentioned in the previous section can be used to correct the blending property and calculate the properties of blended gasoline by fitting a large number of historical data including the properties of the component oil and the blended oil.PLS method can be used to calculate the blending effect value of gasoline components from the historical blending data,as shown in Eq.(26)
The identification of relevant parameters is obtained by fittingmgroups of gasoline blending data.That is,the linear form shown in Eq.(27)can be obtained by the transformation of above blending formula matrix.
wherercl,iis the recipe of theith component in thelth data set.
Based on the blending effect model of gasoline properties from Eqs.(26)and(27),combined with the objectives and constraints in Eqs.(6) to (27),a MILP model with the goal of minimizing the blending cost was constructed.The solution of MILP model can be realized in a variety of ways.
The MILP-NLP solution strategy refers to obtaining a good initial point by solving the relaxed MILP model.The integer variables in the MINLP model are fixed to its MILP-optimal value,thus simplifying the original MINLP model into a reduced size NLP model,which can usually get the result in a short time interval,and the result is the approximate optimal solution of MINLP [15].
It can be understood that the MILP model constructed in the first two sections is the relaxation model of the original MINLP model.As an inner-lever iteration of solving the MINLP model,it can effectively improve the solving speed of the model.The solution results of the MILP model can be used as the lower bound of the solution space of the original problem.On the other hand,if the solution of MILP model only has deviation in part of the nonlinear blending property,but can meet other constraints in the MINLP model,the integer variables in the optimization result are used to simplify the original MINLP model,so that a feasible solution of the original problem can be obtained through the outer-lever iteration of the solution of the NLP problem in a short time.The MILP-NLP solution strategy can obtain the feasible solution of the original MINLP problem with lower computational cost and time,which has good performance.
4.1.1.Particleswarmoptimization
The PSO algorithm was an optimization inspired by the foraging behavior of birds [35].Its basic idea is to find food (optimal solution) according to the mutual communication and exchange of information among individuals in birds.Each bird in the flock is equivalent to a particle.It can be imagined that when the flock is looking for food in an open space,they do not know where the food is in advance,but they can judge the approximate location of the food according to the smell of the food.In this way,the birds will first search for the food closest to them and share the location information of the food to other individuals in the flock.In this way,other birds will take this as the basis,constantly change their flight speed and direction,fly in the direction of food,and finally reach their destination.This is the process of seeking the optimal solution.The flight process can be described by Fig.3.Considering that the discrete tasks to be performed in the gasoline blending scheduling cycle are unknown,the heuristic algorithm and meta heuristic algorithm cannot be directly applied [36] this paper uses an indirect method to design the algorithm.
Fig.3.Particle movement diagram of PSO algorithm.
As shown in Fig.3,suppose that the particles are flying in ajdimensional space,the whole population containsNparticles,and the orientation of theith particle is expressed as vectorxi=(xi1,xi2,···,xij).The flight speed vector is vi=(vi1,vi2,···,vij),the optimal position of theith particle ispi=(pi1,pi2,···,pij),and the optimal position of all particles ispg=(pg1,pg2,···,pgj).the specific iterative form of speed and position of standard PSO algorithm is as follows:
where,tis the number of iterations;wis the inertia weight,and its value range is [0,1].c1andc2are constants;r1andr2are two random constants,usually between [0,1].
4.1.2.Niche technology
Niche is a biological concept.According to the evolution theory in nature,there are always organisms of the same category in the same living environment.The living habits and laws of these organisms are similar.Therefore,each organism has its own living environment.This living environment is niche.Organisms of the same category are constantly competing in their own niche,learn from each other and breed offspring through ‘‘communication”.However,in the living environment with limited resources,individuals with strong adaptability rely on their own advantages to continuously obtain more resources,which makes other vulnerable individuals have to be eliminated.This is natural selection and survival of the fittest.After multiple generations of selection,better individuals will evolve and new species will be produced,which is of great significance to maintain population diversity[37].
4.1.3.Particle swarm optimization with niche technology
When solving large-scale models,the standard PSO algorithm has poor global search ability and low search accuracy.With the increase of iteration times,the trend of particle motion may gradually decrease,showing the situation of ‘‘staying in place” or the global optimal solution is not updated.In order to avoid this situation and increase the diversity of the population,this experiment integrates the niche technology based on the standard PSO algorithm,and all particles are not in the same environment,but in multiple divided niches,and uses the sharing mechanism to realize the niche.
The idea of algorithm design is to determine the half diameter of niche after initializing particle swarm optimization,including population size,maximum number of iterations,spatial dimension,upper and lower limits of position and speed,initial weight,final weight,self-learning factor and social learning factor,Then the particles in the population can be divided into multiple niche populations.For the two particles with high similarity,punishment mechanism is adopted,and for some edge searching particles,their fitness is increased,so as to further improve the diversity of the population.Use the following distance formula:
where,dmnrepresents the Hamming distance between particlemand particlen.Set the initial threshold α0,whendmnis less than α0,the particle will be placed in this niche.Continuously iterate according to Eq.(28),and use the sharing mechanism to adjust the fitness value of each particle,that is,use the sharing degree between populations to adjust the fitness value of particles.Use the following formula to calculate the value of the shared function between particlemand particlen.
In this formula,G(dmn)is the sharing function between particlemand particlen.The sharing degree of a particle in the population is the sum of the sharing function of this particle and other particles in the same niche,likeGm.Then the fitness value of the updated particles is calculated through the sharing degree:
Dt+1(Xm)is the fitness value after sharing,andD(Xm) is the fitness value before sharing.
For the inertia weightwof particles in standard PSO algorithm,when the value ofwis large,the particles are also greatly affected by the inertia of the previous generation;When thewvalue is small,the step size of particle update is also small.We hope that the population has strong global search ability at the initial stage of search to avoid falling into local extremum,and enhance local search ability at the later stage of search.In the previous PSO algorithms,most of them use linear decreasing inertia weight,this paper uses nonlinear decreasing method to realize:
Here,wmaxis the initial weight,wminis the final weight;tmaxis the maximum number of iterations.To sum up,we can design a particle swarm optimization algorithm with niche technology(NPSO) according to the following steps.The algorithm flow chart is shown in Fig.4.
Fig.4.The algorithm flow chart of NPSO.
(1)Initialize each particle and important parameters in the particle swarm,set the threshold of niche and divide the niches.
(2) Calculate the fitness value of particles in each group one by one,record it as the individual best positionpBest,and find out the group best positiongBest.
(3)The velocity and position of particles are updated iteratively according to the iterative formula of PSO algorithm,in which the inertia weight is calculated according to nonlinear decreasing.
(4) For each particle,the fitness is recalculated in the solution space according to the updated position.
(5) The sharing degree of particles in each niche is calculated according to the sharing degree calculation formula,and the fitness value is adjusted accordingly.
(6) Compare the current position of the particle with the individual optimal value and the group optimal value.If the fitness is better,replacepBestandgBest,otherwise it remains unchanged.
(7)If the end conditions are met,exit the calculation and output the global optimal solution,otherwise return to step (3).
Refined gasoline has many property requirements.Among these quality standards,some are obtained by linear addition,while others show nonlinear characteristics.These nonlinear blending properties (such as RON) are often more demanding than linear addition in predicting the properties of blended oil,and the prediction model established is also more complex.In terms of gasoline octane number prediction model,it can be divided into regression model and neural network model based on machine learning.Most of the parameters in the regression model have practical significance.Through regression analysis,the model can be fitted to a certain extent to get the parameter values.Neural network model can build property prediction model by collecting a large number of historical data,including component property measurement values and blending formula.The high-precision gasoline properties prediction model is used to obtain the highly reliable property values of blended gasoline in time.In this paper,the backpropagation(BP)neural network is used as the soft sensor method to establish the gasoline attribute prediction model in the blending process.
In this paper,a total of 2100 groups of blending data are collected from March to December 2020 in a refinery,including 750 groups of 92# gasoline data,900 groups of 95# gasoline data and 450 groups of 98# gasoline data.Among them,there are 5 kinds of component oils,including reformed gasoline,MTBE,non aromatic gasoline,catalytic gasoline and C5.Properties include RON,SUL,BEN,and OLF.The mean square error (MSE) is used as the evaluation standard.In Eq.(34),Xlis the measured value of groupldata,Ylis the predicted value of groupldata,andmis the number of samples.
When modeling with BP neural network,taking the property prediction of 95#gasoline as an example,the structure of the network is first determined.According to the collected blending data,the input layer is determined to contain 10 neuron nodes x=[x1,x2,···,x10]T,wherex1,x2,x3,x4,x5are the blending formulas of five component oils,x6,x7,x8,x9,x10are the properties of five component oils,and the output of the modelyis the property prediction value of the product.
The number of hidden layer neuron nodes is determined by the results of multiple groups of experimental tests.The specific parameters of BP network model are shown in Table 1.
Table 1 Parameters of BP network
In addition,Sigmoid function is selected as the activation function of the hidden layer:
Yhis the output of thehth neuron node in the hidden layer:
Where,Xiis the value of theith input node,Vihis the weight from the input layer to the hidden layer,and θhis the threshold of thehth neuron node in the hidden layer,which can only be activated if the threshold is exceeded.There is only one neuron node in the output layer,and its output is:
Ois the output of the neural network,the predicted value of 95#gasoline,Whois the weight from the hidden layer to the output layer,γ is the threshold value of nodes in the output layer.Finally,the topological structure of the neural network for property prediction of 95# gasoline is determined,as shown in Fig.5.
Fig.5.The topological structure of the neural network for property prediction of 95# gasoline.
In this experiment,the neural network toolbox of Matlab software is used to predict and analyze the data.For example,900 groups of 95#gasoline data are divided into training set,validation set and test set according to a certain proportion (70%,15% and 15%).Fig.6 shows the prediction results of the property prediction models of 95#gasoline on the test set.It can be seen that the neural network model has good prediction effect and high prediction accuracy,and the prediction results are relatively stable,withRvalues above 0.91.The constructed neural network model can be used to predict the properties of blended gasoline.In this experiment,the prediction results of blending effect model and neural network model are compared and analyzed.
Fig.6.Distribution of prediction results of four properties of neural network model of 95# gasoline including: (a) RON,(b) SUL,(c) BEN and (d) OLF.
(1) Research octane number (RON)
Taking 95# gasoline as an example,when the relationship between RON of blended oil and component oil is studied by blending effect model,it is necessary to obtain appropriate blending effect compensation value from historical blending data.And the historical data is used as regression set and test set at a proportion of 9:1.The simplified blending effect model is shown in Eq.(38).Fig.7 shows the comparison diagram of the absolute value of the error of the RON prediction data when using the blending effect model and the neural network model.
Fig.7.RON comparison of the absolute value of the prediction error between the blending effect model and the neural network model.
where,cpsirepresents the compensation values of the corresponding properties fitted from historical data in the blending effect model,the same below.RON95#preis the predicted value of 95#gasoline and RONiis the measured value of RON ofith component.riis the recipe ofith component.
(2) Sulfur content (SUL)
For the prediction of sulfur content,the simplified form of blending effect model is as follows:
where SUL95#preis the predicted value of sulfur content of 95#gasoline,SULiis the measured value of sulfur content of componentioil.The absolute value comparison of the SUL prediction data error between the blending effect model and the neural network model is shown in Fig.8.
Fig.8.SUL comparison of the absolute value of the prediction error between the blending effect model and the neural network model.
(3) Benzene content (BEN)
For the prediction of benzene content,the simplified form of blending effect model is as follows:
Here,BEN95#preis the predicted value of benzene content of 95#gasoline,BENiis the measured value of benzene content of componentioil.Fig.9 shows the absolute value comparison diagram of the error of the BEN prediction data of the blending effect model and the neural network model.
Fig.9.BEN comparison of the absolute value of the prediction error between the blending effect model and the neural network model.
(4) Olefin content (OLF)
As for the prediction of olefin content,the simplified form of blending effect model is as follows:
In this formula,OLF95#preis the predicted value of olefin content of 95# gasoline,OLFiis the measured value of olefin content of componentioil.The absolute value comparison of the prediction data error between the blending effect model and the neural network model is shown in Fig.10.And the MSE of the above four properties prediction data are recorded in Table 2.
Table 2 Comparison of MSE of model prediction results
From the comparison results of the above four groups of models,it can be seen that for the prediction of four important properties of gasoline: the prediction result of neural network model is better than that of blending effect model (the absolute value of prediction error is smaller).From the prediction of specific properties: taking the RON as an example,a large deviation exists in the absolute value of the prediction error of the blending effect model in the 5th,13th,14th,18th and 25th test samples.Although the deviation of the neural network model in the prediction of individual test samples is slightly larger than that of the blending effect model,on the whole,the prediction accuracy of neural network model is higher than that of blending effect model.For the other three properties,the prediction accuracy of blending effect model is also lower.For example,when analyzing sulfur content,the absolute error value of blending effect model reaches 2.8528 and 2.8187 when predicting the second and 19th test samples,while the prediction effect of neural network model is more stable,there is no significant deviation in the prediction of a sample.For the prediction of benzene content,the absolute value of prediction error of blending effect model and neural network model are small,but from the perspective of MSE,the accuracy of neural network model is slightly higher than that of blending effect model.For the prediction of olefin content,the prediction accuracy of neural network model is better than that of blending effect model.
It can be seen from the experimental results in the previous section that the prediction accuracy of the neural network model is higher than that of the blending effect model,and the absolute error and mean square error are smaller.Thus,the neural network model can be used to verify the feasibility of the blending formula in the optimization results.Similarly,the high-precision neural network prediction model for gasoline blending properties can be used to dynamically modify the predicted value of blended properties.By preset the deviation threshold of the results of the linear blending model and the neural network model,the feasible solution of the deviation value within the preset range is used to carry out the outer-lever iteration task to obtain the final optimization result.The results with the deviation exceeding the preset range are dynamically corrected according to the Eqs.(42) and (43) and recalculated.
where,ais the proportionality coefficient of deviation correction,Ppre_kis the prediction value of thekth property of the neural network model,Pmix_kis the prediction value of thekth property of the linear blending model,andis the value ofkth property after the dynamic correction of the blending effect.
A closed-loop optimization strategy suitable for gasoline blending scheduling engineering applications is formed,as shown in Fig.11.The MILP-NLP strategy is used to optimize the MINLP problem of gasoline blending scheduling,which can avoid the solution of complex nonlinear problems.In the inner layer iteration,NPSO algorithm combined with high-precision blended gasoline property prediction model is used to calculate the MILP model,forming a closed-loop optimization method of prediction-verification-repre diction,which improves the optimization ability of the algorithm and the prediction accuracy of key properties of blended gasoline to a certain extent.In the outer iteration,integer variables are fixed to the optimal MILP value,and the original MINLP model is simplified into a NLP problem,and an approximate optimal solution is obtained,namely the optimized blending formula and product scheduling scheme,which is applied to guide the industrial engineering production.
Fig.11.Structure diagram of closed-loop scheduling strategy.
In this case study,the products produced by a refinery included 92#gasoline,95#gasoline and 98#gasoline,with initial inventory of 1000t,1000t and 1000t,respectively.The component oils included reformed gasoline,MTBE,non-aromatic gasoline,catalytic gasoline and C5.In the actual gasoline blending process,there were a small amount of blended purchased component oils,including toluene and xylene.The daily blending capacity of the plant was 8000t.The formula of each component oil could be adjusted from 0 to 0.8.
Table 3 lists the types of products that can be stored in a product tank and the tank capacity restrictions.Table 4 records component oil production and product demand plans.Initial inventory and tank capacity limits for each component tank of the refineryare shown in Table 5.Component oil properties and product quality indicators are shown in Table 6.
Table 3 Product tank storage information
Table 5 Component tank information
Table 6 Component oil properties and product specifications
According to the practical gasoline blending scheduling case,taking days as a unit,considering the constraints including nonlinear properties of blended gasoline,blending operation and blending capacity,blending ratio,component tank and product tank inventory,order demand,product specifications,etc.,a MINLP model with the goal of minimum blending cost was established,including 231 integer variables and 161 continuous variables.Based on a large number of historical blending data,a linear blending effect model was constructed for RON,SUL,BEN and OLF of blended gasoline.On this basis,a relaxed MILP model was built.MILP-NLP strategy was used to solve the approximate optimal solution.
When NPSO algorithm was used to solve the optimization results of the MILP model,two different strategies were set according to whether the blending effect value was dynamically corrected: (1) open-loop strategy: there was no dynamic correction loop,and the properties of the blended gasoline was directly calculated by the blending effect model;(2) closed-loop strategy:there was a dynamic correction loop,the compensation value in the blending effect model was dynamically corrected according to the prediction result of the blending property of the neural network model by preset the deviation threshold.
Under appropriate parameter settings,the integer variables in the MILP optimization results obtained by the above two solving strategies were substituted into the MINLP model,and the final optimized formula and product scheduling scheme were obtained by solving the simplified NLP problem,and the optimization results were verified by the high-precision neural network blending property prediction model.The verified optimization results based on the two different strategies were recorded in Table 7.
Table 7 The feasibility verification results of optimized formula
The solution time based on the open-loop strategy and the closed-loop strategy was similar,786 s and 875 s respectively.It can be seen that in the closed-loop optimization results,the blending properties of the three products predicted meet the index requirements.However,in the open-loop results,the RON of 92#and 95# blended gasoline did not meet the requirements of the product index,and the BEN content of 95#and 98#blended gasoline were also beyond the range of the index.The above blended properties could not meet the requirements of refinery for the property index of blended gasoline in Table 6,which may cause reblend and loss of economic benefits.
It is understandable that there were a variety of uncertainties in the actual process of oil blending scheduling,such as arrival time,flow rate,product tank and component oil properties,etc.On the premise that the initial conditions of the component oils remain unchanged,the gasoline blending scheduling model was built and solved.If the scheduling scheme was organized in an openloop manner,the deviation value of the scheduling result could not be fed back to the model for correction,which may lead to the original scheduling scheme being unable to be implemented in the actual process,the online scheduling based on the openloop form could not be complete and effective.
In the closed-loop scheduling strategy,the compensation value of the blending effect was dynamically corrected through the dynamic correction loop,which made the prediction accuracy of the blending property higher and the optimized formula of MINLP obtained thus had higher reliability.The closed-loop strategy was effective to complete the inner iteration of MINLP problem,and further,the online scheduling method can be developed on this basis.
In order to verify the performance of NPSO algorithm in solving MILP model,another set of simulation experiments were also set up under the closed-loop strategy.For NPSO and standard PSO algorithm,the parameters are set as follows: the maximumnumber of iterations was 500,the population size was 300,the weight range was 1.5-0.4,and the acceleration factor was 1.49.The initial threshold of niche α0=1.5.The public parameterc1=c2=0.5.The threshold value of gasoline property deviation and the proportional coefficient of dynamic correction were selected according to the corresponding data set of actual products.The convergence trend and algorithm solving time of NPSO algorithm and PSO algorithm in the iterative process are calculated under the condition that the model solution results meet the requirements of product indexes.
Matlab programming was used to conduct simulation experiments,and the results obtained were shown in Fig.12.According to the solution results of the standard PSO algorithm,the obtained initial formula was shown in Table 8,and the Gantt diagram of the scheduling task obtained according to the results of the standard PSO algorithm was shown in Fig.13.
Table 8 Initial blending formula (PSO)
Fig.12.Convergence trend diagram of PSO-NPSO algorithm.
Fig.13.The Gantt diagram of the scheduling task (PSO).
Similarly,according to the solution results of NPSO algorithm,the obtained initial blending formula was shown in Table 9,and the Gantt diagram of scheduling task was shown in Fig.14.
Table 9 Initial blending formula (NPSO)
Fig.14.The Gantt diagram of the scheduling task (NPSO).
By comparing and analyzing the solution results of the two algorithms,it was not difficult to see that in the whole convergence process shown in Fig.12,NPSO algorithm showed faster convergence speed and stronger optimization ability in the whole convergence process.The solving method based on NPSO algorithm took 875 seconds in total,and the optimization target value was 126383619.86 CNY.The solving method based on PSO algorithm took 940 s in total,and the optimization target value was 126453596.63 CNY.In other words,according to the initial blending formula and production scheduling scheme given by NPSO algorithm,the blending cost of 69976.77 CNY could be saved.The optimized formula and scheduling scheme could be used to guide theon-siteblending operation,which could effectively reduce the blending cost and further support the application of real-time optimization (RTO) system.
Through the application of the above optimization results based on the proposed NPSO algorithm,the actual blending results were shown in Fig.15.The chart showed the inventory trends of five components during the scheduling cycle.The dotted line represented the calculated amount of each component inventory in the model,and the solid line represented the inventory of the component in the actual application.Under the condition of stable refinery production,the model had good performance in predicting component oil inventory and could track component oil inventory sensitively.On this basis,inventory optimization tasks could be further developed,which proved the effectiveness of the model constructed.
Fig.15.The trend of component oil inventory.
In this paper,a MINLP model is constructed for the complex gasoline blending scheduling process,aiming at the minimum blending cost,and the solution is optimized by MILP-NLP twolayer strategy.In the process of outer-level iteration,integer variables in the MINLP model are fixed to its relaxed MILP-optimal value,so as to solve a simplified NLP problem to obtain the approximate optimal solution,namely the optimized blending formula and product batch scheduling scheme.In the inner layer iteration task,a closed-loop optimization strategy of prediction-verifica tion-reprediction for MILP model is proposed.When solving the MILP model by NPSO algorithm,the situation of a small amount of purchased component oil is processed based on the knowledge experience of the actual gasoline blending process,and the blending formula is verified by combining the high-precision blending gasoline property neural network prediction model.Dynamic correction is carried out for the optimization results whose blending property deviation exceeds the threshold value.The solving efficiency and prediction accuracy of blended gasoline properties are improved.Through an actual industrial gasoline blending scheduling case,it can be seen that the closed-loop scheduling strategy with dynamic correction can correct the error of linear blending property calculation,and the optimized formula has good feasibility.The errors of key properties of blended gasoline are small,which proves the effectiveness of the closed-loop optimization strategy.The comparative experimental results based on NPSO algorithm and PSO algorithm show that NPSO algorithm can obtain better optimization results in a shorter solution time,and saves 69976.77 CNY more blending cost compared with the optimization results of PSO in the case.It is proved that the NPSO algorithm improves the optimization ability to a certain extent,effectively reduces the blending cost and improves the success rate of the blending scheduling optimization while ensuring the convergence speed of the algorithm.At the same time,the validity of the gasoline blending scheduling model is verified,the initial blending formula and product batch scheduling scheme obtained from this model can provide guidance for the intelligent production of the refinery.
Data Availability
The authors do not have permission to share data.
Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Acknowledgements
This work was supported by National Natural Science Foundation of China(Basic Science Center Program:61988101),Shanghai Committee of Science and Technology (22DZ1101500),the National Natural Science Foundation of China (61973124,62073142) and Fundamental Research Funds for the Central Universities.
Nomenclature
Bvk,iblending effect value for propertykof thei-th component
Comhiupper inventory limit ofith component
Comlilower inventory limit ofith component
D(Xm)the fitness value of particlem
dmnthe Hamming distance between particlemandn
Gmthe sharing degree of particlem
Iset of the components indexed byi
Jset of products indexed byj
Kset of properties indexed byk
lindex of the data
Nset of product tank indexed byn
Pmix_kprediction value of blending effect model for propertyk
Poktjinventory of productjat the end of dayt
Ppre_kprediction value of neural network model for propertyk
Plmixkblended propertykvalue of thel-th set blending data
Psjkkth property standard ofjth product
pvk,ivalue for propertykof thei-th component
rcirecipe ofi-th component
Tset of day time indexed byt
TMaxmaximum daily blending volume
Thnupper tank capacity limit ofnth product tank
Tlnlower tank capacity limit ofnth product tank
wblending operation variable
Chinese Journal of Chemical Engineering2023年9期