# Optimization of Offshore Saline Aquifer CO2 Storage in Smeaheia Using Surrogate Reservoir Models
## 2 Theory
### Genetic Algorithm  
Holland [58] pioneered the development of the GA, which gained popularity through [PERSON]'s application in solving a challenging gas-pipeline transmission problem [59]. GA is an optimization and search technique that operates on the concepts of genetics and natural selection. It facilitates the reproduction of a population, consisting of a specific number of individuals, to achieve the highest level of fitness or the lowest cost function value. The widespread adoption of GA is due to its numerous benefits, such as its ability to handle both continuous and discrete values, its capacity to simultaneously search multiple samples from a cost surface, its lack of limitations on the number of variables, its ability to avoid becoming stuck in local optima, and its applicability on numerically generated data, experimental data, or analytical functions [60; 61].  
The genetic algorithm includes a population which comprises \(\mathrm{N_{pop}}\) individuals or chromosomes, representing all feasible solutions. Each individual or chromosome is composed of \(\mathrm{N_{var}}\) variables or genes. The representation of individual genes can be achieved by many means such as bits, integers, trees, arrays, lists, or other objects.  
Figure 2: Common activation functions and their derivatives, from left: ReLU, hyperbolic tangent, and sigmoid.  
This is accomplished through the process of encoding, which involves the conversion of gene values [62].  
The initial population is a randomly generated matrix with dimensions \(\text{N}_{\text{pop}\times}\text{N}_{\text{var}}\). During the initialization process, the objective function will be computed for decoded individuals with real numbers. The value obtained for an individual is referred to as its Fitness, which indicates both the quality of the solution and its proximity to the ideal chromosome. The process of decoding gene values is accomplished through Genotype-Phenotype Mapping, which transforms genotypes into phenotypes, the actual solutions [63]. When continuous solutions are used, it is not necessary to decode the genotype to obtain real values. Only normalized data need to be denormalized. Following the evaluation of fitness, two parents will be chosen to create the next generation. The Ranking Selection strategy, considered one of the most effective selection methods, arranges individuals based on their fitness levels. The selection of the best parents is determined by a selection ratio, which randomly chooses two parents from a pool of candidates. The process of reproduction in genetic algorithms involves the use of crossover, which entails swapping single or multiple genes between parents, and mutation, which involves the random evolution of some genes within the solution interval. These mechanisms build a new generation. The primary objective of mutation is to avoid the algorithm from becoming trapped in a local optimum by reducing the propensity of GA to converge rapidly [60]. A straightforward approach to address constraints in genetic algorithms is utilizing the Death Penalty technique. The method involves evaluating the feasibility of constraints after performing crossover and mutation operations. If the constraints are not feasible, the loop will repeat until constraints are satisfied.