You are on page 1of 39

Computer Simulation of Molecular Electrochemistry Experiments A Rational Approach

Kai Ludwig and Bernd Speiser Institut fur Organische Chemie, Universitat Tubingen

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.1/21

Simulation

mechanism, transport, geometry (physicochemical model)

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.2/21

Simulation

mechanism, transport, geometry (physicochemical model)

partial differential equations (mathematical model)

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.2/21

Simulation

mechanism, transport, geometry (physicochemical model)

partial differential equations (mathematical model)

concentration proles, current/potential curves (numerical model)

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.2/21

Simulation and Molecular Electrochemistry

uses of simulation in molecular electrochemistry: analyze experimental data by comparison to calculations predict experimental responses for complex systems numerical calculations: digital simulation (Feldberg, 1969) programs for specic purposes vs. software packages

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.3/21

Simulation Packages

purpose: help non-programmers to apply simulation in everyday work selection of more or less extended and popular simulation packages in the literature: EASI (Speiser, since 1990) xed list of mechanisms Elsim (Bieniasz, since 1992) complex mathematical relationships Digisim (Feldberg, Rudolph, et al., since 1994) any mechanism, windows style, CV DigiElch (Rudolph, 2004) variation of Digisim

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.4/21

Common Problems with Simulation Packages

complex code (difcult to understand and maintain) extension difcult or impossible (mechanisms, geometries, transport phenomena, experiments) proprietary code (distribution as binary executable) limited testing (open science based on access to code)

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.5/21

A Possible Rational Solution

based on two paradigms:


use object-oriented programming techniques provide open-source code

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.6/21

A Possible Rational Solution

based on two paradigms:


use object-oriented programming techniques provide open-source code

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.6/21

Object-Oriented Methods I

denition: writing program text decomposed in modules (wikipedia.org) which encapsulate data and actions

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.7/21

Object-Oriented Methods I

denition: writing program text decomposed in modules (wikipedia.org) which encapsulate data and actions use: large scale software projects

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.7/21

Object-Oriented Methods I

denition: writing program text decomposed in modules (wikipedia.org) which encapsulate data and actions use: large scale software projects possible advantages: production of exible, extensible code re-use of tested code localized debugging and maintenance better understanding of real system

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.7/21

Object-Oriented Methods II

three common steps of working with the object-oriented paradigm: analysis: identify concepts (in the real system) design: describe interaction, dene classes (construction plans for objects) programming: implement in a programming language (write the code)

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.8/21

Object-Oriented Methods III

object: instantiation of a class a program: collection of interacting objects relations between classes (and objects): exchange of information composition derivation

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.9/21

Object-Oriented Methods III

object: instantiation of a class a program: collection of interacting objects relations between classes (and objects): exchange of information composition derivation

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.9/21

Object-Oriented Methods III

object: instantiation of a class a program: collection of interacting objects relations between classes (and objects): exchange of information composition derivation

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.9/21

Object-Oriented Methods III

object: instantiation of a class a program: collection of interacting objects relations between classes (and objects): exchange of information composition derivation

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.9/21

Object-Oriented Methods III

object: instantiation of a class a program: collection of interacting objects relations between classes (and objects): exchange of information composition derivation objects are building blocks of program

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.9/21

Technical Aspects of EChem++

programming language: C++ operating system: Linux extended use of libraries


Quantity Spirit GiNaC GMM++ VTK Qt tree.hh

quantity.sourceforge.net spirit.sourceforge.net www.ginac.de www.gmm.insa-tlse.fr/getfem public.kitware.com/VTK www.trolltech.com www.damtp.cam.ac.uk/user/kp229/tree

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.10/21

Example Objects in EChem++ I

excitation functions: induce changes during experiment class Segment, class ExcitationFunction

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.11/21

Example Objects in EChem++ I

excitation functions: induce changes during experiment class Segment, class ExcitationFunction

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.11/21

Example Objects in EChem++ I

excitation functions: induce changes during experiment class Segment, class ExcitationFunction

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.11/21

Example Objects in EChem++ I

excitation functions: induce changes during experiment class Segment, class ExcitationFunction

Segment DISegment<D,I> virtual D value( I ) = 0 I maximum() I Imax

LinearSegment<D,I> D value( I ) D starting_value D end_value

ConstantSegment<D,I> D value( I ) D constant_value

PowerSegment<D,I> D value( I ) D d_0 D d_1 I i_1 double power

SineSegment<D,I> D value( I ) D offset D amplitude Frequency angular_frequency PlaneAngle phase_shift

ExponentialSegment<D,I> D value( I ) D d_0 D d_1 Frequency omega

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.11/21

Example Objects in EChem++ I

excitation functions: induce changes during experiment class Segment, class ExcitationFunction

ExcitationFunction DIExcitationFunction<D,I> virtual void add( DISegment<D,I> ) D value( I ) vector<D> values( vector<I> ) vector<D> values( I , int ) I maximum() vector<DISegment*> segments SDIExcitationFunction<D,I,S<D,I> > void add( S<D,I> ) DISegment<D,I> virtual D value( I ) = 0 I maximum() I Imax

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.11/21

Example Objects in EChem++ II

reaction network: translate mechanisms into internal representation class ReactionNetwork, class Law

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.12/21

Example Objects in EChem++ II

reaction network: translate mechanisms into internal representation class ReactionNetwork, class Law

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.12/21

Example Objects in EChem++ II

reaction network: translate mechanisms into internal representation class ReactionNetwork, class Law
reactionNetwork reactionBlock reaction educts reactionAddend species neutrum A + reactionArrow products reactionAddend species neutrum B ; options boundaryOperator b< integer 1 > ;

reactionAddend <=> species electron e-

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.12/21

Example Objects in EChem++ II

reaction network: translate mechanisms into internal representation class ReactionNetwork, class Law

Law value() gradient() add( int , Law*) parameters()

ZeroLaw value() gradient() add( int, Law*)

ButlerVolmer value() gradient() add( int , Law*)

GenericRateLaw value() gradient() add( int , Law*)

PowerRateLaw value() gradient() add( int , Law*)

CompositeLaw value() gradient() add( int , Law*)

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.12/21

Example Objects in EChem++ III

numerical integration: solve differential equations by adaptive multilevel nite element method class RotheRosenbrock, class MFEM

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.13/21

Example Objects in EChem++ III

numerical integration: solve differential equations by adaptive multilevel nite element method class RotheRosenbrock, class MFEM

integrate systems of c 2c = D 2 + (c) t x subject to appropriate initial and boundary conditions

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.13/21

Example Objects in EChem++ III

numerical integration: solve differential equations by adaptive multilevel nite element method class RotheRosenbrock, class MFEM
RotheRosenbrock kineticTerms Law Law

updateMeshData() step( u_new, r_new, eps_x, eta, boundaryTerms un, tn, tau, coarseError )

RotheRos3P updateMeshData() step( u_new, r_new, eps_x, eta, un, tn, tau, coarseError )

RotheROWDA3 updateMeshData() step( u_new, r_new, eps_x, eta, un, tn, tau, coarseError )

RotheRos2 updateMeshData() step( u_new, r_new, eps_x, eta, un, tn, tau, coarseError )

RotheRodasP updateMeshData() step( u_new, r_new, eps_x, eta, un, tn, tau, coarseError )

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.13/21

Proposed Electrochemical Simulation High Level Modules

HardwareControl Cell Experiment ExcitationFunction Analysis Data

Model

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.14/21

Example Simulation I: pseudo-rst order reaction

B + e

E 0 , ks , , D k

B + C D

assume: cyclic voltammetry, cC = 100 cA , k = 100 s1 treat follow-up reaction as second order (e.g., in DigiSim) pseudo-rst order (power rate law: r = kcB ; this work) decouple stoichiometry and kinetics

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.15/21

Example Simulation II: non-triangular wave forms

A B + e

E 0 , ks , , D

assume: accumulation of B in diffusion layer by prolonged potential-controlled oxidation E vary excitation functions:

use of more complicated, non-triangular waveforms

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.16/21

Example Simulation III: two working electrode system


A B + e A + e C B + C 2A
0 E1 , ks,1 , 1 , D1 0 E2 , ks,2 , 2 , D2

K, k

assume: generate oxidation and reduced form at two working electrode 1 electrode 2 electrodes
specify electrode geometry: d = 50 m k = 107 l mol1 s1
0 0 E1 = +0.25 V, E2 = 0.25 V

A B + e diffusion

B + C 2A

diffusion A + e C dene complex geometries with multiple boundaries (currently only 1D)

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.17/21

EChem++ and Open Source Paradigm


open-source software is open for . . . use modication redistribution in source form apart from licence considerations, this is promoted within EChem++ by . . . modular, object-oriented design extendability free availability on the internet

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.18/21

Conclusion: The EChem++ Simulation Package

simulation software for molecular electrochemistry code based on object-oriented methods provides framework for extensions to additional processes, conditions, etc. already in present state some improvements above existing software open-source character

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.19/21

Invitation

download, test, report, contribute


http://echempp.sourceforge.net

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.20/21

Acknowledgements

nancial support: Deutsche Forschungsgemeinschaft co-operation: excitation function: L. Rajendran graphical user interface: A. Millers

Computer Simulation of Molecular Electrochemistry ExperimentsA Rational Approach p.21/21

You might also like