Professional Documents
Culture Documents
North-Holland, Amsterdam
Bernard A. BOUKAMP
Department of chemical Technology, Laboratory of Inorganic Chemistry and Materials Science,
Twente University of Technology, 1'.(9. Box 217, 7500 AE Enschede, The Netherlands
A Nonlinear Least Squares Fit (NLLSF) pxogram is described, with which fzequency dispersion data of electrochemical
systems can be analyzed in terms of an equivalent circuit. The NLLSF procedure uses a combination of an analytical and
gradient search according to the Marquardt algorithm. Through the use of an unique Circuit Description Code (CDC) dif-
ferent equivalent circuits may be used with the program. The use of an analytical derivatives routine enhances the execu-
tion speed. The power of such a fit procedure is demonstrated in multi parameter fits, on synthetic and real data, per-
formed by the program "EQIVCT".
The present paper describes a general NLLSF pro- The form of this function, Y ( x , a 1 ...aM) depends on
gram for fitting an equivalent circuit response to fre- the physical model used to explain the measurement
quency dispersion measurements (immittance data). set. As the data set will contain random and systematic
The fit procedure incorporates the Marquardt algo- errors, it can not be reproduced exactly by the simula-
rithm as well. Many different equivalent circuits may tion function. The best fit of this function is found
be employed through the use of an unique Circuit through minimizing the sum S of the (weighted)
Description Code (CDC). This code is also essential squares of the difference between the measured and
for the construction of a fast analytical derivatives the simulated data sets:
routine. The NLLSF principle will be discussed brief-
N
ly as it is readily available in the literature, see e.g.
S = ~ w i [Yi - Y(xi, al "'aM)] 2 . (4)
Bevington [20]. The CDC and the analytical deriva- i=l
tives routine are explained in separate sections. A short
overview of possible circuit elements is also provided. If the inverse variance, 1/o2 , of the measurement
The power of such a NLLSF procedure is demon- is used as weight factor, S becomes the goodness of
strated in multi parameter fits performed on synthetic fit parameter ×2 [20]. When the function Y(x, a 1 ...aM)
and real data using the program "EQIVCT". is linear in the parameters am, this can be done by set-
ting the partial derivatives, (OS]~m), to zero. The re-
suiting M simultaneous equations can then be solved
2. Special notations and the parameters evaluated.
If the function is not linear in am, as is often the
In the following sections complex functions will be case in frequency dispersion analysis, the problem is
denoted by an asterisk, *. The real and imaginary part linearized by developing Y(x, a 1 ...aM) in a Taylor se.
of a complex function will be marked with a single ries around a set of starting values a O :
prime, ', and a double prime, ", respectively, e.g.:
Y(x, a 1 ...aM) = Y(x, a 10...a~l
s*(co) = s ' ( ~ ) + j s " (co) , (1)
where j = ~ - ] . The frequency dispersion data can be M Oy(x, al...aM )
given in the admittance representation, subscript y,
+ ~ ~am + .... (S)
m =1 Oam
or in the impedance representation, subscript z. As all
equations in the description of the NLLSF procedure The higher order terms in eq. (5) are ignored. Inserting
are valid for both the impedance and admittance repre. eq. (5) in eq. (4) and setting the partial derivatives of
sentation, the use of the symbol Y will stand for either S with respect to the new set of variables, 8am , to zero
representation (general: immittance). The measure- we obtain again a set of M simultaneous equations in
ment data set is represented by: 5a. In matrix form:
Y ; = Yt + J Y ; ' , i= 1 . . . N . (2) et.6a =i~ (6)
The fitting function is represented by with
aM)An special cases this may be abbre-
Y * ( ¢ o , a 1 ...
viated to: N Oy(xi, al...aM) OY(xi, al...aM)
amk = .i~=1w i aa m Oak (7)
Y * ( w , am) = Y'(co) +]Y"(o~), m = 1...M. (3)
and
1 N _q.
X2 = X2/I~= v ~ OT2[yi - Y(xi, gl...aM)]2 S~(¢o) = ~=~ Ezk(¢o), (16)
= S/(gv) ~ 1, (14) where Sz*(o~) is the overal circuit response in the impe.
dance representation (denoted by z) at circle frequen-
where v = N - M - 1 is the degrees of freedom of the cy o:. Ezk (co) is the (complex) impedance of element
system. With eq. (14) the value o f g can be obtained Ek at frequency ~. For a parallel circuit the circuit
from the f'mal value of S. The estimated uncertainties response is:
of the parameters, Oa2, follow then from the error ma-
trix e, provided that ~ e Marquardt parameter, ~, has
been set to zero: S:(co) = ~ E;k(CO), (17)
k=l
O2m = gemm • (15)
where y signifies the admittance representation, and
The covariance for the parameters can also be ob-
tained from the error matrix [20]. E~k (~) = [Ezk (~)]-1 . (17a)
These additions can be performed by the computer
program if the dispersion relations of the various types
4. Calculation of the frequency response of elements (i.e. resistance, capacitance, Warburg etc.)
are available in both representations in the program.
To make the NLLSF-program useful it must be Depending on the language used these could be written
able to accommodate different equivalent circuits. Of as functions (Pascal) or subroutines (Basic, Fortran).
course, one can write the specific dispersion equations, Calling these routines with the proper (adjustable) pa-
describing the response of a particular equivalent cir. rameters, am, and frequency, co/, then returns the re-
cult, in the program. However, if there is a need to quired immittance value.
amend the circuit, one has to rewrite these equations, A circuit description code (CDC) can then be a
with the risk of including programming errors. This is string of symbols in which each symbol represents a
a rather inconvenient and time consuming route, as specific type of element (e.g. R for resistance, W for
the program has then to be compiled and debugged Warburg). The code for a series (or parallel) circuit of
again. elements El, E2, EQ would then become:
A more general approach would then be to devise
E1E2...EQ, (18)
a large array of elements and a corresponding set of
dispersion relations, from which most equivalent cir. where E k is the symbol representing the type of the
cults can be obtained by simply setting elements either element Ek. In the program this symbol acts as a
to zero (short circuit) or infinity (open circuit). The pointer to the specific routine which calculates the
disadvantage of this method is that many unproduc- frequency dispersion of element Ek : Exk (co), where
tive calculations have to be performed where elements x denotes impedance or admittance. The parameters
have been removed from the array. This disadvantage of the elements must be in the same order as in which
is greater the lesser elements the equivalent circuit has. the CDC is interpreted by the program. The overall
The most general way would be to design a code, response is then obtained for a series circuit in the im-
which uniquely represents a specific equivalent circuit, pedance representation, following eq. (16), and for a
and which can be interpreted by the program in such parallel circuit in the admittance representation, ac-
a way that from a set of circuit parameters the proper cording to eq. (17).
response is calculated for each frequency. For a simple Most equivalent circuits, however, are more com-
series or parallel circuit this could be done easily as the plex, containing several series and parallel subcircuits.
total circuit response is found by adding the individual In order to deal with this problem we define two sets
responses of the elements in the proper representation. of elements:
Thus for a series circuit of Q elements: E 1 , E 2, EQ: (1) A simple element is a two terminal element
which represents a single (macroscopic) process, i.e.
B.A. Boukamp/lmmittance data of electrochemical systems 35
b-o~=1-.~e-v~-f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
........... "1
~-o'~=2-.Te~=f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
r- . . . . . . . . . . . . . . . . . . i rb~f-I FE,~I'-'I. . . . . . . . . . . .
' ' S~x-*.re;a-z. . . . . . . . "i
! L__.J ~ f
I I I I I ~- ' _ I
I L--J]-i- l T '"-~' T ~ T il II II
i I
L . . . . . . . . . . . . . . . . . . J
l ] L:gJ ~, ',
L . . . . . . L___:___J_j
'1 . I!
,+'1 $6>';'L~;e'I-7'-"i ~
I I ~ I I l- . . . . . . . . . .J t I
Fig. 2. Schematic representation of a composite element, (A): Ii . . . . . . . . . . . . . . . . . . . . J L . . . . . . . . . . . . . J
with a parallel internal subcircuit (odd level); (B): with a se- II t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ries subcircuit (even level). Solid lined boxes represent "sim- ii llc-,
ple" elements, broken lined boxes composite elements. II
Table 1
Consecutive steps in the development of the circuit descrip-
tion code for the equivalent circuit of fig. 2.
electrolyte ] electrode
Level Circuit description code (CDC) An* - - - ~ AyB
0 ( box-I ) 0 X
1 (C ( box-2 :))
2 (C(( box-3 )( box6 ))) Fig. 5. Schematic diagram foz one-dimensionaldiffusion in a
3 (C((P( box-4 ))(C(box-'/)))) mixed conducting electrode material,AyB. The currant, I*,
4 ( C ( (P (R (box-5)) ) ( C (R P ) ) ) ) and the voltage, V*, are complex, frequency dependent, vari-
5 (C((P(R(RP)))(C(RP )))) ables.
5. Element representations and symbols where IdE/dyl is the slope o f the electrochemical titra-
tion curve. I f the boundary at x = L is blocking for the
The CDC symbols for the most common circuit mobile species a tangent-hyperbolic function (CDC
elements, ia. resistance: R, capacitance: C, and induc- symbol '~r") is obtained [10,23] :
tance: L have been explained in the previous chapter. Y* (co) = Y0 ] V ~ T a n h [ B v ~ (24)
The corresponding dispersion relations are also well
known. Four other, diffusion related, dispersion ele- or separated in a real and imaginary component:
ments have currently been implemented in a NLLS- 1/'~ r sinhz - sin z
fit program. The dispersion relations for three of these Y* (co) = YO V 2 Lcosh z + cos z
elements follow directly from the solution (in the fre-
quency domain) of Fick's second law for one dimen-
+/ si hz + l (25)
sional diffusion in mixed conducting materials. A cosh z + cos z_J '
schematic representation is given in fig. 5. Here the
admittance is defined as the current of mobile ions where z =B,v/-2-~.B contains the sample length and the
flowing through the mixed-conductor/electrolyte in- diffusion coefficient:
terface, divided by the voltage, measured at the inter- s (26)
B.A. Boukamp/Immittancedata of electrochemicalsystems 37
For large values o f z (z ~, 1, i.e. high frequencies) the small values o f z the same holds as for the Tanh func-
Tanh.function becomes equal to 1 and eq. (24) can be tion. Eq. (29) can then be approximated by
replaced by the Warbug dispersion, eq. (22). For small
Y* (co) = YoIB +] YoBco/3 , (30)
values o f z (z ,~ 1) the trigoniometric and hyperbolic
functions must be replaced by their power series repre- which is the admittance representation of a resistance
sentations as their values become almost identical. Ig- (R =B/Yo) parallel to a capacitance (C = YoB/3).
noring higher order terms, eq. (25) changes to: A generally observed dispersion relation is the
Constant Phase Element or CPE [15], found in vari-
Y* (co) = YoB3 CO2/3 +/YoBco, (27)
ous electrochemical systems [ 13,14]. This element
which is the admittance representation for a resistance has a non-integer power dependence on the frequency:
(R =B/3Yo) in series with a capacitance (C = YoB).
Y*(co)=Yo(/co) n , 0<n< 1. (31)
In the case that the interface at x = L is non-blocking
and imposes a fixed activity for the mobile species, as Or separated in a real and imaginary part:
can be found for oxygen conducting electrodes [241
Y' = Yocon cos ~-mr, Y" = Yocon sin ~ mr. (32)
or in a symmetric arrangement of the cell of fig. 5 [10],
a cotangent-hyperbolic function is obtained (CDC sym- Recently a theoretical derivation, based on the frac-
bol 0): tal geometry of electrode interfaces, has been given
by Le Mehaute and Crepy [25]. Bates and Wang have
Y*(co) = ro wT Coth[av - . (28) shown that a non.integer power dependence can be ob-
Separated in a real and imaginary component: tained for a branched transmission line [26,27]. These
cases deal with electrode/electrolyte interfaces only.
|/-~_ [ sirth z + sin z
Y*(co) = Yo t' T L c - - 6 ~ = c ~ However, the CPE dispersion has also been observed
in the bulk response of ionic conductors. West et al.
[28,29 ] have investigated this type of bulk dispersion
+/ sinhz - sinc_._ff~.~.] (29) using the empirical "universal dielectric response" de-
cosh z ---
scribed by Jonseher [30]. In their curve fitting proce-
Again z = B V~-~', and Y0 contains the same expression dure they only regard the real component of the dis-
as in eq. (23). For large values o f z eq. (28) can be re- persion, without verifying whether the real and imagin-
placed by the Warburg representation, eq. (22). For ary part still fulfill the Kramers-Kronig relation. This
Table 2
Dispersion equations and CDC-symbols for simple elements. For complete equations for the finite length diffusion element
(Tanh and Coth), see text.
admittance impedance
Resistance, R: 1/R R
Capacitance, C: /~oC -//~c
Inductance, L : -j/teL
Waxbutg, W: Yo ~rw"~( 1 +/) (1 - i ~ / Y o J ~
CPE: P: yo wn [cos ~
I nn +] sin ~1 .ran] ~on [cos ~'mr
1
- / s i n ½nnllro
Tanh. diff., T: re/~-Tanh[B/~--~1 CothIS ~,ff~l lye
Coth. diff., 0: Yo~ Coth[B/~-w'] TanhlB4Td]/Yo f/-d
38 B.A. 8oukamp/1mmittance data of electrochemical systems
method of analysis has recently been reviewed critical- l - 1. However, S/* (co) is in the alternate representa-
ly by Macdonald [31 ]. tion of that of the lower subcircuit. The partial deriva-
A summary of the CDC symbols and the dispersion tive of S/*_l(co) with respect to a m becomes:
relations is given in table 2. Other types of special ele-
ments can simply be added to the program by assign- osL,(co) o [st (co)]-' a s/-/s:
hag an unique symbol to them and providing a subrou.
(34)
aa m ~t m aa m S/2 +ST 2 '
tine in which the frequency response is calculated.
which can be separated into a real and imaginary corn-
ponent:
6. Calculation of the derivatives
Table 3
Derivatives o f the "simple" elements. If a parameter would appear in the denominator o f a dispersion equation, it is replaced by
its inverse, thus simplifying the equation of the derivative. Y * (co) and Z* (co) represent the dispersion formulae of the elements
in the admittance and impedance representation respectively, see table 2.
+J
1 - c o s h ( z ) cos(z) / s~(z) ~n(z) ./
[cosh(z) - cos(z)fj [cosh(z) + cos(z)]2J
z > 10: 0 z > 10: O
z < 0.1: Yo[-l[B2+/co/3] z < 0.1: [1 - /B2 co]/Yo
a) z = B,,/2"~',
7. S i m u l a t e d data test eter values for real data cannot be known, which
makes it impossible to check whether the fit param-
The power o f the NLLSF-program has previously eters are appropriate. Therefore synthetic data has
been shown [22] with an eleven parameter fit based been constructed using the parameter values as ob-
on the equivalent circuit o f fig. 3. The actual param- tained in the NLLS-fit o f a frequency dispersion mea-
40 B.A. Boukamp/lmmittance data o f electrochemical systems
Table 4
Result of a fit performed on synthetic data with the NLLSF program "EQIVCI'". The data was constructed with the paxameter
set of the first column. The second column presents the starting values obtained in a preliminary analysis after noise has been ad-
ded to the data. The NLLS-fit results, together with the estimated uncertainties, are presented in the last column.
T 15.4 mHz
0
• ee e2 boo
O00W OQ I Io •
[] o
t-
a
T -1 D
"I
I I i I 1
K, ~-2
u
2
CDC: LR(RP)T . Are
I:
• Aim
,~ 0
D
...¢j J
,i 2 3
Z' , (ohm)
-2 i I i
Fig. 7. Typical example of the frequency dispersion of the
tog c~ ,,
impedance of a mixed conducting electrode material. Open
circles represent data points obtained from an AgxNbS2 sam- Fig. 8. FQ-plots for the NLLS-fitresults for the at-diffusion
ple [9]. The solid line represents the fit result. data of fig. 7, using two different equivalent circuits.
42 B.A. Boukamp/Immittance data o f electrochemical systems
uncertainties in the latter fit are rather high, which is sion data must be free of systematic errors. One
due to a very strong correlation between some of the source of distortion of the dispersion data is the in-
circuit parameters. The observed inductance value is put impedance of the measuring instrument together
quite close to the previously estimated value. From with possible internal frequency dependent signal
this analysis it may be concluded that the reaction lay- gains and phase shifts. With the use of small com-
er is present, but no reliable parameter values can be puters in the data acquisition system, the measure-
obtained. The parameters of the Tanh-function are not ments can easily be corrected for these type of errors
affected by the different analysis, as might be expected [22]. Also the temperature of the measurement cell
from the shape of the frequency dispersion. should be very constant. Assuming an Arrhenius type
behaviour for the parameter a m of an element, the
relative change with a change AT in temperature can
9. Discussion be expressed as:
[Anm/a m ] = AT'H/k" T 2 , (38)
The nonlinear least squares fit technique is a very
valuable tool for analyzing complex frequency disper- which at 300 K and with an activation enthalpy of
sion data. Although these fitting procedures are readily 100 kJ/mole(1.04 eV) gives [A,,mla m ] = 0.13 X AT,
available from computer libraries (eg. the NAG or or a 13% change for 1 degree increase in temperature.
IMSL libraries) it is worthwhile to write ones own fit If the system parameters change continuously with
program following the route described in this paper. time, a NLLS-fit may still be used after the data has
The great advantage of the response calculation based been transformed to a "constant time" data set. Such
on a circuit description code (section 4) is that once a scheme has recently been presented by Stoynov and
the separate dispersion formulae of the various types Savova-Stoynov [35,36]. In this interesting procedure
of circuit elements have been written correctly in the the time is an extra dimension in the frequency disper-
program, a change in the equivalent circuit is imple- sion measurement. In the time-immittanc¢ frame, con-
mented without rewriting parts of the program. stant frequency projections are created through fitting
The use of an analytical derivatives routine (sec- of cubic spline functions to the immittanee.time data
tion 6) instead of the numerical evaluation method sets. From these functions a set of frequency-immit-
employed by the library fit programs, not only en- tance projections at constant time can be obtained,
hances the precision of the fit but also dramatically which subsequently can be analyzed with a NLLSF
increases the speed of execution of the program. procedure.
This is a significant advantage as computing time on The choice for the set of starting parameters, eq.
main frame computers is quite costly. (5), is very important, as the number of iterations in
In this respect it is useful to consider the optimum the fit procedure will depend sharply on the "quality"
number of immittance data per dispersion measure- of this set. U~ng a personal computer the data set
ment. Although a large number of measurements per can be analyzed in a crude manner by subtracting the
(frequency) decade seems a good choice for obtain- dispersions of elements or combinations of elements
ing the best fit, one should realize that computing from the total frequency distribution [32], or by
time increases linearly with the number of data sets. simple graphical means. The choice of the proper
Thus it is more appropriate to invest measurement equivalent circuit is crucial to a good fit result. Over
time in obtaining a minimal number of data points parameterisation is not very likely here, as only a
but with a maximum reliability. In practice it appears limited number of very distinct dispersion relations
that 5 to 7 steps per decade are sufficient for an op. are allowed. The parameters of superfluous circuit
timal fit result. Using white noise and a FFT spec- elements will be pushed either to zero or infinity by
trum analyser for frequency dispersion measurements the fit procedure, whereas insufficient elements will
[34] is less suited for a subsequent NLLSF analysis, result in an obviously bad fit, which will show a dis-
as this method yields a great number of data sets tinct trace in ti,e FQ-plot.
with rather low precision. Of course one should be aware of the equivalence
To ensure a good fit result the frequency disper. of two special circuits [37], see fig. 9. If circuit (a)
B.A. Boukamp/lmmittance data of electrochemical systems 43
References
[26] J.B. Bates, J.C. Wang and R.L. Anderson, ECS Fall [32] B.A. Boukamp, Solid State lonics 18/19 (1986) 136.
Meeting (New Orleans, 1984). Extended Abstracts, [33] A.G. Gorards, H. Rocde, R.J. I-laange, B.A. Boukamp
Vol. 84-2, p. 233. and GA. Wiegers, Synth. Metals 10 (1984/85) 51.
[27] LC. Wang and LB. Bates, ECS Fall Meeting (New [34] A. Chabli, J.P. Diard, P. Landaud and B. le Gorrec,
Orleans, 1984) Extended Abstracts VoL 84-2, p. 234. Electrochim. Acta 29 (1984) 509.
[28] P.G. Bruce, A.R. West and D.P. Almond, Solid State [35 ] B.S. Savova-Stoynov and Z. Stoynov, Electrochem.
Ionics 7 (1982) 57. Soc. 85-3 (1985) 152.
[29] D.P. Almond and A.R. West, Solid State Ionies 9/10 [ 36] Z.B. Stoynov and B.S. Savova-Stoynov, J. Electroanal.
(1983) 277. Chem. 183 (1985) 133.
[30] A.K. Jonscher, Phys. Thin Films 11 (1980) 202. [37] J.R. Macdonald, in: Electrode processes in solid state
[31] J.R. Macdonald, Solid State Ionies 15 (1985) 159. ionics, eds. M. Kleitz and J. Dupuy (Reidel, Dordrecht,
1976) p. 149.