Imperial College London


Faculty of Natural SciencesDepartment of Physics

Lecturer in Experimental Solid State Physics



+44 (0)20 7594 7609piers.barnes




1003Huxley BuildingSouth Kensington Campus




DRIFTFUSION: A time dependent drift diffusion code for simulating solar cells in MATLAB

We have developed a time dependent drift diffusion code suitable for simulating solar cells in one dimension. The model solves for the profiles of electrical potential, free electron concentration, free hole concentration, and mobile ion concentration as a function of time. The model is written in MATLAB and is based on the pdepe solver. We have been using it to explore hysteresis in perovskite solar cells.[1]

The first version of the code which describes p-i-n structures is available on GitHub, with notes and examples of how to use it:

The primary developer of the DRIFTFUSION code was Dr Phil Calado, with contributions from Ilario Gelmetti (ICIQ), Mohamed Azzouzi and Benjamin Hilton.

[1] Calado P, Telford AM, Bryant D, Li X, Nelson J, O'Regan BC, Barnes PRFet al., 2016, Evidence for ion migration in hybrid perovskite solar cells with minimal hysteresis, NATURE COMMUNICATIONS, Vol: 7, ISSN: 2041-1723 Author Web Link, Open Access Link, Cite