# Genetic Algorithm in MATLAB for Process Optimization : Multi-objective Approach for Optimization

It is inconvenient to waste words for explaining how important MATLAB has become in the section of chemical engineering in last decade. Various technical problems are now solved by process analysis using MATLAB. This piece of writing, however, is concerned with a process of optimization called Genetic Algorithm.

Genetic Algorithm (GA) is based on the basic phenomena of chromosome gene code interchange. A process fully based on random selection of data and modification. In case of engineering use, we do enter some constants required by the process to test the fitness of our result.

The basic steps followed by Genetic Algorithm are simple to understand. At first, an initial population is created from the supplied data. This means data for population is selected in a random manner. The next step is to evaluate the data and to check if the stopping criteria are met. The positive response shall stop iteration and present the result. The negative response shall give rise to the chance of parent selection. After a random selection of parents, crossover is performed based on crossover probability. To make things clear, the points of crossover and the selection of parents, both of these are done randomly. After this step, the mutation will be performed. In this case, the number of points of mutation depends on the probability of mutation, generally a user input. Now the data are evaluated using the equations. The data that give us best results, for example, best cost choice, or best operational time choice, or any other criteria, is chosen to be the best fitted data.

Then a step called Roulette Wheel is used to replace the worst fitted data. The general process is to replace the worst fitted value by the best fitted value. Sometimes mean fitness value is used and data with fitness values below 50% of the mean fitness value are replaced by the best fitted data. If the best fitted value of the table of values achieved by this process is closer to the criteria given by the user, then the older table is replaced by this new table. This process is schematically shown in figure 1.

Figure 1: Steps of a Simple Genetic Algorithm Process

These data are then again analyzed to find out the best fitted data. If the previous best fitted data is better than the best fitted data we will get from this new data set, then the new table is discarded. Otherwise, the older table is replaced by new table.

The example provided here shows various steps of genetic algorithm. This is the most basic type of this process. Depending on the user or requirements, some steps may be modified or neglected.

We introduce iteration to this process to save the best fitted data every time for various random selections and then accept the best fit among the best fits. This algorithm is famous for its flexibility according to the need of process. While only best data can be saved, one can use the best data to replace the worst fitted data and iterate the new table and so on. The modification of coding may vary from process to process but the basic actions remain same.

It is highly useful in case of design where we have to deal with various choices. Choices may make life difficult, but genetic algorithm tries its best to simplify our job for designing an optimum system. For example, let us consider a project to optimize water desalination using reverse osmosis. In market, various companies have membranes of various capacities, price and sizes.

Some requires highly maintained pretreatment; some requires expensive post treatment, some have low area, some need very high pressure, some requires nano filtration, and so on. So, what to choose? We definitely have cost limitations. Manually, this job will take at least half a month, considering you are working 24 hours a day. But, collect all related data, enter them in a tabular form, use coding that best suits your project, et voila, within 5 hours you are ready with all the best suited choices for your project.

A question may be raised, why to use MATLAB while same thing can be done using C++? Well, this is because of better optimization and comparatively less coding. Even no coding can be required if SIMULINK is used, but in some cases it restricts flexibility. It is shown that, for a specific project of optimization, C++ required around 540 lines where MATLAB coding, being more efficient and producing better results, required only 235 lines of commands.
At the end, what to use for optimization, entirely depends on user’s comfort. MATLAB gives a platform that is easy to use and quick to understand. This quality of MATLAB, merged with genetic algorithm, revolutionizes optimization and process solutions.

For reference, please check Goldberg, D.E. (1989), “Genetic Algorithms in Search, Optimization and Machine Learning”, Pearson Education, Inc.

(use the given format or any standard citation format)

Datta, S., Genetic Algorithm in MATLAB for Process Optimization Multi-objective Approach for Optimization, ChE Thoughts 2 (2), 25-29, 2011.