Page 198 - 2024-Vol20-Issue2
P. 198

194 |                                                                                                              Al-mtory, Alnahwi & Ali

                     START                                                       CDOA was applied to two sets of benchmark functions [37],
                                                                                 namely unimodal and multimodal functions as listed in Table
       SET THE ENVIROMENT CONDITION RANGE AND THE                                I. The algorithm has been performed using MATLAB R2020a.
                      BOUNDARY REIGN                                             The proposed algorithm is compared with the following algo-
                                                                                 rithms to highlight its high performance:
         SET THE DIMENSION AND NUMBER OF PITTING                                 A. particle swarm optimization [4].
          INTER MAXIMUM NUMBER OF ITTIARSTION                                    B. A modified camel algorithm [11].
          INITIALIZE THE VALUE OF X BY USING EQ (3)                              C. Crow Searching Algorithm [38].
                                                                                  D. Sine Cosine Optimization [39].
        SUBJECTED THE VALUE OF X IN COST FUNCTION
                                                                                 Algorithm 1 Corrosion Diffusion Optimization Algorithm
           DETERMINE THE CURRENT BEST SOLUTION                                   (CDOA)

                                                                                 1. Set the range of environment condition, cathode voltage,

                                                                                 and anode voltage.

                                                                                 2. Set number of pitting (w) and number of electrons trans-

                                                                                 ferred (N) and number of maximum iteration.

                                                                                 3.Initialized the cell voltage from
                                                                                       xni.iter = xmin + RAND * (xmax - xmin)

                                                                                 4.Determine the value of cost function.

             IF ITR<ITER_MAX                                                     5.Determine the current best voltage.

       YES                                                                       6.For I < itramax.

                                                     NO                          7.Initialized environment factor from

                                                                                 ENVf actor = LOENCON + RAND(HIENCON - LOENCON )

                                                                                 8. Determine the environment effect from
                                                                                                        ENVFACT OR-LOENCON
       CALCULATE THE ENVIROMINT FACTOR FROM EQ(5),                               E NVE F F ECT  = 1+     HIENCON -LOENCON
        AND CALCULATE THE ENVIROMENT FROM EQ(4)
                                                                                 9. Calculate the energy level in

       CALCULATE THE ENERGY LEVEL FROM EQ(6), AND                                      uni f orm rand[lowvoltage, highvoltage] * (xoldbest -
             CALCULATE SUME OF ENERGY ROW                                        xprivous)

                                                                                 10.Determine the sum of the row.

                                                                                 11. If sum of row < 0

                          SUM OF ENERGY LEVEL <                                  12. Calculate the update of x as
                                    0                                                  xdi iter = xdi iter-1 + ENVEFFECT * (xdi iter best -

       NO YES                                                                    xdi iter-1 best )

                                                                                 13. Else .

       REMAINE THE VALUE OF                                                      14. Remain the value of x as pervious value
       X AS PRIVUSE VALUE AS                                                           xdi iter = xdi iter-1

               EQ(8)                                                             15.End if.

                               CACULATE THE NEW                                  16.Subject the resulted pitting to the fitness function
                              VALUE OF X FROM EQ(7)
                                                                                 17.Determine the current best voltage

                                                                                 18.End for.

       DETERMINE THE COST FUNCTION VALUE                                         19.Determine the best voltage

                                     DETERMINE THE BEST SOLUTION OF THE CURRENT  E. Fungi kingdom algorithm [16].
                                                       ITERATION                 Different variable dimensions (5, 10, 15, and 20) were applied
                                                                                 on each algorithm. The comparison has been carry out under
                                         END                                     the same conditions for all algorithms, where the maximum
                                                                                 iteration is equal to 1000, the variable size is equal to 50,
Fig. 2. Flow chart for corrosion diffusion optimization                          and the dimensions of each variable are as mentions above.
algorithm (CDOA).                                                                Note that all benchmark functions have a minimum when the
                                                                                 variable value is equal to zero. For the purpose of comparison
   193   194   195   196   197   198   199   200   201   202   203