You are on page 1of 7

An Evolutionary Approach for Modeling the Equivalent Circuit for Electrochemical Impedance Spectroscopy

Hongqing Cao', Jingxian Yuz ,Lishan Kang'


$ate Key Laboratory of Software Engineering; Wuhan University, Wuhan 430072, China -email: (jxyu, kang)@whu,edu.cn 1 -Depanment of Chemistry, Wuhan University, Wuhan 430072, China email: jxyu@whu.edu.cn least.square method [3][41. But Some problems exist in using this method, like the sensitivity to initial values, the difficulty to compute the partial derivative expression of each parameter for some complex circuits and the great likelihwd to trap into local optima. In view of all above analysis, we consider that the most desirable way to analyze electrochemical impedance data is to build the equivalent circuit model automatically as well as optimize the component parameters simultaneously by using some intelligent approach. Hence this paper proposes a hybrid evolutionary modeling algorithm (HEMA) to approach this modeling task. Its main idea is to embed a genetic algorithm (CA) in gene expression programming (GEP) where GEP is employed to discover and optimize the structure of a circuit, while the CA is employed to optimize the parameters of all the electric components contained in the circuit.
I

.-

'

Abstract- This paper proposes an evolutionary approach to build the equivalent circuit model for electrochemical impedance spectroscopy. It works by using a hybrid evolutionary modeling algorithm (HEMA) whose main idea is tn embed a genetic algorithm (GA) in gene expression programming (GEP) where GEP is employed to discoverand optimize the structure of a circuit, while the GA is employed to optimize the parameters of all the electric components contained in the circuit. By running the HEMA, the computer can automatically find suitable circuit structures as well as optimize the component parameters simultaneously. Compared with most available methods, it has the advantages of automation . of modeling process, great diversity of model,structnres, high stability and efficiency of parameter optimization.

1 Introduction .
. . , . With ths development of electrochemical measurement technique, the acquisition of impedance data has become much easier than before. On the contrary, how to analyze and interpret those data is considered as a complicated and arduous task. Usually the interpretation of electrochemical impedance data includes three steps. First an equivalent circuit model for the examined system is built based on the measursd electrochemical impedance spectroscopy and relevant electrochemical knowledge. Second the parameter values of all components contained in the circuit are determined by using some curve-fitting methods. Finally some lanetic parameters in the electrode, reaction are calculated according to the circuit structure and the component parameters [I]. Among those, how to build a suitable model is the most crucial step. Among the available modeling software for equivalent circuits a1 present, the EQUIVCRT software developed by Boukamp [ 2 ] is applied most widely. However the EQUlVCRT software. requires the users to have abundant electrochemical professional knowledge and research experience, which limits its application range in some degree. As for the second step, people have done much work in this field. The most popular approach adopted by people to fit the impedance datais the complex non-linear

2 Hybrid Evolutionary Modeling Algorithm


Gene Expression Programming (GEP) is a linear genetic programming (GP) [5-71 with fixad length invented by Ferreira [8][9] in 2001. It is the natural combination of chromosomes of GP and GA [IO] in which the genotype and the phenotype are separated. In GEP the individuals are encoded as symbolic strings of fixed length (genotype) which are then expressed as non-linear expression trees (ETS) of different sizes and shapes (phenotype). In comparison with GP, the most advantage of GEP lies in that it allows the modification of the genome using any genetic operator without restrictions, producing always syntactically correct programs. But it has a major drawback in GEP, namely the inconvenience to handle numerical constants [9]. While for our case, when building an equivalent circuit model for electrochemical impedance, it involves not only the structure of the circuit, but also the parameters of all electric components contained in the circuit. Moreover the electrochemical impedance of a circuit is rather sensitive to the values of those parameters. Hence it is expected to achieve desirable results if we can deal with those parameters separately. Based on all above considerations, we propose a hybrid evolutionary modeling algorithm (HEMA) to approach the

0-7803-7804-0 /03/$17.00 B 2003 E E E

1819

modeling task of the equivalent circuit for electrochemical impedance. Its main idea is to embed a GA in GEP where GEP is employed to discover and optimize the structure of a circuit, while the GA is employed to optimize the parameters of all.the electric components contained in the circuit. The structure of the HEMA can be described as follows: Procedure HEMA begin input observed data of electrochemical impedance;
1:=0

below: -+R~50~~-L~82mH~R~O.3n)C(ZUF1C~2~C(4~)CPE~lO~,O.O

2)
It can be convened into a tree structure shown in Fig. ](a) which corresponds to a circuit illustrated in Fig. I(b).

initialize the circuit population; while ( I < MAXGEP) do begin structure optimization process of circuit models using G E P parameter optimization process of electric components using GA;
r:=t+1;

end output the best circuit model; end

21 Structure Optimization Pmcess of Circuit Models .


Using GEP 2.1.1 Representation of Chromosomes The chromosomes in GEP are represented. as linear symbolic strings of fixed length. Each gene is composed of a head and a tail. The head contains symbols that represent both functions and terminals, whereas the tail contains only terminals. For each problem. the length of the bead h is chosen, whereas the length of the tail I is a function of h and the number of arguments of the function with more arguments k, and is evaluated by the equation: t=h(k-l)t I (1) As far as the equivalent circuit for electrochemical impedance is concerned, the possible electric components include resistors (R), constant phase elements CPE(w, n), capacitors (C) and inductors (L), and the two possible ways to connect them are parallel and series. Thus we define the set of terminals T = {R, CPE, C , LJ and the set of functions F = {+, -1 where + and - represent the series connection and the parallel connection respectively. Obviously in this case, k 2 . When mapping a GEP gene into a circuit, we first convert it into a binary tree stmture of GP by following some rules descrikd in Ref. [9]. According to the binary tree, the correspondent circuit can he obtained easily. So, despite its fixed length, each gene has an effective coding segment (ECS) whose length equals to the number of nodes in the binary tree. For distinction, the ECS of each gene is underlined and the tail of a gene is shown in bold. For example, if we'chose an h = 4, then r = 5 . Thus the length of the gene is 4 + 5 = 9. One such gene is shown

Fig. 1

The binary tree structure of GEP gene (a) and h e correpondenicircuit (bj

2.1.2 Genetic Operators In the HEMA, we use two kinds of crossover: one-pint crossover and two-point crossover and two kinds of mutation are adopted as well: multi-point mutation and segment-insenion mutation. In multi-point mutation multiple points are randomly chosen from the ECS of the parent.chromosome as the mutation points. In the heads, any symbol can change into another (function or terminal); in the tails. terminals can only change into terminals. In this way, the structural organization of chromosomes is remained intact, and all the new individuals produced by mutation are structurally correct programs. In segment-insertion mutation a segment is randomly chosen throughout the parent chromosome. A copy of the segment is made and inserted at any position in the head of the chromosome, except the first position. This operator involves in the selections of the start of the segment, the length of the segment and the insertion point.

1820

The former two can be chosen randomly, whereas the insertion point can only be chosen from-the head except the first element and the ECS of the chromosome. Note that, on the one hand, the inserted segment becomes duplicated, but on the other hand, a segment with as many symbols as the inserted segment is deleted at the end of the head of the parent chromosome. That is. the tail of the parent chromosome remains unchanged after insertion. Thus, despite the insertion, the structural organization of chromosomes is maintained, and therefore all the new individuals created by. segment insertion are syntactically correct programs. 2.1.3 Calculation of Fitness Values As the electrochemical impedance of a circuit consists of a real part and an imaginary part, we can calculate the sum of the least-square errors of those two parts as the fitness value of an individual. Thus the fithess function. F. is defined by the following equation:

from the bottom level of the tree and figure out the electrochemical impedance of all branch circuits by using the formulae described above. Afterwards we trace back upward to access the tree level by level until the total impedance' of the whole equivalent circuit is achieved. This value is just the fitting value of the electrochemical impedance for p under the given frequency f , which contains two p e s , namely the real part and the imaginary part. By following the same procedure, the fitting values of the impedance under all other input frequencies can be computed. Finally we can calculate the fitness value of p by using Eq.(2) based on those fitting values.

2.2 Parameter Optimization Process of Electric


Components Using GA This parameter optimization process is done for each individual in the current circuit population. The algorithm to do the parameter optimization in the HEMA is a genetic algorithm based on the subspace search. It adopts a novel crossover operator which performs by the non-convex combination of multiple parents. We first determine the total number of the parameters to be optimized according to the number of terminals (i.e. electric components) in the ECS of the individual gene and their types. Suppose there are k parameters in total. Then each individual in the parameter population, P, is encoded as an ordered set of k floating numbers, a one-dimensional line vector written in the form of P = b , p 2 ...p X ) where p ; ~ ( R . w , n , C , L ) ( i :I-k). Each pi has its own range of definition in terms of the component it 'corresponds to. In our .experiments, we predefine the ranges of these parameters as R(O-IOOQ), w(0-IOOQ), n(0-I), C(0-0.001F) and L(0-IH). Each time we randomly select M different individuals from the old population (M>2) denoted as P,', P2, ..., Py where P; = (p, p 2 ...p r ) ( i : l - M ) and k is the total number of parameters to be optimized. Accordingly produce M random coefficients

where 2,' and Z ? the actual values of the real part , are and the imaginary part of the electrochemical impedance under a given frequency, f;, respectively. Similarly 2,;and

2," are the correspondent fitting values. m is the number of input frequencies, i.e. the number .of data points. Obviously, the lower the fitness value, the better the individual. The formulae for calculating the electrochemical impedance of each electric component are listed as follows: (a) the impedance of a resistor: R. (b) the impedance of a constant phase element CPE(w. n):
When I I is 0.5, the equation is the Warburg impedance caused by the semi-infinite diffusion process. 1 (c) the impedance of a capacitor: - j .
~

a, , which satisfies a < a, 5 6 ( a < 0 , 6 > 1) and

CO,1.
M

iil

Thus a new individual, Pne,<, is produced by the non-convex linear combination of those M individuals:

2nfc

(d) the impedance of an inductor: . j . 2@. When the components are series-connected or, parallel-connected, the formulae for calculating the impedance are: (a) Z,-Z? series connection: Z = Z, + Z2.

If any parameter in P,,,, is out of its range of definition, then abandon this invalid individual and recreate a new one by reproducing a new set of ai and following the Eq. (3) until a valid individual is generated. When calculating the fitness value of an individual, P, in GA population, we first assign the parameter values in P to the correspondent components in the GEP parent chromosome one by one and then follow the same procedure in Section 2.1.3 to figure out the fitness value of

I l l (b) Z1-22 parallel connection: - = -+ z 2 , z2 When calculating the fitness value of an individual, p , in GEP population we first convert it into the correspondent tree structure. Then for each input frequency f , we start

0-7803-7804-0 1031$17.00 02003 IEEE

1821

P. Suppose the fitness function is F(x). Then the structure of the GA can be described as follows: Procedure GA begin

Z which are used to set up'thr.input data file. For each : ) data'file, twenty independent runs are conducted by .using the 'HEMA. All the experiments are performed on a Pentium Ill PC (IGHz) and programmed by C language. I:=% The parameter settings ofthe HEMA are as follows: in initialize the parameter 'population P ( I ) = ( P ~ ( I ) , the GEP, h = 8.popsize = 100, MAXGEP = 5 0 in the GA, P2(t), -, Pdr)); [ N is the population size) N=50,M=8,MAXGA=1000,S=20,a=-0.5.b=1.5. calculate the fitness of the population F(P(r)) = (F(P,), F(P2), ..., F(P$); '3.2Circuit I while (f < MAXCA) do The original circuit used to generate the simulated data is begin shown in Fig. 2(a) which is a typical circuit for the simple randomly select M different individuals P i ( L1-W electron transfer reaction with concentration polarization. ,. from PO); Its complex plane impedance plot is shown in Fig. 2 (b). for j := 0 to S do . . begin CI420,&3 produce M random coefficients (Yj ( i: I-W;
generate a new individual Qi := calculate F(Qj); end F(Q) := min ~ ( 8 ,
Wj'Z

2
1=1

*,p, ;
(a)

);
:
llilN

Fnm:= F ( P n m 3 := m a F ( I :

if (F(Q) < Fm,3 then P,, := Q; r:=r+1; end

end The essence of the GA lies in the random search to the subspace determined by multiple parents. It differs from a simple GA in that the search space of crossover is determined by multiple points (M parents) rather than by only two points used in a painvise crossover. Moreover more than one point (S offspring) are produced from the subspace and the best one is chosen to replace the worst individual in the original parameter population. The adjustable control parameters in the GA include N , M, S, MAXGA, a, b. The settings of their optimal values depend upon the property of the specific problem.

i
3
10

IS

20

T i ollm

(b) Fig. 2 Simulated Circuit I (a) and its complex plane impedance plot (b)

From the experimental results, we observe that, of the 20


NnS:

Results and Discussions

(a) There are 13 runs that the HEMA can find the same circuit model as the original one. Not only the structure of the circuit but also the component parameters are exactly consistent with Circuit I. The fitness values of all those circuits equal to 0. We list some of them below: Model I :

3.1 Generation of Simulated Data and Parameter


Settings of HEMA To test the effectiveness of the HEMA, we design two

relatively complex circuits (including the parameter values of components) with distinct complex plane impedance plots by ourselves, and generate the simulated data based on them. To be specific, we assume the initial frequency,&, is 0.0IHz and let f; be 1.2 folds of f i , (il-99). By calculating the values of the electrochemical impedance under each frequency f;, we obtain 100 data points (Z:,

)CPE(43.927744.0.356660)C(0.000061 )C(0.000773)C(0.0
00840)L(0.82431I )

a (R(4.600000)+((R(5.600~O)+CPE(3.20~00,
0.500000))-C(0.000420)))
Model 2:

+R(4.600000)-C(0.000420)+R(5.600000)CPE~320CO00.0.

1822

Fig. 3 The evolving curves of Model I-Model 5 for Circuit I (c) There are another 4 runs that the HEMA can find such models that have slight difference with the original circuit i n the structure but have a small fitness value, being the maximum 0.0039298495,the minimum 000000MN)2.

In summary, as for Circuit I, in most runs, the HEMA can find the circuit models whose structure and.pararneters both exactly coincide with the original circuit. In other words, by running the HEMA, the computer can discover the suitable circuit structure automatically as well as optimize the component parameters simultaneously according to the input data of electrochemical impedance. I n addition, from the fact that those parameter values are exactly the same as the original circuit, it demonstrates that the genetic algorithm used to do parameter optimization is stable and effective.
3.3 Circuit I1 The original circuit used to generate the simulated data is shown in Fig. 4(a) and Fig. 4(b) illustrates its complex plane impedance plot.
C(4.71lFj

U966nI.I)

2.0

1.5-

L-

1.00.5-

?
$

0.0-0.5
0-1 .
2

3
4 5

Z /ohm

2 -0.5 1;
-0.64

(b) Fig. 4 Simulated Circuit I1 (a) and its complex plane impedance plot (b)
I

,
II

, ,

,
4 1

2 1 ?I Generation

Our experimental results show that as for this circuit, of the 20 runs, there are only one run that the HEMA can find the model that has the exactly same structure as the

1823

original circuit and whose parameters are almost identical with the original one. Its fitness value is 0. The model is:

+R(5.435266))-(R(2.999705)-C(O.O00005))))
M d e l 11.

Model 6

+R(I .799999)+-I R(3.000001 )C(O.O00005)R(I.000000)L(O.O960001CPE(7. 52)C(O.O002l8)C(O.OOO323)CPE(39.487394,0.47 1400) 704573,0.953301)C(0.000005)C(0.00003 I)L(0.618154)C( 3 (R(2.800000)+((U0.683 136)+(R(6.001175) 0.000318)CPE(78.442W0.0.597639)R(S5.780889)L(0.402 +L(O.I80991)))-(R(2.999706)-C(0.000005))))
331)
3 (R(1.799999)+((R(3.000M)I )-C(0.000005))

+(R(1.000000)-U0.096000))))
F = 0.000000oMK)
Most surprisingly, of the 20 ruis there are 17 runs that the HEMA finds another kind of circuit structure shown in Fig. Xa). Its complex plane impedance plot is shown in Fig. 5(b). From Fig. 5(b), we observe that this circuit can fit the simulated data very well and its fitness value is very close to 0. Although the specific representations of those 1 models are not completely same, they all can be 7 simplified into the circuit structure shown in Fig. 5(a) and their parameters only have the difference of mantissa with this circuit. Below we list some of them: Model 7:

CISuF)

R 2 811) (

O------l
R(2 999706Q)
0
..

(a)
1.5

1
Simulated curve
Fining data

76)R(83.692722)R(98.2258 18)L(0.466461 IR(83.742320)C (0.000995) 3 (R(2.800000)+(C(0.000005)-((R(6.001175) +L(0.864127))-R(2.999706))))


M o _. . k 4 R.

+R(? XO0~K)0r-Ct01~000051-K12 9997061+Rth 001177rLtO


BM127lCPFt6 00027 I .O 000100rClO 000015rLtO 657127 )CPE(7.644502,0.6166l3)R(12.255279)C(0.000207)L(0.6 69721)L(0.411747) 3 (R(2.800000)+(C(O.OOOM)5)-(R(2.999706) -(R(6.001177)+L(0.864127)))))
Model 9
Z'lohm (b)

Fig. 5 The circuit that occurs most frequently when evolving Circuit II (a) and its complex plane impedance plot (b)

From the case that this kind of model turns up so frequently and its fitness is almost 0, we surmise that this +R(2.800000)-+-R(6.01178)L(0.864127)R(2.999706)C~O a new equivalent circuit for Circuit II which has not is .000005)CPE(lI .518849.0.8952 19)C(O.OM)OO5)CPE(53.8 been realized by people yet. 47063,0.224784)CPE(47.348435,0.577338)CPE(83.95353 We depict the evolving curves of those six models above 0,0.458685)L(0.2 1 I)CPE( 19.282573.0.769643)UO. 183 153 for Circuit 11 in Fig. 6. 954) In the remaining two runs, the HEMA finds the models (R(2.800000)+((R(6.001178)+L(O.864127)) having different structures with the previous two. But the -(R(2.999706)-C(0.0005)))) fitness values of those two models are both minor, with 0.0000000000 and 0.0000000001 respectively. Model I O

+RO. 800000~-+-+R(5.43526~R(2.999705~C(O.O00005~R( 0.56591 1)L(0.864130)R(3 1.413373)R(41.891787)L(0.702 793)L(O. 102541)R(6.778953)L(0.825903) 3 (R(2.800000)+(((R(0.5659 11)+L(0.864130))

1824

, .

'

Acknowledgements
This work was supported by National Natural Science Foundation of China (No. 60133010) and the Special Funds for Major State Basic Research Projects of China (No. 2002CB211800). The authors wish to thank the anonymous referees for their helpful suggestions for this paper.

.. Model 8

VI

e
-10 I
11

References
21

31

41

Generation Fig. 6 The evolving curves of Model 6-Model I I for Circuit I I

[ I ] C. S . Cha. Introduction' to Kinetics of Electrode Processes (Third Edition). Bejing: Science Press, 2002. [2] B. A. Boukamp. A Nonlinear Least Squares Fit Procedure for Analysis of I~~~~~~~~~ Data of Electrochemical Systems. Solid State lonics. 1986, 20,
pp. 31-44. [3] J. R. Macdoald, J. Schoonman, and A. P. Lehnen. The Applicability and Power of Complex Nonlinear Least Squares for the Analysis of Impedance and Admittance Data. Journal of Electroanalytical Chemistry. 1982,131, pp. 77-95. [4] J. R. Macdoald. Impedance Spectroscopy: Old Problems and New Developments. Electrochimica Acta. 1990, 35, pp. 1483-1492. . [ 5 ] J. R. Koza. Genetic Programming: On the Programming of Computers by Means of Natural Selection. Cambridge, MA: MIT Press, 1992. [6] I. R. Koza. Genetic Programming II: Automatic Discovery of Reusable Programs. Cambridge, MA: MIT Press, 1994. [7] I. R. Koza, F. H. Bennett 111, D. Andre, and M. A. Keane. Genetic Programming Ill: Darwinian Invention and Problem Solving. San Francisco, CA: Morgan Kaufmann Publishers, 1999. [8] C. Ferreira. Gene Expression Programming: A New Adaptive Algorithm for Solving Problems. Complex Systems. 2001, 13(2),pp. 87-129. [9] C. Ferreira. Gene expression programming in problem solving. invited tutorial of the 6th online World Conference' on Soft Computing in Industrial Applications. September 10.24, 2001. ' [IOIM. Mitchell. An Introduction to Genetic Algorithm. Cambridge. MA: MIT Press, 1996.

4 Conclusions and Future Work


The hybrid evolutionary modeling algorithm (HEMA) based on the combination of Gene Expression Programming (GEP) and genetic algorithm (CA) proposed in this paper i s a new evolutionary approach to build the equivalent circuit model for electrochemical impedance. Compared with most available methods. it has some advantages: 1 I) The whole modeline nrccess is done automaticalh. . ~ , Once the electrochemical impedance data are provided. by running the HEMA, the computer can search suitable circuit structures as well as optimize the component parameters simultaneously by itself. The whole modeling process needs not the manual intervention. ( 2 ) The models have great diversity. The user himself can control the structure types and the complexity of the circuits flexibly by defining the sets of functions and terminals and the length of tail of a GEP gene. In most runs, the HEMA can find the models which are in , agreement with the original circuit. But sometimes it also finds some new structure that has not been recognized by people yet. (3) The result of parameter optimization is stable and effective. As for different runs. only if the structure of circuit eventually found is identical, the component parameters.being optimized are always consistent. This paper is. some preliminary work of evolving Chemical Circuits by using GEP. We need to further test .the efticacy of the HEMA in larger circuits which contain more components and parameters in the future. Meanwhile we will conduct some similar expenm'ents by using standard GP and compare the results with those of this paper.
~~~

-.

1825

You might also like