14

Click here to load reader

Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

Embed Size (px)

Citation preview

Page 1: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

Electrochimica Acta 54 (2009) 1042–1055

Contents lists available at ScienceDirect

Electrochimica Acta

journa l homepage: www.e lsev ier .com/ locate /e lec tac ta

Electrochemical digital simulations with an exponentially expanding grid:General expressions for higher order approximations to spatial derivativesThe special case of four-point formulas and their application to multipulsetechniques in planar and any size spherical electrodes

Francisco Martínez-Ortiza,∗, Noemí Zoroab, Ángela Molinaa, Carmen Sernaa, Eduardo Labordaa

a Departamento de Química Física, Facultad de Química, Universidad de Murcia, E-30071 Murcia, Spainb Departamento de Estadística e Investigación Operativa, Facultad de Matemáticas, Universidad de Murcia, E-30071 Murcia, Spain

a r t i c l e i n f o

Article history:Received 26 May 2008Received in revised form 24 August 2008Accepted 25 August 2008Available online 30 August 2008

Keywords:Digital simulationFinite differenceExponentially expanding gridHigher order spatial discretisation

a b s t r a c t

This paper deals with the consideration, in digital simulation, of a grid in which there is a geometricalrelationship between the distances between neighbouring pairs of points, leading to an exponentiallyexpanding sequence of intervals. We show that the expressions for derivatives for higher order spa-tial discretisations take a very simple form, with coefficients which are dependent on the numberof points taken to the left and right of the point considered, but independent of the absolute posi-tion of the point in the grid. This enables convenient and efficient manipulation and incorporationin computer programs of these derivatives in the context of finite difference approach. Moreover, theexplicit expressions obtained lead to very interesting particular situations. The most interesting isthe optimal behaviour of the four-point spatial discretisation for very high expansion factors, which,in combination with fully implicit time-integration schemes, leads to very fast and accurate calcu-

Implicit integrationSpherical microelectrodesAsymmetric approximation to derivativesMS

lations both for planar and any size spherical electrodes, including microelectrodes. Applications ofthese coefficients in the simulation of some multipulse and square wave experiments are also pre-

1

tRufttg

cbPs

a

ihiavofdwo

0d

ultipulsequare wave

sented.

. Introduction

The use of unequal grids in electrochemical digital simula-ions becomes almost imperative under some circumstances [1,2].ecently, it has been shown that direct discretisation on annequally spaced grid is preferable to the use of transformationunctions [3–5]. Britz [6] and Britz and Strutwolf [7] have, respec-ively, proposed a numerical method and an analytical methodo obtain higher order special discretisation on arbitrarily spacedrids.

When an unequally spaced grid has to be chosen in electro-hemical digital simulation, the exponentially expanded one haseen the favourite for authors since its introduction by Joslin andletcher [8] (a previous non-electrochemical application was pre-ented by Pao and Dougherty [9]) and the refinements introduced

∗ Corresponding author. Tel.: +34 968 36 7419; fax: +34 968 36 4148.E-mail addresses: [email protected] (F. Martínez-Ortiz), [email protected] (N. Zoroa),

[email protected] (Á. Molina), [email protected] (C. Serna), [email protected] (E. Laborda).

iroawfotst

013-4686/$ – see front matter © 2008 Elsevier Ltd. All rights reserved.oi:10.1016/j.electacta.2008.08.039

© 2008 Elsevier Ltd. All rights reserved.

n the seminal paper by Feldberg [10]. For example, this approachas been used in Ref. [2] and in the practical calculations given

n Refs. [6] and [7]. This is not surprising because this grid isble, simultaneously, to take a quite high number of points in theicinity of the electrode and a low total number of points. More-ver, this option will be greatly improved if explicit expressionsor the coefficients that allow calculation of the first and seconderivatives are available. This is the first objective of this paper, inhich very simple and general expressions for these coefficients are

btained.The derivatives at a given point in the grid are calculated taking

nto account the values of the function at some points around theeference point. The coefficients obtained depend on the numberf points taken to the left and right of the point considered butre independent of the absolute position in the grid of this point,hereas the derivatives depend on the position by a simple division

actor, which means the results obtained are very general. More-ver, the manipulation and incorporation in computer programs ofhese derivatives is convenient and efficient. To simplify their utili-ation, the coefficients are presented in tabular form and have beenested using several procedures.

Page 2: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

chimi

artrctev

tftctuirapn

2

i

Le

h

we

x

cbieaotlf

3

dctmapuoa

(itI

ct

u

u

w

u

u

w

ofa

ld

u

t

u

nt

uhj

u

wso

u

F. Martínez-Ortiz et al. / Electro

The expressions of the coefficients for derivatives have led ourttention to some values of the expansion factor, �e, which giveise to very interesting particular situations, whose study consti-utes the second objective of this paper. The most interesting resultelates to the use of the asymmetric four-point approximation inombination with high expansion factors (�e ≥

√2, depending on

he electrode radius). The particular value �e =√

2 is very inter-sting for the simulation of spherical microelectrodes while higheralues are interesting for planar electrodes.

In all cases, the combined use of fully implicit higher orderime-integration schemes, high-values of the expansion factor andour-point formulas lead to very efficient procedures that give riseo results four-figures accurate, using only a small fraction of thepu-time necessary with five-point formulas, and with the addi-ional advantage that four-point formulas are appropriate for these of simple methods for the application of boundary conditions,

n a similar way to the less accurate three-point formulas. Theseesults are presented in this paper by means of the simulation ofvariety of electrochemical experiments under galvanostatic andotentiostatic conditions, including pulse and square wave tech-iques, where the four-point formulas are specially advantageous.

. The exponentially expanding grid

In the following discussion it is assumed that the reader is famil-ar with electrochemical digital simulation [1].

Let x0, x1, x2, . . ., xk, . . . be the points of the grid, with x0 = 0.et us assume that the distance between two consecutive pointsxpands exponentially, i.e.

i = xi+1 − xi = h�ie (1)

here h = h0 is the amplitude of the first interval and �e is thexpansion factor. The position of the points xi is given by

i = h�i

e − 1�e − 1

(2)

This method for expanding the grid was introduced in electro-hemical digital simulation by Joslin and Pletcher [8] and refinedy Feldberg [10], even though Eq. (2) is written using the formal-sm given in [1]. The appropriate selection of h and �e leads to anffective and versatile way for obtaining unequally spaced intervalsdapted to the problem under consideration. For example, in termsf dimensionless distance (see below) with h = 0.004, the grid con-ains 131 points if �e = 1.03 or 20 points if �e =

√2, ensuring that the

ast point in the grid is at a distance xMAX ≥ 6 from the electrode sur-ace (which is appropriate for dimensionless time equal to unity).

. The approximations for the derivatives

The expressions obtained to approximate first and seconderivatives presented here are based on Taylor expansions andonstitute a variant of the so-called “point method” [1] in elec-rochemical digital simulation. In order to recognise on the fly the

eaning of the concrete form being used, a notation with emptynd filled circles, similar to that given in Ref. [7], is used in thisaper. For example, (◦ • ◦ ◦ ◦) means that a total of five points aresed to calculate the derivatives, which are evaluated at the secondf these five points (the filled point). The same form is referred tos the (5,2) form.

As an example, consider the central three points approximation◦ • ◦) or (3,2) form to the second derivative at point xi. The indexpoints to the absolute position in the grid of the point at whichhe derivative is being evaluated; this position is given by Eq. (2).f we give the name ui to the value of the function (usually the

u

ca Acta 54 (2009) 1042–1055 1043

oncentration of a given species) at point xi and u′i, u′′

i, u′′′

i, . . . to

he successive derivatives at the same point, we have

i+1 = ui + u′ihi + u′′

i

h2i

2!+ u′′′

i

h3i

3!+ . . . (3)

i−1 = ui − u′ihi−1 + u′′

i

h2i−1

2!− u′′′

i

h3i−1

3!+ . . . (4)

e can now combine Eqs. (3) and (4) to eliminate u′i, obtaining

′′i = 1

h2i

(˛−1ui−1 + ˛0ui + ˛1ui+1) + u′′′i hi

1 − �e

3�e+ . . . (5)

Thus, by neglecting the terms from the third derivative we obtain

′′i ≈ 1

h2�2ie

i+1∑k=i−1

˛k−iuk (6)

ith

˛−1 = 2�2e

1 + �e

˛0 = −2�e

˛1 = 2�e

1 + �e

(7)

Taking into account Eq. (5), we expect Eq. (6) to provide the valuef the second derivative with an error of the order of hi. Note thator �e = 1 (an equally spaced grid) the coefficients given in Eq. (7)chieve the expected values 1, −2 and 1.

Similarly, by the elimination of the second derivative, the fol-owing results have been obtained for the central three-point firsterivative

′i = 1

hi(ˇ−1ui−1 + ˇ0ui + ˇ1ui+1) − u′′′

i h2i

1�e

+ . . . (8)

Now, neglecting third and higher derivatives enables us to obtainhe first derivative with an error of the order of h2

ias

′i ≈ 1

h�ie

i+1∑k=i−1

ˇk−iuk (9)

ˇ−1 = − �2e

1 + �eˇ0 = �e − 1

ˇ1 = 11 + �e

(10)

ote that the coefficients ˛k and ˇk are independent of i, whereashe derivatives depends on i by a simple i-dependent division factor.

Similarly, by taking more values of the function (at points ui−2,i+2, etc.) and by eliminating higher order derivatives, we can obtainigher order approximations to first and second derivatives. Takingpoints, the general form of the first term to be neglected is

(j)i

hj−bi

fb(�e) (11)

here b is equal to 1 for the first derivative and equal to 2 for theecond derivative. fb(�e) is a known function of �e. The general formf the approximate first and second derivatives is

′i(p, q) = 1

i

i+n∑ˇk−iuk (12)

h�e k=i+m

′′i (p, q) = 1

h2�2ie

i+n∑k=i+m

˛k−iuk (13)

Page 3: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

1 chimi

wttia

sdTp

4

laf

lto

afutfi(bf

5c

dosEasta˛ttt

f(if

cfifbit

h

wt

e

(

(

(

6e

044 F. Martínez-Ortiz et al. / Electro

here, according to the previously assumed notation, p representshe number of points taken to evaluate the derivative and q the rela-ive position in this set of points of the point at which the derivatives evaluated. This point is pointed in the total grid by the index i. pnd q are related with m and n by

m = 1 − qn = p − q

(14)

The coefficients ˛k and ˇk have been obtained for all the pos-ible forms taking three, four or five-point approximations for theerivatives. The results are presented in Appendix Tables A1–A6.he coefficients obtained have been tested and some simulations ofroblems of known analytical solutions have also been carried out.

. Test of the coefficients

The coefficients obtained have been tested by calculating theirimiting values when �e → 1, and by evaluation of the error ordersnd error values in the approximation of the derivatives of knownunctions.

In Appendix Table A7, the values of all the coefficients in theimiting case �e → 1 are compiled. The coefficients are reduced tohe known coefficients for derivatives in equally spaced grids. Manyf these are given in Refs. [1,11,12].

The error orders with respect to h can be numerically evalu-ted and compared with the predictions of Eq. (11) for the differentorms presented in this paper. This evaluation has been carried outsing the functions exp(−x) and erf(x), both showing easy deriva-ives, taking �e = 1.05 and 0.1 ≤ h ≤ 0.002. The results (not shown)t expectations, with the error orders being those predicted by Eq.11) and the numerical values of the errors decrease as the num-er of points considered increases (the lowest for the five pointormulas and the highest for the three point formulas).

. An interesting particular situation found with theoefficients

It is well known that the central three-point (◦ • ◦) seconderivative approximation for an equally spaced grid shows an errorrder O(h2) instead of the value O(h) obtained for the unequallypaced grid. This fact can be easily predicted taking into accountq. (5), because the term corresponding to the third derivative dis-ppears when �e = 1, increasing the order of the error to O(h2). Theame prediction can be obtained from Appendix Table A3, becausehe coefficients ˛2 of the form (◦ • ◦ ◦) and ˛−2 of the form (◦ ◦ • ◦)re both zero for �e = 1. Moreover, the rest of the coefficients, ˛−1,0, ˛1 are the same for the forms (◦ • ◦ ◦), (◦ ◦ • ◦) and (◦ • ◦). Thus,

he form u′′(3,2) is equivalent to the forms u′′(4,2) and u′′(4,3) forhese particular conditions, and shows the error order O(h2) andhe error values characteristic of the four-point formulas.

In a very similar way, a look at Appendix Table A5 reveals thator the particular value �e =

√2, the coefficients ˛3 of the form

◦ • ◦ ◦ ◦) and ˛−2 of the form (◦ ◦ • ◦ ◦ ◦) are both zero. Moreover, asn the preceding case, the non-null coefficients are the same for theorms u′′(5,2), u′′(5,3) and u′′(4,2), with

˛−1 = 87

(3 −√

2)√

˛0 = 2( 2 − 3)

˛1 =√

2

˛2 = 18 − 13√

27

(15)

thc

ca Acta 54 (2009) 1042–1055

Thus, the form u′′(4,2) for �e =√

2 shows the error order O(h3),haracteristic of the five-point formulas. This fact has been con-rmed by evaluation of error in the second derivative of a known

unction (as before using exp(−x) and erf(x) but with �e =√

2), andy consideration of the factor that multiplies the fourth derivativen the elimination process carried out to obtain the coefficients forhe form u′′(4,2), it is

2i f2(�) = h2

i

2 − �2e

�e(16)

hich is zero for �e =√

2, with the error order increasing from O(h2)o O(h3).

There are several reasons for considering this result very inter-sting:

1) Let us consider, as described above, that for small values of theexpansion factor (for example �e = 1.05, as used in the eval-uation of error and error orders) the error committed in theevaluation of second derivative is lower for five-point formulasthan for four-point formulas. However, in �e =

√2 the forms

(4,2) and (5,3) are coincident and, consequently, give rise tothe same error. This suggests the existence of a cross-point(at �e =

√2) in the functions describing the dependence of the

errors with �e for the form (4,2) and five point formulas, whichcan give rise to lower errors using the asymmetric four-pointform than the symmetric five points form when �e >

√2. This

will be investigated in depth in the next sections.2) If no-planar electrodes are used, Fick’s second law contains

both first and second derivatives. If the same number of pointsare used to approximate these derivatives (which is very con-venient in order to obtain appropriate implementation ofnumerical procedures), according to Eq. (11), the error order isone-unit higher for the first derivative, which is true except for�e =

√2, where both error orders are coincident, which sug-

gests a good behaviour under these conditions. This will beinvestigated with spherical electrodes.

3) The numerical implementation of the boundary conditions usu-ally used in electrochemical digital simulation can be difficultand tedious for higher order approximations (for example forfive-point formulas, which require working on pentadiagonalarrays [11]). On the other hand, three-point formulas producetridiagonal linear system of equations which can be solvedusing the Thomas algorithm [1], giving rise to simple and effi-cient procedures to implement the boundary conditions, asfor example the u–v device [13,1]. The three-point scheme isuseful in the equally spaced grid (remember the especial good-ness of the form (3,2) for �e = 1) but can produce unacceptableerrors and/or poorly efficient algorithms when an unequallyspaced grid is used. It has recently been shown by Britz andStrutwolf [7] that a Thomas-like algorithm can be applied inthe solution of the linear system of equations resulting fromthe use of the four-point forms to the discretisation of Fick’ssecond law. Hence, we can aggregate both desirable character-istics, Thomas-like algorithm (as the three point formulas) andmoderate errors (as higher order formulas) using the form (4,2)concurrently with high expansion factors.

. General considerations on the simulations at sphericallectrodes when only one chemical species is relevant

In order to develop an additional test of the coefficients ando prove the considerations presented in the previous section, weave carried out some simulations of experiments using spheri-al electrodes. Spherical electrodes are of interest in this context

Page 4: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

chimi

baoiwcscairpt

t

w

ctaietos

a

wc

H(ifw

sI(watd“e

l

ortBooEe

ai

wtca

E

C

a

C

a

nefFttsnst

wawaiT

tf

F. Martínez-Ortiz et al. / Electro

ecause the corresponding Fick’s second law, contains both firstnd second spatial derivatives, since planar electrodes can bebtained as limiting cases when the electrode radius tends to infin-ty and because there is a set of problems in spherical diffusion

ith simple and compact analytical solutions, which is useful toompare with numerical calculations. In this section we presentimulations for the simplest case, where only the diffusion of onehemical species need to be considered: the Cottrell experimentnd constant-current chronopotentiometry; both problems hav-ng exact and simple analytical solutions [14,15]. To confirm theesults obtained here, in Section 9 we develop some simulations forulse, double pulse and multipulse (e.g. square wave voltammetry)echniques.

Fick’s second law for diffusion of a species to a spherical elec-rode can be written in a dimensionless form as

∂C

∂�= ∂2C

∂x2+ 2

R0 + x

∂C

∂x(17)

here

C = c

c∗� = t

tr

x = r − r0√Dtr

R0 = r0√Dtr

(18)

is the concentration of the diffusing species, c* is the bulk concen-ration of the same species, D is its diffusion coefficient, t is timend tr is an appropriate reference time (for the Cottrell experimentt will be the duration of the experiment and for chronopotentiom-try it will be the transition time given by Sand’s equation), r ishe distance from the centre of the electrode and r0 is the radiusf the electrode. The dimensionless parameter R0 represents thephericity of the electrode, increasing as R0 decreases.

For the Cottrell experiment the following conditions can bepplied

� = 0, x ≥ 0� > 0, x → ∞

}: C = 1 (19)

> 0, x = 0 : C = 0 (20)

hereas for chronopotentiometry with constant current Eq. (20) ishanged for

> 0, x = 0 :∂C

∂x= G (21)

ence, G represents the dimensionless flux at the electrode surfaceequivalent to the dimensionless current). Under these conditions,f G = √

�/2, the depletion of diffusing species at the electrode sur-ace (the transition time) takes place at � = 1 for a planar electrode,hereas for a spherical electrode this depletion takes place at � > 1.

In spite of our coefficients are useful for any time-integrationcheme, explicit (Euler, Runge-Kuta, etc.), fully implicit (Backwardmplicit, BDF, higher-order extrapolation, etc.) or intermediateCrank–Nicolson), we are interested in finding the conditions underhich the time integration is not determining in the global error

nd, for this purpose, we need to be able to change the values ofhe amplitude of temporal intervals, ı�, and h independently. Too this, we have avoided any time integration in which there is acoupling” between these parameters. Hence, we have never usedxplicit methods (Runge-Kuta or Euler) because stability strongly

ees

t

ca Acta 54 (2009) 1042–1055 1045

imits the value of � [1]

= ı�

h2(22)

r Crank–Nicolson, in which high �-values causes oscillatoryesponses [1]. We have used unconditionally stable full implicitime-integration schemes, the Laasonen method [16] (referred to asackward Implicit, or BI) and the much better higher order extrap-lation schemes, as used by Strutwolf and Schoeller [17], basedn BI, and referred to as EXTRAP2 (second order extrapolation),XTRAP3 (third-order extrapolation) and EXTRAP4 (fourth-orderxtrapolation).

Eq. (17) can be written in discrete form using Eqs. (12) and (13)s below, and is thus appropriate for the Backward Implicit time-ntegration scheme [16].

C ′i− Ci

ı�= 1

h2�2ie

i+n∑k=i+m

˛k−iC′k + 2

R0 + xi

1

h�ie

i+n∑k=i+m

ˇk−iC′k (23)

here xi is given by Eq. (2). Ci is the known value of the concen-ration at point xi at time � and C ′

iis the unknown value of the

oncentration at time � + ı� at point xi. Eq. (23) can also be writtens

Ci = −C ′i + �

�2ie

i+n∑k=i+m

(˛k−i + 2h�i

eR0 + xi

ˇk−i

)C ′

k (24)

By calling the index of the last point considered in the grid imax,q. (19) for � + ı� can be rewritten as

′imax

= 1 (25)

nd Eqs. (20) and (21) as

′0 = 0 (26)

nd

1h

p−1∑k=0

ˇkC ′k = G (27)

To develop a specific simulation, we have first to decide theumber of points to be considered to calculate the derivatives. Forxample, if three points are selected for this purpose, we use theorm (3,2) for coefficients ˛k and ˇk in Eq. (23) for 1 ≤ i ≤ imax − 1.or the Cottrell experiment, with Eqs. (25) and (26) we obtain aridiagonal linear system of equations which can be solved usinghe Thomas algorithm [1]. For Chronopotentiometry (after the firstcan in the Thomas algorithm is completed) we have to combine aumber (depending on p) of equations of the resulting didiagonalystem with Eq. (27) to obtain C ′

0 and to develop the second scan ofhe algorithm.

If we prefer to take four points for evaluating the derivatives,e use the form (4,2). After a simple elimination step, we obtainbanded system, with a lower bandwidth of 1 and a upper band-idth of 2, which can also be solved with a Thomas-like algorithm,

s described in Ref. [7]. A very similar procedure to that correspond-ng to the three-point case can be used in combination with thehomas-like algorithm for chronopotentiometry.

We can also use five-point forms to evaluate the derivatives. Inhis case, we use the forms (5,3) for 2 ≤ i ≤ imax − 2, the forms (5,2)or i = 1 and the forms (5,4) for i = imax − 1 and Eq. (26) for the Cottrell

xperiment or Eq. (27) for chronopotentiometry. After some simplelimination steps, we obtain a pentadiagonal system, which can beolved with the algorithm described in Ref. [11].

In addition to the BI time-integration scheme described above,he more sophisticated extrapolation algorithm (as described in

Page 5: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

1 chimi

RNciotbbi

ttfuhfl(a

itettt�

BpMgi

7

ecw

G

ap

E

irowHnClt

w

C

a

E

agtdsgnaaoea

h

wttpbttei

raetewmLotWpswllwrceiut

st

fscwa−W

046 F. Martínez-Ortiz et al. / Electro

efs. [12,17]), based on the BI, has also been used in the calculations.ote that we have used an object-oriented approach to developomputer programs. Under this approach, the application of the BIntegration scheme is implemented by calling a member functionf the object containing the concentration profiles of all species par-icipant in the electrode process. This member function managesoth the Thomas algorithm (or the pentadiagonal system) and theoundary conditions. Thus, once the BI scheme is implemented, the

mplementation of the extrapolation algorithm is almost trivial.In the Cottrell experiment, once all the values of the concen-

rations at time � + ı� have been computed, the calculation ofhe dimensionless current is carried out using Eq. (27) with theorms (3,1), (4,1) or (5,1). In all the calculations presented, we havesed the five-point approximation (form (5,1)). We have used thisigher order formula in order to minimise the contribution of theux calculation in the global error However, with small h-valuesh < R0/10,000 for spherical electrodes) a three or even two-pointpproximation can be sufficient in the calculation of flux.

In order to retain the control on the values of h and �e, once themportance of the value of this parameter had been stated, in allhe calculations the number of points in the grid was selected toxtend the simulation to a dimensionless distance from the elec-rode surface xMAX ≥ 6 (in some cases of Section 9, this distance wasaken as greater). However, it is also possible to fix the position ofhe last point, to select a h-value and to calculate the correspondinge-value, as described in ref. [7].

All the computer programs were written in C++ using Borlanduilder 6.0 and run in the console mode under Windows XP in aersonal computer with a Pentium IV 2.8 GHz processor with 1024b RAM, and in the same system under LINUX Suse 10.1 using the

cc compiler, version 4.2.0. The “long double” type was always usedn arithmetic calculations.

. Error in the simulations of the simplest cases

The results of the simulations have been compared with thexact solutions. In the case of the Cottrell experiment for spheri-al electrodes, the calculated dimensionless current was comparedith the analytical solution [14]

exact = 1√��

+ 1R0

(28)

nd since the calculated dimensionless flux is G, the error was com-uted as

rrorPot = G − Gexact (29)

We have taken the absolute error to keep a homogeneous def-nition of errors throughout the paper, thus avoiding meaninglessesults when the compared magnitudes attain near-zero values, asccurs in chronopotentiometry with the surface concentration orith the current at some potential-values in multipulse techniques.owever, remember that, according to Eq. (28), the planar compo-ent of the current varies in the range 1.784–0.5642 for 0.1 < � < 1.onsequently, only for small electrodes, where 1/R0 can be very

arge, there are significant differences between absolute and rela-ive errors.

In chronopotentiometry, the surface concentration calculatedas compared with the analytical solution [15],( (

�) (

�1/2))

0,exact = 1 − R0G 1 − expR2

0

erfcR0

(30)

nd the error computed as

rrorGalv = C0 − C0,exact (31)

aFtah

ca Acta 54 (2009) 1042–1055

With higher order spatial discretisation in combination withppropriate efficient integration schemes using an equally spacedrid, the solution calculated can be approximated to the true solu-ion as close as the round off errors allow, by the simultaneousecrease of h and ı�. Unequally spaced grids fit very well to theolutions of electrochemical problems of interest and offer a veryood compromise between efficiency and accuracy. However, it isecessary to bear in mind that with unequally spaced grids therere intrinsic limitations in the accuracy of the numerical solutions,lthough these limitations do not diminish the practical interestf the grid. To understand better the limits of the accuracy of thexponentially expanding grid, we will rewrite Eq. (2), taking intoccount Eq. (1), as

i = xi(�e − 1) + h (32)

hich implies that the distance between the point placed at dis-ance x and the nearest point to the right is, at least, x(�e − 1). Thus,he error committed in the calculation of the derivatives at eachoint and for each form, which depends on hi (see Eq. (11)), is lowerounded and this bound depends only on x and �e. Note, however,hat the greatest errors correspond to large x, far from the elec-rode surface and where the gradients are small. Consequently, wexpect that the associated error in the derivatives will be of minormportance for electrochemical magnitudes.

We are interested in those errors related to electrochemicallyelevant magnitudes, such as the current in the Cottrell experimentnd the surface concentration in chronopotentiometry. The globalrror in the evaluation of these magnitudes is influenced both byhe spatial discretisation and by the time-integration scheme. Anxample of the influence of the time integration is shown in Fig. 1here it can be observed that while the time integration is deter-ining in the global error, a regular behaviour is observed in the

og(|ErrorPot,Galv|) vs. � plots, with errors diminishing as � increasesr when the ı�-value diminishes. However, there is a natural limito the improvement that the time-integration scheme can reach.

hen this limit is reached, the error crosses zero (leading to aronounced dip in the plot) and, afterwards, it tends to a con-tant value. This constant value, which is reached for lower �-valueshen the time-integration is higher order, can be considered as the

imit of accuracy of the spatial discretisation. Note the very paral-el behaviour of the Cottrell experiment and chronopotentiometry,

hich indicates the common origin of the natural limit in accuracy,elated more with the spatial discretisation than with boundaryonditions. The natural limit of the spatial discretisation can beasily obtained by carrying out simulations with higher order time-ntegration schemes and short time steps. In this paper, we havesed for this purpose the EXTRAP4 scheme [16] with ı� = 0.01, andhe error was evaluated at � = 1.

Once the procedure to evaluate the natural limit of error in thepatial discretisation has been established, we are ready to studyhe influence of the relevant parameters on this natural limit.

The influence of h varies according to the number of points takenor the representation of spatial derivatives, the value of the dimen-ionless electrode radius and the value of �e. The most frequentase corresponding to small electrodes is presented in Fig. 2, inhich we show the influence of h and R0, using five-point formulas

nd �e = 1.05. In this figure, the limit of the error is plotted againstLog(h/R0) for several values of R0 for the Cottrell experiment.hen the electrode radius is small, h must be h ≤ R0/100 to obtain

ccurate results but no improvement is achieved if h < R0/1000.or greater electrodes (a practical limit can be placed at R0 ≥ 1)he relevant parameter is h, rather than h/R0. Thus, good resultsre obtained for h ≤ 0.01 but no improvement is obtained for< 0.001.

Page 6: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

F. Martínez-Ortiz et al. / Electrochimica Acta 54 (2009) 1042–1055 1047

F ronop√

fi 01, �e

0

ts[TtHat

t

Fs�

umto

Ft

ig. 1. Log(|ErrorPot,Glav|) for the simulation of (A) the Cottrell experiment and (B) chve-point spatial discretisation and the integration scheme EXTRAP2. R0 = 1, h = 0.0.002; (h) 0.001.

Britz and Strutwolf have demonstrated that higher order spa-ial discretisation gives rise to more accurate simulations thanimple three-point discretisations both for equally spaced grids11,12] and for unequally spaced intervals in arbitrary grids [7].hus, we have to expect that the five-point spatial discretisa-ion leads to the best results, followed by the four-point scheme.owever, according to the discussion in Section 5, we expect

special behaviour of the form u′′(4,2) for high expansion fac-

ors.In Fig. 3 we compare the behaviour of the limit of the error for

hree, four and five-point spatial discretisation as a function of �e

ig. 2. Dependence of the Log|ErrorPot| on Log(h/R0) for the Cottrell experiment atpherical electrodes. Five-point spatial discretisation, EXTRAP4, �e = 1.05, ı� = 0.01,= 1. The values of R0 are indicated on each curve.

d(tttz

oboet�

uevbmRet

ctpFsdatpn

otentiometry (with G = �/2) at each time step in a spherical electrode using the= 1.05. The values of ı� are (a) 0.2; (b) 0.1; (c) 0.05; (d) 0.02; (e) 0.01; (f) 0.005; (g)

nder several conditions: for planar electrodes (Fig. 3A) and foricroelectrodes (Fig. 3B). In this figure we have used chronopoten-

iometry with constant current but totally equivalent results arebtained using the Cottrell experiment.

For planar electrodes, only the second derivative appears inick‘s second law. A simple visual inspection of Fig. 3A revealshat, as predicted in Section 5, the limit of the error is coinci-ent for the forms (3,2) and (4,2) when �e → 1 and for the forms4,2) and (5,3) at �e =

√2, and, significantly, the best behaviour is

hat provided by the form (4,2) for greater �e-values. Note thathe optimum behaviour of the form (4,2) for high expansion fac-or is attained at �e = 1.55, where the limit of the error crossesero.

In the case of spherical microelectrodes, both, first and sec-nd derivatives appear in Fick‘s law. Fig. 3B reveals a similar goodehaviour of the form (4,2) under these conditions although theptimum �e-value is now �e =

√2 (where the error orders are

qual for first and second derivatives), and the cross-point withhe curve corresponding to five-point discretisation occurs at lowere-values.

From the construction of plots similar to Fig. 3 for different val-es of R0, it is shown that the four-point discretisation for sphericallectrodes gives rise to optimum results using an appropriate �e-alue depending on R0 in the range 1.55 −

√2, with the first value

eing optimum for plane electrodes and the second for sphericalicroelectrodes. The optimum �e-value (�e,opt) as a function of

0 is shown in Fig. 4, which has been obtained using the Cottrellxperiment, but totally equal results are obtained with chronopo-entiometry.

Whereas the optimum �e-value for microelectrodes coin-ides with the value where first and second derivatives showhe same error order, the origin of the optimum value forlane electrodes (where only the second derivative appears inick’s second law) is not clear. However, some light can behed by the consideration of the coefficients for the second

erivative for higher order approximations. Some six, sevennd eight-point formulas for the approximations of the deriva-ives have also been obtained, but are not presented in thisaper because they are, in general, rather complex and probablyot very useful. However, the comparison between the coef-
Page 7: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

1048 F. Martínez-Ortiz et al. / Electrochimica Acta 54 (2009) 1042–1055

F . ı� = 0R indica

fiud

aNntot

FeR

oAtuoNtcf

ig. 3. Dependence of the Log(|ErrorGal|) on �e in chronopotentiometry. EXTRAP40 = 0.01, G = 100

√�/2. The number of points used in each spatial discretisation is

cients of the form u′′(4,2) and the coefficients of the forms′′(5,2), u′′(6,2), u′′(7,2) and u′′(8,2) is of interest. To do this weefine

˛ =N−2∑k=−1

(˛k(N, 2) − ˛k(4, 2))2 (33)

s the distance between the coefficients of the form (N,2) (with

being 5, 6, 7 or 8) and the form (4,2), taking as zero the

on-existing coefficients of the form (4,2). Note that the simili-ude between the forms (4,2) and (N,2) increases when the valuef �˛ tends to zero. Moreover, �˛ = 0 is equivalent to a term-o-term coincidence of the two forms. Fig. 5 shows the level

ig. 4. Dependence of the �e-value corresponding to the minimum error with thelectrode radius using the four-point discretisation scheme. EXTRAP4. h = 0.001 if0 > 1, h = R0/1000 if R0 < 1. ı� = 0.01, � = 1.

oitc

F

.01, � = 1, h = 0.001. (A) Planar electrode. G = √�/2. (B) Spherical microelectrode.

ted on each curve.

f similitude between the form u′′(4,2) and higher order forms.s expected, forms u′′(4,2) and u′′(5,2) coincide for �e =

√2, but

here is also an almost total coincidence between u′′(4,2) and′′(6,2) for �e = 1.49, and the coincidences continue for higherrder forms, leading to a near zero �˛-value for �e = 1.55 and= 8, which corresponds to the optimum �e-value for planar elec-

rodes. Thus, the optimum behaviour of the form u′′(4,2) is aonsequence of the inheritance of the properties of higher orderorms.

We have also investigated whether this optimum in the valuef �e only affects the electrochemical magnitudes calculated or if

t also gives rise to improvements in the calculation of the concen-ration profile. We have used the Cottrell experiment and we haveompared the concentration values calculated from the simulations

ig. 5. Dependence of �˛ on �e (see text). The values of N are shown on the curves.

Page 8: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

F. Martínez-Ortiz et al. / Electrochimica Acta 54 (2009) 1042–1055 1049

F on th� .01, h

w

C

aivp[

8af

cwtbap[stiiatitwgiseolic

luct

r(othe �e-value which gives the same limiting errors as four-pointformulas (1.125, 1.058 and 1.034 for R0 = 1, 0.1 and 0.01, respec-tively). In all cases, we have used the same time-integration schemeand the same time-step. It is evident from this figure that a givenerror value is achieved by the four-point-formulas at higher h

ig. 6. Dependence of the error in simulated concentrations in Cottrell experiment= 1, ı� = 0.01, EXTRAP4. (A) Plane electrode, h = 0.001. (B) Spherical electrode, R0 = 0

ith those provided by the exact solution [14]:

exact = 1 − R0

R0 + xerfc

(x

2�1/2

)(34)

The results, compiled in Fig. 6, show improvements for a widerea in the concentration profile when the optimum value of �e

s used. Hence, the use of the form (4,2) with the optimum �e-alues provides also very accurate values of the concentrationrofile, in contrast with the results given by other procedures18,19].

. The selection of an efficient time-integration schemend the comparison between results obtained with theour-point formulas and other formulas

The results obtained in Section 7 are very interesting but notomplete. We have demonstrated that the limit of the error attainedith the asymmetric form (4,2) at high expansion factors is lower

han the limit obtained with the symmetric forms (3,2) and (5,3),ut it is also necessary to know if this limit is efficiently obtainednd leads to advantages over other alternatives. In Fig. 7 we com-are the efficiency of BI [16], EXTRAP2, EXTRAP3 and EXTRAP417] time-integration procedures for the Cottrell experiment atpherical electrodes with R0 = 1 and �e = 1.421 (corresponding tohe optimum value). To do this, we have taken into account thatn our current implementation, BI algorithm is executed 3-timesn each time step using EXTRAP2 scheme, 5-times in EXTRAP3nd 7-times in EXTRAP4, which is coherent (taking into accounthat some additional steps, as concentration copies are necessaryn higher order time-integration schemes) with the relative cpu-imes taken by each scheme, which are in the ratio 1:3:5.15:8. So,e have selected in Fig. 7 a number of time steps in each inte-

ration scheme inverse to this ratio. In this form, a given �-valuen the x-axis corresponds to the same cpu-time for the differentchemes. A simple visual inspection of this figure shows that the

rrors are always small. However, the better efficiency of higher-rder schemes is evident. It is noteworthy that using EXTRAP4, theimit of the error (ensuring that the result is four-figures accurate)s reached from the third time step. If, under these conditions, wearry out the same calculations using three- or five-point formu-

Fif(

e distance to the electrode surface for the four-point spatial discretisation scheme.= 0.00001. The values of �e are shown on the curves.

as, the errors are, at least 75-times greater (five-point formulas)p to 300-times greater (three-point formulas) and become unac-eptable. Moreover, these errors do not diminish using higher orderime-integration schemes.

Fig. 8 is similar to Fig. 2, but we have selected the asymmet-ic four-point formulas (dashed lines) using the optimum �e-valueall very close

√2) and we have included, for comparison, the anal-

gous plots for five-point formulas (solid lines) using, at each R0,

ig. 7. Comparison of the efficiency of BI, EXTRAP2, EXTRAP3 and EXTRAP4 time-ntegration procedures for the Cottrell experiment at a spherical electrode using theour-point spatial discretisation. R0 = 1, �e = 1.421, h = 0.04. The values of ı� are 0.025BI), 0.075 (EXTRAP2), 0.12875 (EXTRAP3) and 0.2 (EXTRAP4).

Page 9: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

1050 F. Martínez-Ortiz et al. / Electrochimi

Fig. 8. Dependence of the Log|ErrorPot| on Log(h/R0) for the Cottrell experiment atspherical electrodes. Five-point spatial discretisation (solid lines) and four-pointspatial discretisation (dashed lines), EXTRAP4, ı� = 0.2, � = 1. The values of R0 (1,01r

aFrahblsftbmfuot1cMv[

9

dlcttvsOfl

sgst

aoh

t

ifphscwtr

wgcn

sbstTt

G

w

k=m

.1 and 0.01) are indicated on each curve. The values of �e are 1.125, 1.058 and.034 respectively for five-point spatial discretisation and 1.421, 1.415 and 1.4142,espectively, for four-point spatial discretisation.

nd �e values, which, together, give rise to very larger efficiency.or example, if we select an accuracy of 4-figures in the cur-ent, according to results in Fig. 8 (taking into account that were working with absolute errors, but that the dimensionless fluxighly increases as R0 diminishes, which leads to the relative errorseing smaller for smaller radii), then using the four-point formu-

as, h = R0/25 is good enough, and we need only 13 points in thepatial discretisation for R0 = 1, 19 points for R0 = 0.1 and 26 pointsor R0 = 0.01, whereas we need 50, 134 and 268 points, respec-ively, with the five-point formulas. In other words, the formulasased on the asymmetric (4,2) form are between 3 and 10-timesore efficient that the formulas based on the symmetric (5,3)

orm in the digital simulation of spherical electrodes. In the sim-lation of plane electrodes the form (4,2) remains advantageousver the form (5,3): the 4-figures precision requires 8 points inhe spatial discretisation in the first case (h = 0.2, �e = 1.55) and4 in the second one (h = 0.15, �e = 1.20). In all the cases the effi-iency of the form (3,2) is very poor in relation to the others.oreover, the efficiency of form (4,2) at high expansion factors is

ery competitive with the results obtained with “the box method”18,19].

. Simulations using the form (4,2) under other conditions

We have shown the usefulness of the form (4,2) in two veryifferent, but only two situations: the Cottrell experiment (Dirich-

et boundary condition) and chronopotentiometry with constanturrent (Neumann boundary condition). In the Cottrell experimenthere is no variable apart from the electrode radius. In chronopoten-iometry we have, in addition, the dimensionless flux as a possible

ariable. In previous sections we have used appropriate dimen-ionless flux to obtain transition times in the neighbours of � = 1.ur numerical experiences show that using lower dimensionlessux the errors are always lower than those presented in previous

bea

ca Acta 54 (2009) 1042–1055

ections. It is probably sufficient with those situations to infer theeneral usefulness of the form (4,2). However, we have carried outome additional numerical calculations for pulse and multipulseechniques.

To carry out the digital simulation of pulse techniques, even forsimple charge transfer reaction, the simultaneous considerationf both members of the redox couple is imperative. To do this, weave to consider the following previous steps:

To write the diffusion equation (Eq. (17)), for both species.The normalization of new variables (the simplest case comes whenboth diffusion coefficients are equal and only the oxidized speciesis initially present). If the diffusion coefficients are different foreach species, we use different dimensionless spatial variables foreach species, by normalizing with his own diffusion-coefficient.Hence each species diffuses into his own space.To adapt the limiting condition (Eq. (19)) to the presence of bothspecies.To substitute Eq. (20) by the condition of zero-sum of fluxes at theelectrode surface.The inclusion of the Nernst condition (fast charge transfer) orButler–Volmer condition (slow charge transfer).

In all cases, it is necessary to introduce the dimensionless poten-ial,

= nF

RT(E − E0) (35)

After discretisation, the application of the boundary conditionss very different for three- or four-point formulas and for five-pointormulas. Whereas in the former case (three or four points) it isossible to apply the Thomas algorithm and the u–v device [1] (weave applied this device here as in Ref. [20]), in the latter theseimplifications are not possible. Taking into account that we haveompared the behaviour of the three forms in a previous section,e will only study the four-point formulas in this section, with

he aim of demonstrating that the excellent qualities of this formemain unaltered in pulse and multipulse techniques.

In double pulse and multipulse techniques the reference timeas taken as the first pulse duration. Consequently, � reaches values

reater than unity and the diffusion, when big electrodes are used,an reach dimensionless distances greater than 6. Hence, whenecessary, we have used xMAX > 6 in simulations.

In relation to the analytical solution used for comparison, for aimple fast charge transfer reaction at spherical electrodes whenoth species are soluble in the electrolyte solution and both diffu-ion coefficients are equal, there is a simple analytical solution forhe current after an arbitrary sequence of potential pulses [21,22].his equation, in terms of our dimensionless variables can be writ-en as

i =(

1√��i

+ 1R0

)1

1 + ei+

i−1∑m=1

(1√

��mi− 1√

��(m+1)i

)

× 11 + em

(36)

ith

mi =i∑

�k; �ii = �i (37)

When a single pulse is applied (results not shown), theehaviour of form (4,2) is very similar to that found in the Cottrellxperiment with the only difference that errors are slightly smallers the potential becomes less negative. In other words, the Cottrell

Page 10: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

F. Martínez-Ortiz et al. / Electrochimica Acta 54 (2009) 1042–1055 1051

Fah

et

sRtnolptTa

isdstaptc

to

wsGs

Fig. 10. Perturbation, calculated dimensionless current and Log(|ErrorPot|) vs. �plots in the simulation of a square wave-like experiment for a spherical electrode.xMAX = 20. Other conditions as in Fig. 9.

ig. 9. Log(|ErrorPot|) vs. � in the simulation of double pulse chronoamperometry atspherical electrode. Four-point spatial discretisation. EXTRAP4. R0 = 0.1, �e = 1.415,= 0.004, xMAX = 10, ı� = 0.1. 1 = −10. The values of 2 are shown on the curves.

xperiment constitutes an upper limit to the error in single pulseechniques.

Fig. 9 shows the error resulting from the application of aequence of two potential pulses at a spherical electrode with0 = 0.1 and using EXTRAP4. The first one, 1 = −10, is equivalent tohe Cottrell experiment, whereas the second one,2, goes throughegative to positive values. As can be observed, with the exceptionf the first time step in the second pulse, the errors are similar orower than those of the first pulse. They are similar if the secondulse is similar to the first one (in Fig. 9 when 2 = −3, a value nearhe limiting current) and they are lower for 2—values far from 1.his is to say, the Cottrell experiment is also, under these conditions,n upper limit for the errors found.

Fig. 10 shows a typical sequence of i pulses correspond-ng to the application of a square wave-like perturbation to apherical electrode. In this figure we also show the calculatedimensionless current (as previously using the (4,2) forms for thepatial discretisation of profiles) and the error associated withhese calculations. The points at which the current is sampled in

typical square wave experiment are marked in this figure. Asreviously, the errors remain similar or below that in the Cot-rell experiment, and are minimum, at each pulse, in the point ofurrent-sampling.

Fig. 11 shows a more realistic square-wave experiment consti-uted by a sequence of 240 pulses. In the calculations we have takennly three time-steps in each pulse. In this figure we represent

GSW = G2i − G2i−1SW = (2i + 2i−1)/2ErrorSW = GSW − GSW,exact

(38)

here Gi is the current at the end of the i-pulse and i is the dimen-ionless potential applied along the i-pulse. GSW,exact is the value of

SW obtained by application of Eq. (36). To define the square-waveequence we use

�SW = 2i − 2i−1�SCAN = 2(i+1) − 2i

(39)

Fig. 11. Potential dependence of the simulated and analytical square wave current(visually indistinguishable) and of Log(|ErrorSW|) for a spherical electrode. Four-point spatial discretisation. EXTRAP4. R0 = 1, �e = 1.421, h = 0.05, xMAX = 30, ı� = 1/3,0 = 7, �SW = −2, �SCAN = −0.1.

Page 11: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

1 chim

iemtsa

tcdt1a

1

tdiitfdcgAuswoto

TC

˛

˛

˛

˛

˛

TC

ˇ

ˇ

ˇ

ˇ

ˇ

052 F. Martínez-Ortiz et al. / Electro

Fig. 11 contains both GSW and GSW,exact, but they are visuallyndistinguishable, as corresponds to the values of the error, whichnsures, at least, four error free figures in the simulated experi-entally obtainable magnitude, and also shows an error lower than

he Cottrell experiment. It is noteworthy that the simulation pre-ented in this figure (containing 240 potential steps) is obtained, indomestic computer, in some tens of milliseconds.

For single pulse and double pulse potentiostatic perturba-ions there are also exact analytical solutions when the diffusionoefficients of both species in the electroactive couple areifferent [23,24]. We have also compared the simulations ofhese experiments (using the four-point formulas) in the range/25 ≤ DO/DR ≤ 25 with exact solutions. The results (not shown) ares good as those above reported.

0. Conclusions

With the consideration of a grid in which the distance betweenwo consecutive points expands exponentially, the expressions forerivatives for higher order spatial discretisations in electrochem-

cal digital simulations take very simple forms, with coefficientsndependent of the point considered in the grid whereas the deriva-ives depend on the position by a simple division factor. Expressionsor first and second derivatives at arbitrary points are useful for theiscretisation of Fickı̌s second law and for the calculation of theurrent. Moreover, they can be easily deployed in the computer pro-rams necessary to carry out electrochemical digital simulations.lthough excellent commercially available code exists for the sim-lation of general purpose electrochemistry, there are many real

ituations where it is mandatory to write specific programs, mainlyhen working with electrochemical techniques other than the four

r five most common ones. The finite difference approach is easyo understand for non-mathematicians and the multipoint higherrder scheme with an exponentially expanding grid can give accu-

able A1oefficients for the second derivative with the three-point approximation

u′′(3,1); (• ◦ ◦); m = 0, n = 2 u

−2 – –

−1 –

02

1 + �e−

1 − 2�e

22

�e(1 + �e)–

able A2oefficients for the first derivative with the three-point approximation

u′(3,1); (• ◦ ◦); m = 0, n = 2

−2 –

−1 –

0 − 2 + �e

1 + �e

11 + �e

�e

2 − 1�e(1 + �e)

ica Acta 54 (2009) 1042–1055

rate calculations. The occasional electrochemist programmer can,with little effort, develop his own programs using these fully testedcoefficients.

The explicit derivation of the coefficients for multipoint approx-imations leads to the discovery of very favourable particularconditions. In all the situations investigated, with planar andspherical electrodes, the utilisation of the asymmetric four-pointapproximation to the spatial derivatives together with high expan-sion factors and the EXTRAP4 temporal integration scheme givesrise to notable improvements in accuracy and efficacy in compar-ison to the use of even five-point approximations, with the veryimportant advantage that the u–v device can be used to apply theboundary conditions, making the implementation of the simulationof any electrochemical technique very easy. Moreover, the resultsobtained under these conditions are very competitive with thoseobtained with the “box method”. Particularly interesting is multi-pulse, where millions of experiments can be accurately simulatedin seconds.

Acknowledgements

The authors greatly appreciate the invaluable suggestions ofProf. D. Britz. Financial support for this work has been providedby the Ministerio de Educación y Ciencia (Project No. CTQ2006-12552/BQU), and by the Fundación Séneca (Project 03079/PI/05).Also, E. L. thanks the Ministerio de Educación y Ciencia for the grantreceived.

Appendix A

Coefficients for first and second derivatives with three, four orfive-point approximations (Tables A1–A7).

′′(3,2); (◦ • ◦); m = −1, n = 1 u′′(3,3); (◦ ◦ •); m = −2, n = 0

2�4e

1 + �e

2�2e

1 + �e−2�3

e

2�e2�3

e

1 + �e

2�e

1 + �e–

u′(3,2); (◦ • ◦); m = −1, n = 1 u′(3,3); (◦ ◦ •); m = −2, n = 0

–�3

e

1 + �e

− �2e

1 + �e−�e(1 + �e)

�e − 1�e(1 + 2�e)

1 + �e

11 + �e

– –

Page 12: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

F.Martínez-O

rtizet

al./Electrochimica

Acta

54(2009)

1042–10551053

Table A3Coefficients for the second derivative with the four-point approximation

u′′(4,1); (• ◦ ◦ ◦); m = 0, n = 3 u′′(4,2); (◦ • ◦ ◦); m = −1, n = 2 u′′(4,3); (◦ ◦ • ◦); m = −2, n = 1 u′′(4,4); (◦ ◦ ◦ •); m = −3, n = 0

˛−3 – – – − 2�7e (1 + 2�e)

(1 + �e)(1 + �e + �2e )

˛−2 – – − 2�5e (1 − �e)

(1 + �e)(1 + �e + �2e )

2�4e (1 + �e + 2�2

e )1 + �e

˛−1 –2�3

e (2 + �e)

(1 + �e)(1 + �e + �2e )

2�2e (1 + �e − �2

e )1 + �e

− 2�3e (1 + 2�e + 2�2

e )1 + �e

˛0 23 + 2�e + �2

e

(1 + �e)(1 + �e + �2e )

21 − 2�e − �2

e

1 + �e− 2�e(1 + 2�e − �2

e )1 + �e

2�3e (1 + 2�e + 3�2

e )

(1 + �e)(1 + �e + �2e )

˛1 −22 + 2�e + �2

e

�2e (1 + �e)

−21 − �e − �2

e

�e(1 + �e)2�e(1 + 2�e)

(1 + �e)(1 + �e + �2e )

˛2 22 + �e + �2

e

�3e (1 + �e)

21 − �e

�e(1 + �e)(1 + �e + �2e )

– –

˛3 −22 + �e

�3e (1 + �e)(1 + �e + �2

e )– – –

Table A4Coefficients for the first derivative with the four-point approximation

u′(4,1); (• ◦ ◦ ◦); m = 0, n = 3 u′(4,2); (◦ • ◦ ◦); m = −1, n = 2 u′(4,3); (◦ ◦ • ◦); m = −2, n = 1 u′(4,4); (◦ ◦ ◦ •); m = −3, n = 0

ˇ−3 – – – − �6e

1 + �e + �2e

ˇ−2 – –�5

e

(1 + �e)(1 + �e + �2e )

�3e (1 + �e + �2

e )1 + �e

ˇ−1 – − �3e

1 + �e + �2e

−�2e −�e(1 + �e + �2

e )

ˇ0 − 3 + 4�e + 3�2e + �3

e

(1 + �e)(1 + �e + �2e )

− 2 − �2e

1 + �e− 1 − 2�2

e

1 + �e

�e(1 + 3�e + 4�2e + 3�3

e )

(1 + �e)(1 + �e + �2e )

ˇ11 + �e + �2

e

�2e

1�e

1

1 + �e + �2e

ˇ2 − 1 + �e + �2e

�3e (1 + �e)

− 1

�e(1 + �e)(1 + �e + �2e )

– –

ˇ31

�3(1e + �e + �2e )

– – –

Page 13: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

1054F.M

artínez-Ortiz

etal./Electrochim

icaA

cta54

(2009)1042–1055

Table A5Coefficients for the second derivative with the five-point approximation

u′′(5,1); (• ◦ ◦ ◦ ◦); m = 0, n = 4 u′′(5,2); (◦ • ◦ ◦ ◦); m = −1, n = 3 u′′(5,3); (◦ ◦ • ◦ ◦); m = −2, n = 2 u′′(5,4); (◦ ◦ ◦ • ◦); m = −3, n = 1 u′′(5,5); (◦ ◦ ◦ ◦ •); m = −4, n = 0

˛−4 – – – –2�11

e (1 + 3�e + 4�2e + 3�3

e )

(1 + �e)2(1 + �2e )(1 + �e + �2

e )

˛−3 – – –2�9

e (1 − 2�2e )

(1 + �e)2(1 + �2e )(1 + �e + �2

e )− 2�7

e (1 + 2�e + �2e + 3�3

e )

1 + �e + �2e

˛−2 – – −2�7

e (2 − �2e )

(1 + �e)2(1 + �2e )(1 + �e + �2

e )− 2�5

e (1 − 2�3e )

(1 + �e)(1 + �e + �2e )

2�4e (1 + 2�e + 4�2

e + 5�3e + 4�4

e + 3�5e )

(1 + �e)2

˛−1 – 2�4

e (3 + 4�e + 3�2e + �3

e )

(1 + �e)2(1 + �2e )(1 + �e + �2

e )2

�3e (1 + �e)(2 − �e)

1 + �e + �2e

2�2e (1 + 2�e + �2

e − �3e − 2�4

e )

(1 + �e)2− 2�3

e (1 + 2�e + 4�2e + 3�3

e + 3�4e )

1 + �e + �2e

˛0 26 + 9�e + 9�2

e + 7�3e + 3�4

e + �5e

(1 + �e)2(1 + �2e )(1 + �e + �2

e )2

3 − �e − 3�2e − 3�3

e − �4e

(1 + �e)(1 + �e + �2e )

21 − �e − 5�2

e − �3e + �4

e

(1 + �e)2− 2�e(1 + 3�e + 3�2

e + �3e − 3�4

e )

(1 + �e)(1 + �e + �2e )

2�3e (1 + 3�e + 7�2

e + 9�3e + 9�4

e + 6�5e )

(1 + �e)2(1 + �2e )(1 + �e + �2

e )

˛1 −23 + 3�e + 4�2

e + 2�3e + �4

e

�3e (1 + �e + �2

e )−2

2 + �e − �2e − 2�3

e − �4e

�2e (1 + �e)2

−2(1 + �e)(1 − 2�e)

�e(1 + �e + �2e )

2�e(1 + 3�e + 4�2e + 3�3

e )

(1 + �e)2(1 + �2e )(1 + �e + �2

e )–

˛2 23 + 4�e + 5�2

e + 4�3e + 2�4

e + �5e

�5e (1 + �e)2

22 − �3

e

�3e (1 + �e)(1 + �e + �2

e )2

1 − 2�2e

�e(1 + �e)2(1 + �2e )(1 + �e + �2

e )– –

˛3 −23 + �e + 2�2

e + �3e

�6e (1 + �e + �2

e )−2

2 − �2e

�3e (1 + �e)2(1 + �2

e )(1 + �e + �2e )

– – –

˛4 23 + 4�e + 3�2

e + �3e

�6e (1 + �e)2(1 + �2

e )(1 + �e + �2e )

– – – –

Table A6Coefficients for the first derivative with the five-point approximation

u′(5,1); (• ◦ ◦ ◦ ◦); m = 0, n = 4 u′(5,2); (◦ • ◦ ◦ ◦); m = −1, n = 3 u′(5,3); (◦ ◦ • ◦ ◦); m = −2, n = 2 u′(5,4); (◦ ◦ ◦ • ◦); m = −3, n = 1 u′(5,5); (◦ ◦ ◦ ◦ •); m = −4, n = 0

ˇ−4 – – – –�10

e

(1 + �e)(1 + �2e )

ˇ−3 – – – − �9e

(1 + �e)(1 + �2e )(1 + �e + �2

e )− �6

e (1 + �e + �2e + �3

e )

1 + �e + �2e

ˇ−2 – –�7

e

(1 + �e)(1 + �2e )(1 + �e + �2

e )

�5e

1 + �e

�3e (1 + �2

e )(1 + �e + �2e )

1 + �e

ˇ−1 – − �4e

(1 + �e)(1 + �2e )

− �3e (1 + �e)

1 + �e + �2e

− �2e (1 + �e + �2

e )(1 + �e)

−�e(1 + �e)(1 + �2e )

ˇ0 − 4 + 5�e + 7�2e + 5�3

e + 3�4e + �5

e

(1 + �e)(1 + �2e )(1 + �e + �2

e )− 3 + 3�e + �2

e − �3e − �4

e

(1 + �e)(1 + �e + �2e )

−2(1 − �e) − 1 + �e − �2e − 3�3

e − 3�4e

(1 + �e)(1 + �e + �2e )

�e(1 + 3�e + 5�2e + 7�3

e + 5�4e + 4�5

e )

(1 + �e)(1 + �2e )(1 + �e + �2

e )

ˇ1(1 + �e)(1 + �2

e )

�3e

1 + �e + �2e

�2e (1 + �e)

1 + �e

�e(1 + �e + �2e )

1

1 + �e + �2e + �3

e

ˇ2 − (1 + �2e )(1 + �e + �2

e )

�5e (1 + �e)

− 1

�3e (1 + �e)

− 1

(1 + �e)(1 + �2e )(1 + �e + �2

e )– –

ˇ3(1 + �e)(1 + �2

e )

�6e (1 + �e + �2

e )

1

�3e (1 + �e)(1 + �2

e )(1 + �e + �2e )

– – –

ˇ41

�6e (1 + �e)(1 + �2

e )– – – –

Page 14: Electrochemical digital simulations with an exponentially expanding grid: General expressions for higher order approximations to spatial derivatives: The special case of four-point

F. Martínez-Ortiz et al. / Electrochimica Acta 54 (2009) 1042–1055 1055

Table A7Limiting cases of the coefficients given in Tables A1–A6 when �e → 1

u′′(3,1) u′′(3,2) u′′(3,3) u′′(4,1) u′′(4,2) u′′(4,3) u′′(4,4) u′′(5,1) u′′(5,2) u′′(5,3) u′′(5,4) u′′(5,5)

˛−4 – – – – – – – – – – – 11/12˛−3 – – – – – – −1 – – – −1/12 −14/3˛−2 – – 1 – – 0 4 – – −1/12 1/3 19/2˛−1 – 1 −2 – 1 1 −5 – 11/12 4/3 1/2 −26/3˛0 1 −2 1 2 −2 −2 2 35/12 −5/3 −5/2 −5/3 35/12˛1 −2 1 – −5 1 1 – −26/3 1/2 4/3 11/12 –˛2 1 – – 4 0 – – 19/2 1/3 −1/12 – –˛3 – – – −1 – – – −14/3 −1/12 – – –˛4 – – – – – – – 11/12 – – – –

u′(3,1) u′(3,2) u′(3,3) u′(4,1) u′(4,2) u′(4,3) u′(4,4) u′(5,1) u′(5,2) u′(5,3) u′(5,4) u′(5,5)

ˇ−4 – – – – – – – – – – – 1/4ˇ−3 – – – – – – −1/3 – – – −1/12 −4/3ˇ−2 – – 1/2 – – 1/9 3/2 – – 1/12 1/2 3ˇ−1 – −1/2 −2 – −1/3 −1 −3 – −1/4 −2/3 −3/2 −4ˇ0 −3/2 0 3/2 −11/6 −1/2 1/2 11/6 −25/12 −5/6 0 5/6 25/12ˇ1 2 1/2 – 3 1 1/3 – 4 3/2 2/3 1/4 –ˇ2 −1/2 – – −3/2 −1/6 – – −3 −1/2 −1/12 – –ˇ3 – – – 1/3 – –ˇ

R

[[[

[[[

[[[[[

4 – – – – – –

eferences

[1] D. Britz, Digital Simulation in Electrochemistry, 3rd ed., Springer, Berlin, 2005.[2] D.J. Gavaghan, J. Electroanal. Chem. 456 (1998) 1.[3] M. Rudolph, J. Electroanal. Chem. 529 (2002) 97.[4] L.K. Bieniasz, J. Electroanal. Chem. 558 (2003) 167.[5] M. Rudolph, J. Electroanal. Chem. 558 (2003) 171.[6] D. Britz, Electrochem. Commun. 5 (2003) 195.[7] D. Britz, J. Strutwolf, Comput. Biol. Chem. 27 (2003) 327.

[8] T. Joslin, D. Pletcher, J. Electroanal. Chem. 49 (1974) 171.[9] Y.H. Pao, R.J. Daugherty, Time-dependent viscous incompressible flow past a

finite flat plate, Tech. Rep. Rept. DI-82-0822, Boeing Sci. Res. Lab., 1969.10] S.W. Feldberg, J. Electroanal. Chem. 127 (1981) 1.11] D. Britz, J. Strutwolf, Comput. Chem. 24 (2000) 673.12] J. Strutwolf, D. Britz, Comput. Chem. 25 (2001) 511.

[[[

[

– 4/3 1/12 – – –– −1/4 – – – –

13] D. Britz, J. Electroanal. Chem. 352 (1993) 17.14] A.J. Bard, L.R. Faulkner, Electrochemical Methods, Wiley, New York, 2001.15] G. Mamantov, P. Delahay in, P. Delahay, C.C. Mattax, T. Berzins, J. Am. Chem. Soc.

76 (1954) 5319.16] P. Laasonen, Acta Math. 81 (1949) 309.17] J. Strutwolf, W.W. Schoeller, Electroanalysis 9 (1997) 1403.18] M. Rudolph, J. Electroanal. Chem. 543 (2003) 23.19] M. Rudolph, J. Electroanal. Chem. 571 (2004) 289.20] F. Martínez-Ortiz, J. Electroanal. Chem. 574 (2005) 239.

21] A. Molina, C. Serna, L. Camacho, J. Electroanal. Chem. 394 (1995) 1.22] N. Fatouros, J. Chevalet, R.M. Reeves, J. Electroanal. Chem. 197 (1986) 5.23] A. Molina, C. Serna, F. Martínez-Ortiz, E. Laborda, J. Electroanal. Chem. 617

(2008) 14.24] A. Molina, C. Serna, F. Martínez-Ortiz, E. Laborda, Electrochem. Commun. 10

(2008) 376.