A unified approach to linear electrochemical systems