# Genetic Algorithm for Prediction of Model Parameters

The thermodynamic equilibrium condition for multi-component liquid- liquid system can be described by the following expression:

where y„ the activity coefficient of component i in a phase (I or II), is predicted using the NRTL/UNIQUAC model. xj and xf represent the mole fraction of component i in phases I and II, respectively.

The compositions of the extract and the raffinate phases are calculated using a flash algorithm as described by the modified Rachford-Rice algorithm (Seader & Henley, 2006). The optimum binary interaction parameters are those which minimize the difference between the experimental and the calculated compositions, and are given by the relation

Equation 2.9 is highly nonconvex in nature and is difficult to solve. This necessitates the requirement of a non-traditional optimization tool such as the GA. The root-mean-square deviation (RMSD) values, which provide a measure of the accuracy of the correlations, were calculated according to the following expression:

where:

m is the number of tie lines

c is the number of components

xk and xk are the experimental and predicted values of mole fraction for component i for the kth tie line in phase l, respectively.

Figure 2.2 shows the flow diagram of the total algorithm used in this work for the calculation of binary interaction parameters.

GA is one of the most widely used evolutionary optimization algorithm in modern nonlinear optimization. The GA, developed by John Holland and his collaborators, is based on Charles Darwin's theory of evolution and natural selection that mimics biological evolution (Goldberg, 1989; Deb, 2001 & Yang, 2014). Compared to the traditional derivative-based optimization algorithms GA is a population-based optimization algorithm and therefore, GA explores the search space with a population of solutions instead of a single solution. Thus, it is likely that the expected GA solution may be a global solution. The derivative-based algorithm generates a new point by a deterministic computation, whereas GA creates a new population by probabilistic rules.

The GA repeatedly modifies a population. At each step, the GA selects individuals at random from the current population to be parents and uses them to produce the children for the next generation. Over successive generations, the population 'evolves' towards an optimal solution. The GAs have three main genetic operators to create the next generation from the current population: (1) the selection operator which selects the individuals, called parents, that contribute to the population at the next generation, (2) the crossover operator which combines the two parents to form children for the next generation and (3) the mutation operator which applies random changes to individual parents to form children. The stochastic nature of crossover and mutation make GA explore the search space more effectively.

FIGURE 2.2

Flow diagram of the flash algorithm used for LLE modelling.

The steps of the algorithm are as follows:

Step 1: Initialization of GA. The algorithm starts with defining the fitness function or the objective function which is to be optimized. The following parameters namely the population size with lower and upper bounds of the variables are specified.

Step 2: Generation of initial population and fitness evaluation. The initial population is randomly generated between lower and upper bounds and the fitness value of each member of the population is computed.

Step 3: Generation of new population. At each step, the algorithm uses the individuals in the current generation to create the next generation, for which the algorithm performs the following steps:

Selection: Individuals of the current population, called parents, are selected based on their fitness. Some of the individuals in the current population that have best fitness are chosen as elite and these elite individuals are passed to the next generation directly.

Crossover: The algorithm creates members of the new population or children by combining pairs of parents in the current population. Crossover enables the algorithm to extract the best genes from different individuals and recombine them into potentially superior children.

Mutation: The algorithm creates mutation in children by randomly changing the genes of individual parents. The mutation operation prevents GA from converging to a local minimum and also introduces new possible solutions into the population.

Step 4: Fitness evaluation. The fitness evaluation of each member of the new population is computed.

Step 5: Stopping criterion. The algorithm stops when one of the stopping criteria is met such as (a) maximum number of generations, (b) the value of the fitness function for the best individual in the current population and (c) average relative change in the fitness function value over successive generations.

The flow diagram of the GA is shown in Figure 2.3. In this work, the GA toolbox as available in MATLAB® 7.10.0 (R2010a) has been used for all the LLE calculations.

FIGURE 2.3

Flow diagram of GA.