This is a the code repository accompanies with "Differentiable Electrochemistry: A paradigm for uncovering hidden physical phenomena in electrochemical systems" submitted to ACS Energy Letters.
This repository features differentiable simulation of voltammetry covering diffusion, migration and convection, along with both Butler-Volmer and Marcus-Hush-Chidsey kinetics. These partial differential equations (PDEs) are solved with mostly Finite Difference method (implicit Euler scheme) or Finite Element method. In short, electrochemical simulations are made end-to-end differentiable for parameter estimation and optimization.
The purposes of this repository are twofold:
- Introducing the art of differentiable simulations to electrochemists with abundant transferable simulators and case studies (tutorials)
- Applying Differentiable Electrochemistry simulations to solve bottleneck problems in electrochemistry
The electrochemical simulations used Finite Difference (FD) or Finite Element (FE) methods, and made differentiable using JAX.
A worflow of formulating a Differentiable Electrochemistry simulator and performing computation on large clusters. To enable ensemble prediction, there are multiple DiffECManager running in parallel. Each DiffEC manager initiates a sequence of N DiffECWorker for N epochs of optimization. A Slurm workload manager is used to coordinate compute. A graphical illustration is shown below:
Python 3.11 and JAX 0.4.34
It's also very important to enable float64 for JAX to enable high precision computing. float32 by default will not work for some cases. In the Python script, and after JAX import,
jax.config.update("jax_enable_x64", True)
Hardware requirements varies in the forward vs. reverse mode. If simulations are performed only in the forward mode, the memory requirement is similar to conventional simulator (a few Gigabytes would suffice). On the contrary, if simulations are performed in the reverse mode for gradient computation, the memory requirement scales with the space and time steps during the simulation. For nonlinear or linear problems, ~80 or 10 GB is recommended.
Since Differentiable Simulation is a new regime in scientific modeling, it is thus very important for beginners to learn the art of differentiable simulation and differentiable simulation in the context of electrochemistry. In here, five simulators that are fully differentiable and transferable are provided to enlighten readers the art of differentiable simulation. They five differentiable simulators are:
- Fundamental Cyclic Voltammetry Simulator. Models the simplest one-electron redox reaction.
- Voltammetry in Weakly Supported Media. Extends fundamental CV with electrolyte migration effects by solving Nernst-Planck-Poisson equation. BV and MHC kinetics are supported.
- Dissociative EC Simulator. Models coupled chemical-electrochemical mechanisms, where a species dissociates chemically before electron transfer. A <-> B+C , B+e- <-> D.
- Hydrodynamic Voltammetry Simulator. Models rotating-disk electrode (RDE) experiments under convection-diffusion mass transport.
- Electrochemical Adsorption/Desorption Simulator. Simulates surface-confined redox reactions and Langmuir isotherm adsorption/desorption processes. The mechanism is shown below:

Overall, these simulators cover a broad range of electrochemical phenomena (diffusion, migration, convection, and coupled reactions), and are differentiable with respect to key physicochemical parameters, enabling gradient-based fitting, sensitivity analysis, and machine learning integration.
- Voltammetry in weakly supported media BV kinetics Estimating electrochemical kinetics from Butler-Volmer or Marcus-Hush-Chidsey formalism with migration-diffusion mass transport described with Nernst-Planck-Poisson equations
- Voltammetry in weakly supported media MHC kinetics Estimating electrochemical kinetics from Marcus-Hush-Chidsey formalism with migration-diffusion mass transport described with Nernst-Planck-Poisson equations
- Chronoamperometry of acetic acid reduction Estimating nonlinear chemical kinetics with convergent diffusion mass transport
- Differentiable Electrochemistry for voltammetry of adsorbed species A total of 10 parameters are discovered simultaneously with gradient-based optimization!
- Hydrodynamic voltammetry Estimating kinematic viscosity with convection-diffusion mass transport. This example is available at https://colab.research.google.com/drive/1Pq3szUPe8uvd9pw-ZVAZSCmX8nQH2CSM?usp=sharing
- Adsorption/Desorption Simultaneously discover 10 parameters from a set of voltammograms. This example is featured in the DiffEC Adsorption folder in the main directory.
- Differentiable Electrochemistry for Fe3+/Fe2+ redox couple Electrochemical rate constant, average diffusion coefficient, cathodic and anodic electrochemical rate constants are simultaneously discovered from multiple voltammograms at different scan rates. This is a major advancement from conventional Tafel analysis and Nicholson method.
- Differentiable Electrochemistry for RuHex redox couple Since the RuHex couple is usually considered fully reversible, the formal potential and average diffusion coefficients are discovered.
- Transfer coefficient from LSV on Rotating Disk Electrode Using differentiable electrochemistry to build a direct correlation between linear sweep voltammogram of Hydrogen Evolution Reaction with its transfer coefficient and electrochemical rate constant. In this example, Differentiable Electrochemistry analyzed the HER LSV data reported by Koper et al.(ACS Energy Lett. 2024, 9, 4, 1871–1879) by fully accounting for convection-diffusion mass transport and kinetics. A "Tafel Region" is unnecessary.
- Mechanistic Identification of Li electrodeposition/stripping. Using transient voltammetry data reported by Boyel et al. (ACS Energy Lett. 2020, 5, 3, 701–709), Differentiable Electrochemistry is applied to fit transient data with Marcus-Hush (MH),Marcus-Hush-Chidsey (MHC), and the approximate Marcus-Hush-Chidsey (JEAC, 735, 77, 2014). Notably, we enabled direct parameterization of MHC without replying approximation.
- Mass transport in concentrated electrolytes Estimating salt diffusivity and transference number from Operando concentration and velocities fields from XAM and XPCS with concentrated solution theory.
We recommend issue reports in the Discussions channel.
The paper is currently on preprint server. Please cite as: arXiv:2511.11631

