Modelling electrode behaviour