File Exchange

image thumbnail

Cyclic Voltammetry Simulator

version (413 KB) by Peter Attia
Cyclic voltammetry simulator


Updated 15 Oct 2017

GitHub view license on GitHub

A simple cyclic voltammetry simulator, built as a MATLAB app. Used R2017a App Designer. Based on Appendix B in Bard & Faulkner. See for details.

Comments and Ratings (7)

nice,,, is there a way of getting the x-y data ?

Shuo Wang

Hi Peter, thanks for your reply, I get it.

-Shuo Wang

Peter Attia

Hi Shuo, yes this is correct. I just tested it with a potential range of +/- 5V and a scan rate of 10^-10 V/s, which are the practical limits for any CV simulations I personally study. It's possible there are other cases that "break" the simulation, but I haven't encountered them in my work. There is a numerical instability for very high chemical reaction rates - the code will warn you if you are in this regime. Bard and Faulkner also review this case (2nd ed., pg 797).

Shuo Wang

Hi, Peter,

I just reviewed your code, it seems to me the algorithm is an explicit difference method with dimensionless variables, have you experienced some numerical stability problems with specific parameters, e.g., a large potential range or slow scan rate? Many thanks.

Shuo Wang

Peter Attia

Thanks for your comment. Sorry to hear you can't run the app. I've posted a standalone script on my website: Since the B&F solution is analytical, it runs very quickly.

Shuo Wang

Hi, doctor Attia,

I built a similar simulator a few months ago too, I would like to try your simulator, but I do not have R2017a. I use a built-in PDE solver pdepe, which is time-consuming. I note that the algorithm in B&F's book may be more efficient. I wonder how long does your simulator complete a simulation?

Shuo Wang


Fixed error in chemical reaction term for species O

Added concentrations and install file

removed number of electrons transferred

Updated screenshot on FEX

MATLAB Release Compatibility
Created with R2017a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.

Learn About Live Editor